Compile warnings and offload errors

Compile warnings and offload errors

Dear all, I got some compile warnings and offload errors when I offloaded part of my C++ code to Intel Phi for acceleration. I hope I could get some help here.

I first read some tiff images using libtiff and make some first-step calculations to the images on the host. Then I want to make some further calculations to the first-step results on Phi using MKL. The code offloaded to Phi only uses the standard C++ and MKL libraries. When I compile the code, there are some warnings associated with the stdlib.h file. When I run the code, I got some undefined symbol errors about the libtiff library. The offloaded code has nothing to do with libtiff. I attached my makefile, the compile warnings and runtime errors. Thanks for the help.

The makefile:

CC = icpc 
LDIR = -L$(MKLROOT)/lib/intel64
IDIR = -I$(MKLROOT)/include 
LLIB = -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -liomp5 -ltiff
FLAG = -no-multibyte-chars -openmp
DEF = -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64
MIC = -offload-option,mic,compiler,"-I/usr/include -L$(MKLROOT)/lib/mic -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread" -offload-attribute-target=mic -watch=mic-cmd

main: main.cpp dpc.cpp dpc.h
        $(CC) main.cpp dpc.cpp $(LLIB) -o main $(MIC) $(IDIR) $(LDIR) $(DEF) $(FLAG)

clean:
        rm -rf *o main

The compile warnings:

rm -rf *o main
icpc  main.cpp dpc.cpp -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -liomp5 -ltiff -o main -offload-option,mic,compiler,"-I/usr/include -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/mic  -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread" -offload-attribute-target=mic -watch=mic-cmd -I/software/intel/2013/composer_xe_2013_sp1/mkl/include  -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/intel64 -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64 -no-multibyte-chars -openmp
MIC command line:
icpc -I/usr/include -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/mic -I/software/intel/2013/composer_xe_2013_sp1/mkl/include main.cpp dpc.cpp -o main -offload-attribute-target=mic -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/intel64 -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64 -no-multibyte-chars -openmp -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread
In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(75): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_retcode:8; /* Return code if exited normally.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(89): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_stopsig:8; /* Stopping signal.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(84): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
        } __wait_terminated;
          ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(75): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_retcode:8; /* Return code if exited normally.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(89): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_stopsig:8; /* Stopping signal.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(84): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
        } __wait_terminated;
          ^

The runtime error:

The time for loading images and calculating xsum and ysum: 3.87822
On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/160843/load_lib/icpcoutVJ7iyF: undefined symbol: TIFFGetField"
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/160843/load_lib/icpcoutVJ7iyF: undefined symbol: TIFFGetField
offload error: cannot load library to the device 0 (error code 20)

 

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quote:

Cheng C. wrote:

Dear all, I got some compile warnings and offload errors when I offloaded part of my C++ code to Intel Phi for acceleration. I hope I could get some help here.

I first read some tiff images using libtiff and make some first-step calculations to the images on the host. Then I want to make some further calculations to the first-step results on Phi using MKL. The code offloaded to Phi only uses the standard C++ and MKL libraries. When I compile the code, there are some warnings associated with the stdlib.h file. When I run the code, I got some undefined symbol errors about the libtiff library. The offloaded code has nothing to do with libtiff. I attached my makefile, the compile warnings and runtime errors. Thanks for the help.

The makefile:

CC = icpc 
LDIR = -L$(MKLROOT)/lib/intel64
IDIR = -I$(MKLROOT)/include 
LLIB = -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -liomp5 -ltiff
FLAG = -no-multibyte-chars -openmp
DEF = -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64
MIC = -offload-option,mic,compiler,"-I/usr/include -L$(MKLROOT)/lib/mic -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread" -offload-attribute-target=mic -watch=mic-cmd

main: main.cpp dpc.cpp dpc.h
        $(CC) main.cpp dpc.cpp $(LLIB) -o main $(MIC) $(IDIR) $(LDIR) $(DEF) $(FLAG)

clean:
        rm -rf *o main

The compile warnings:

rm -rf *o main
icpc  main.cpp dpc.cpp -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -liomp5 -ltiff -o main -offload-option,mic,compiler,"-I/usr/include -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/mic  -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread" -offload-attribute-target=mic -watch=mic-cmd -I/software/intel/2013/composer_xe_2013_sp1/mkl/include  -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/intel64 -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64 -no-multibyte-chars -openmp
MIC command line:
icpc -I/usr/include -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/mic -I/software/intel/2013/composer_xe_2013_sp1/mkl/include main.cpp dpc.cpp -o main -offload-attribute-target=mic -L/software/intel/2013/composer_xe_2013_sp1/mkl/lib/intel64 -DDEBUG_MAIN -DWRITE_TO_FILE -DMKL_ILP64 -no-multibyte-chars -openmp -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread
In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(75): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_retcode:8; /* Return code if exited normally.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(89): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_stopsig:8; /* Stopping signal.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from /software/intel/2013/composer_xe_2013_sp1.1.106/compiler/include/omp.h(142),
                 from main.cpp(17):
/usr/include/bits/waitstatus.h(84): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
        } __wait_terminated;
          ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(75): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_retcode:8; /* Return code if exited normally.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(89): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
  	unsigned int __w_stopsig:8; /* Stopping signal.  */
  	             ^

In file included from /usr/include/stdlib.h(43),
                 from dpc.h(6),
                 from dpc.cpp(2):
/usr/include/bits/waitstatus.h(84): warning #3218: *MIC* class/struct may fail when offloaded because this field is misaligned or contains data that is misaligned
        } __wait_terminated;
          ^

The runtime error:

The time for loading images and calculating xsum and ysum: 3.87822
On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/160843/load_lib/icpcoutVJ7iyF: undefined symbol: TIFFGetField"
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/160843/load_lib/icpcoutVJ7iyF: undefined symbol: TIFFGetField
offload error: cannot load library to the device 0 (error code 20)

 

I believe this is a duplicate of another forum issue submitted by you: https://software.intel.com/en-us/forums/topic/515752

If it isn't, please let us know.

Regards
--
Taylor
 

Quote:

Taylor Kidd (Intel) wrote:

I believe this is a duplicate of another forum issue submitted by you: https://software.intel.com/en-us/forums/topic/515752

If it isn't, please let us know.

Regards

--

Taylor

 

Yes, it is. I don't know how to delete the duplicated topic. 

Thanks,

Leave a Comment

Please sign in to add a comment. Not a member? Join today