0

Hi I can not understand why I cant build the simple sample from intels IPP libaray using visual studio code it keeps saying fatal error: ipp.h: No such file or directory 2 | #include "ipp.h". I don't understand why VSCODE intellisense can see all the ipp includes fine. Im using Ubuntu 20.04 gcc/g++ 9 and visual studio code 1.50.1. I can compile and run the sample fine if I use

g++ -g ipptest.cpp -I $IPPROOT/include -L$IPPROOT/lib/intel64 -o ipptest -lippi -lipps -lippcore

then run

./ipptest

From the command line my task.json file looks like this

{
"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${file}",
            "-I ${IPPROOT}/include",
            "-L ${IPPROOT}/lib/intel64",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}",
            "-lippi -lipps -lippcore"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "compiler: /usr/bin/g++"
    }
]

}

and c_cpp_properties.json

{
"configurations": [
    {
        "name": "Linux",
        "includePath": [
            "${IPPROOT}/**",
            "${workspaceFolder}/**"
        ],
        "defines": [],
        "compilerPath": "/usr/bin/gcc",
        "cStandard": "gnu17",
        "cppStandard": "gnu++14",
        "intelliSenseMode": "gcc-x64"
    }
],
"version": 4

}

nchannon
  • 7
  • 1

1 Answers1

0

Ok found the problem visual studio code not very smart in telling you whats wrong eventually I found the problem.

the problem is in the task.json file

fixed version of the task.json file

{
"version": "2.0.0",
"tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ build active file",
        "command": "/usr/bin/g++",
        "args": [
            "-g",
            "${file}",
            "-I${IPPROOT}/include",
            "-L${LD_LIBRARY_PATH}",
            "-lippcore",
            "-lipps",
            "-lippi",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "/usr/bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": "build",
        "detail": "compiler: /usr/bin/g++"
    }
]

}

problem -I ${IPPROOT}/include wrong -I${IPPROOT}/include correct cant have a space between -I and $ also each library file must be added on a new line eg: cant write it like this "-lipps -lippi -lippcore" must be written like this "-lipps", "-lippi", "-lippcore"

Hope this helps anyone experiencing the same problem

nchannon
  • 7
  • 1