I'm trying to get a peice of compiler assisted offoad code working. The code uses MKL - it's just a test code though. At the moment, the code generates some random numbers on the host CPU, then offloads a functon to the Phi to print "Hello World!". I'm compiling as follows
icpc -std=c++11 -gxx-name=g++-4.8 -DMKL_ILP64 -I$MKLROOT/include -offload-attribute-target=mic -offload-option,mic,compiler," -Wl,--start-group $MKLROOT/lib/mic/libmkl_intel_ilp64.a $MKLROOT/lib/mic/libmkl_core.a $MKLROOT/lib/mic/libmkl_sequential.a -Wl,--end-group" hellomkl_func.cpp -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -o hellomkl_func
where the Compiler Options and MKL Link Line come from the Link Line Advisor. I want ILP64 integers (in the real code). The code compiles just fine. I've tested with both static and dynamic inking, but bth give the same error when the code executes -
Hello World from the host!
32 cores present on host
Num CoProcessors: 2
On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/4803/load_lib/icpcout508HQv: undefined symbol: __builtin_signbit"
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/4803/load_lib/icpcout508HQv: undefined symbol: __builtin_signbit
offload error: cannot load library to the device 0 (error code 20)
The sae offoad works if I comment out the MKL lines and don't link with MKL. What's going wrong?