PDA

View Full Version : executing g++ command with qt



saman_artorious
16th September 2013, 11:51
I want to compile the following command with qt:

#g++ -o main main.cpp -I /opt/intel/ipp/include -I /opt/intel/composer_xe_2013_sp1/mkl/include
#-L /opt/intel/ipp/lib/ia32 -L /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32
#-lippi -lipps -lippcore -lpthread -lm -lmkl_rt

I know about

LIBS += -lippi -lipps -lippcore -lpthread -lm -lmkl_rt

but what about the libraries and include paths?

high_flyer
16th September 2013, 11:54
What is the actual question?
What do you mean by "with qt"?
If the code you are compiling main.cpp does not depend on Qt, then there is no need to specify any Qt dependency...
But then again, I didn't really understand you question.

saman_artorious
16th September 2013, 12:08
What is the actual question?
What do you mean by "with qt"?
If the code you are compiling main.cpp does not depend on Qt, then there is no need to specify any Qt dependency...
But then again, I didn't really understand you question.

you misunderstood me. I can compile the code successfully with the above command(forget about qt). Now, I want to open the code with qt IDE and add the include paths n libraries to it. I only added LIBS += values as I mentioned above. However, I get error and don't know how to set the -I include parameters and -L libraries from the command above.

wysota
16th September 2013, 13:18
Use the INCLUDEPATH variable.

saman_artorious
16th September 2013, 13:45
I added the variables as following, the program ran once and gave results, but in the next run it gives same include file error. As I am not sure about the structure, I post them here:


LIBS += -lippi -lipps -lippcore -lpthread -lm -lmkl_rt -L/opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -L/opt/intel/ipp/lib/ia32

INCLUDEPATH += -I/opt/intel/ipp/include -I/opt/intel/composer_xe_2013_sp1/mkl/include

#g++ -o main main.cpp -I /opt/intel/ipp/include -I /opt/intel/composer_xe_2013_sp1/mkl/include
#-L /opt/intel/ipp/lib/ia32 -L /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32
#-lippi -lipps -lippcore -lpthread -lm -lmkl_rt

anda_skoa
16th September 2013, 14:18
Try the INCLUDEPATH content without the -I, i.e. just the paths

Cheers,
_

saman_artorious
16th September 2013, 14:30
Try the INCLUDEPATH content without the -I, i.e. just the paths

Cheers,
_

I am sorry, but I did not get the result yet:

LIBS += /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -lmkl_rt /opt/intel/ipp/lib/ia32 -lippi -lipps -lippcore -lpthread -lm
INCLUDEPATH += /opt/intel/ipp/include /opt/intel/composer_xe_2013_sp1/mkl/include


error: cannot find /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32: File format not recognized
error: cannot find -lmkl_rt
error: cannot find /opt/intel/ipp/lib/ia32: File format not recognized
error: cannot find -lippi
error: cannot find -lipps
error: cannot find -lippcore
error: collect2: ld returned 1 exit status

wysota
16th September 2013, 14:43
Probably because you were supposed to do that with contents of INCLUDEPATH and not LIBS.

saman_artorious
17th September 2013, 08:01
correct format:


INCLUDEPATH += /opt/intel/ipp/include /opt/intel/composer_xe_2013_sp1/mkl/include
LIBS += -L/opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -lmkl_rt -L/opt/intel/ipp/lib/ia32 -lippi -lipps -lippcore -lpthread -lm

ChrisW67
17th September 2013, 08:43
I am curious why you would use qmake and GCC to compile a non-Qt program that clearly is designed to be linked with components of the Intel compiler suite?