- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to run a simple offload code and I got this error:
undefined symbol: __offload_set_version
Could you help to identify this error?
- source code:
- ========
- #include "offload.h"
- #include <stdio.h>
- #include <iostream>
- void main()
- {
- _Offload_status x;
- OFFLOAD_STATUS_INIT(x);
- #pragma offload target(mic) status(x) mandatory
- {
- if (_Offload_get_device_number() < 0) {
- printf("mandatory offload ran on CPU\n");
- } else {
- printf("mandatory offload ran on MIC\n");
- }
- }
- if (x.result == OFFLOAD_SUCCESS) {
- printf("mandatory offload was successful\n");
- } else {
- printf("mandatory offload failed\n");
- }
- }
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
__offload_set_version is defined in liboffload_so.5
nm liboffload.so.5 | grep offload_set_version
0000000000003c710 T _offload_set_version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it seems that liboffload.so.5 is not linked to any program that has #pragma offload.
The lib is in my system but the program does not see that.
I think this error stated when I updated the version of
Intel® Parallel Studio XE Professional Edition for Fortran and C++ Linux* (all tools) 2016
Version: Update 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check your underlying environment configuration. You can suffer either error below when compiling with 16.0.3 but where the underlying run-time environment aligns to the 15.0 release RTLs, specifically the MIC_LD_LIBRARY_PATH and/or LD_LIBRARY_PATH settings.
Where the MIC_LD_LIBRARY_PATH refers to 15.0 RTLs, you might see:
$ ./a.out
/tmp/coi_procs/1/5460/aMIC.out: symbol lookup error: /tmp/coi_procs/1/5460/aMIC.out: undefined symbol: __offload_set_version
offload error: process on the device 0 unexpectedly exited with code 127
You can also suffer a similar error compiling with 16.0.3 but where your LD_LIBRARY_PATH setting aligns to a previous 15.0 release. e.g.
$ ./a.out
./a.out: symbol lookup error: ./a.out: undefined symbol: __offload_set_version
It is unclear which possible case you might have experienced so check that MIC_LD_LIBRARY_PATH and LD_LIBRARY_PATH reference paths under the 16.0.3 (i.e 2016.3.201) area and not an earlier 15.0 area.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it seems that the paths are ok.
I solved the problem by running this command
source /opt/intel/compilers_and_libraries_2016.3.210/linux/bin/compilervars.sh intel64
so, after the upgrading, the compilervars.sh was not executed anymore, is that possible? Is it suppose to execute automatically?
echo $LD_LIBRARY_PATH
/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/intel64/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/lib/intel64:/opt/intel/mic/coi/host-linux-release/lib:/opt/intel/mic/myo/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:/opt/intel/debugger_2016/libipt/intel64/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../compiler/lib/intel64_lin:/opt/intel/clck/3.1.2.006/provider/share/offload_phi/intel64:/opt/intel/clck/3.1.2.006/provider/share/offload_phi/mic:/opt/intel/clck/3.1.2.006/provider/share/offload_phi/intel64/:/opt/intel/clck/3.1.2.006/provider/share/offload_phi/mic/:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin/:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin_mic/
echo $MIC_LD_LIBRARY_PATH
/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/lib/mic:/opt/intel/mic/coi/device-linux-release/lib:/opt/intel/mic/myo/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/mic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you hadn't sourced the 16.0.3 compilervars to begin with then how did you invoke the 16.0.3 compiler?
The compilervars is not run automatically. Some choose to add the source command to their private shell initialization (i.e. .bashrc). Maybe your private shell initialization file is hard coded to source the 15.0 version, so editing it to refer to 16.0.3 would do it automatically.
Glad you resolved the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I have no idea how the compiler worked without source compilervars.sh. I also compiled other codes such as gaussianElimination and it compiled and executed as a native code, but when I tried to use #pragma offload inside the code I could not run the program anymore, but the compiler still worked with no errors.
Thanks,
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page