Software Archive
Read-only legacy content
17061 Discussions

compile with -mmic gives an error "cannot open source file"

Valjean__Jean
Beginner
1,540 Views

I use gsl libraries in my code. When I compile it with sse4.2, avx, avx2 everything works fine. When I try to compile with -mmic an error is coming up.

$ icpc -mmic test.cpp -lgsl -lgslcblas

test.cpp(4): catastrophic error: cannot open source file "gsl/gsl_statistics_long_double.h"

What should I do to jump over this error ?

If you have an idea please detail it a bit more because I'm just an enthusiast, not a professional.

thank you

ps:

I found a similar topic about other library, but is too old (2014) ant the links are not working anymore.

0 Kudos
5 Replies
JJK
New Contributor III
1,540 Views

how did you build the gsl library? and which version of it? Several years back I compiled gsl 1.16 for the mic without too many problems (https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/520608)

I just downloaded gsl 2.6 and it also compiles OK for the mic using

 

./configure --host=x86_64-unknown-linux-gnu CC=icc CXX=icpc CFLAGS="-mmic"

 

0 Kudos
Valjean__Jean
Beginner
1,540 Views

It works, thank you for your answer, take care keep safe !

 

0 Kudos
Zimin__Gleb
Beginner
1,540 Views

I have the same error, but I've already tried to build gsl lib with "-mmic" flag.
May be the problem is that I've installed this lib not in the default place. Here is the example of command.
$ icc -I/home/gzimin/gsl/usr/local/lib/ -fopenmp -mmic -lgsl calc_mic_native.c -o calc_native_mic
But I get
calc_mic_native.c(33): catastrophic error: cannot open source file "gsl/gsl_errno.h"

0 Kudos
Valjean__Jean
Beginner
1,540 Views

Take my answer as from an enthusiast, I don't know what is the best way but for me was working as bellow described.

According to gsl documentation the folder should be "/usr/local/lib/include/", in my case was only "/usr/local/lib/". You can adjust this on the last step "make install" by writing the path where you want gsl to be installed (-destination folder). If you didn't make it, just search for the output (the gsl libraries .so) using find and export the path

export SINK_LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib

You can also do a copy of the compiled library in the coprocessor with "# scp -r /usr/local/lib/* mic0:/lib64/" but it is not persistent over reboot (and the OS must be captured according to mpss documentation chapter 7.2.2 pag 112)

I also found in internet something to add when compile  "-L/usr/local/lib -lgsl ${GSL_CBLAS_LIB} -lm -lm" but for me was already working, I didn't try it.

I hope it helps

0 Kudos
JJK
New Contributor III
1,540 Views

most likely the gsl header files are installed in /home/gzimin/gsl/usr/local/include, instead of /home/gzimin/gsl/usr/local/lib

Try using

icc -I/home/gzimin/gsl/usr/local/include/ -fopenmp -mmic -L/home/gzimin/gsl/usr/local/lib -lgsl calc_mic_native.c -o calc_native_mic

 

0 Kudos
Reply