Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to add Intel Performance Primitives to my project? ippInit() failure



  • Hello,
    I am just a newbie on Qt and couldn't resolve IPP instantiation on my project.
    In my .pro file i added the includepath and libs as follows

    INCLUDEPATH += $$(IPP_DIR)

    where I set in Environmental Variables as IPP_DIR = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\include

    LIBS += $$(IPP_LIB_X64)\ippcore.lib $$(IPP_LIB_X64)\ippsmt.lib $$(IPP_LIB_X64)\ippvmmt.lib $$(IPP_LIB_X64)\ippcoremt.lib

    where I set in Environmental Variables as C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\lib\intel64_win\threaded

    in mainwindow.cpp is my simple code:

    code_text
    ```#include <ipp.h>
    #include <ippcore.h>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
        const       IppLibraryVersion* libVersion;
        IppStatus   status;
        Ipp64u      cpuFeatures, enabledFeatures;
    
        ippInit();                      /* Initialize Intel(R) IPP library */
        libVersion = ippGetLibVersion();/* Get Intel(R) IPP library version info */
    
        qDebug() << libVersion << endl;
        status = ippGetCpuFeatures(&cpuFeatures, 0);```
    code_text
    

    it builds successfully both in Release and Debug modes but crashes when i run the program.
    Can anyone suggest me how to add Intel Performance Primitives properly ? Thank you

    Maya


  • Lifetime Qt Champion

    Hi,

    Did you add the folder where the corresponding dlls can be found to the PATH environment variable ? If not, go to the Run part of the Project panel and modify it there.



  • @SGaist said in How to add Intel Performance Primitives to my project? ippInit() failure:

    Hi,

    Did you add the folder where the corresponding dlls can be found to the PATH environment variable ? If not, go to the Run part of the Project panel and modify it there.

    Yes I have added the necessary PATH entries, as indicated in my post. But I guess i'm referencing wrong ones..??
    My .pro files as follows

    LIBS +=  $$(IPP_LIB_X64)\ippcore.lib $$(IPP_LIB_X64)\ippsmt.lib $$(IPP_LIB_X64)\ippvmmt.lib $$(IPP_LIB_X64)\ippcoremt.lib $$(IPP_LIB_X64)\ipps.lib
    
    INCLUDEPATH +=  $$(IPP_DIR)
    

    and the system variables are as follows

    IPP_DIR = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\include
    
    IPP_LIB_X64 = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\lib\intel64_win\threaded
    

    but still the program crashes whenever I add the ippInit() function call as stated in previous message.
    I also checked the Run part of the Project panel as you suggested and saw that Base Environment for this run configuration is set to Build Environment and has all the System variables added to PATH are visible there.
    ![alt text](f7fdbbcf-5edd-43f5-ae42-602a71d4cf98-image.png image url)


  • Lifetime Qt Champion

    There might be a misunderstanding here. I am talking about the environment variable that is literally called PATH. And there's no trace of it in your screenshot.



  • @SGaist I have selected System Environment for Build environment and there PATH exists.
    I have already added the binaries path to my System Environment PATH

    380ee00c-0194-4cfb-9648-eb56c264e66f-image.png

    and my simple .pro file, I have changed it to this

    e562ec0b-59b1-45a2-9871-65f86e1ed80b-image.png

    Now I was able to build the code.
    Both way of declaring the LIBS works fine. Either explicitly but with " " and use / instead of \

    I used as User Variables:

    IPP_DIR = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\include
    IPP_LIB_X64 = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\ipp\lib\intel64_win
    
    

    and as System Variable

    INTEL_IPP_PATH  = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\redist\intel64_win\ipp
    

    It worked fine.
    Keeping it here for whom getting trouble to add Intel Performance Primitives integration to Qt.

    095ef654-10d1-4140-a790-c0bac6ca9162-image.png


Log in to reply