<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Compile warnings and offload errors in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021367#M38361</link>
    <description>&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;The makefile:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;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&lt;/PRE&gt;

&lt;P&gt;The compile warnings:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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;
          ^&lt;/PRE&gt;

&lt;P&gt;The runtime error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 May 2014 21:40:17 GMT</pubDate>
    <dc:creator>Cheng_C_</dc:creator>
    <dc:date>2014-05-22T21:40:17Z</dc:date>
    <item>
      <title>Compile warnings and offload errors</title>
      <link>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021367#M38361</link>
      <description>&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;The makefile:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;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&lt;/PRE&gt;

&lt;P&gt;The compile warnings:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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;
          ^&lt;/PRE&gt;

&lt;P&gt;The runtime error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 21:40:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021367#M38361</guid>
      <dc:creator>Cheng_C_</dc:creator>
      <dc:date>2014-05-22T21:40:17Z</dc:date>
    </item>
    <item>
      <title>Quote:Cheng C. wrote:</title>
      <link>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021368#M38362</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Cheng C. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;The makefile:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;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&lt;/PRE&gt;

&lt;P&gt;The compile warnings:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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;
          ^&lt;/PRE&gt;

&lt;P&gt;The runtime error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;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)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 21:48:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021368#M38362</guid>
      <dc:creator>Cheng_C_</dc:creator>
      <dc:date>2014-05-22T21:48:23Z</dc:date>
    </item>
    <item>
      <title>I believe this is a duplicate</title>
      <link>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021369#M38363</link>
      <description>&lt;P&gt;I believe this is a duplicate of another forum issue submitted by you: &lt;A href="https://software.intel.com/en-us/forums/topic/515752" target="_blank"&gt;&lt;/A&gt;&lt;A href="https://software.intel.com/en-" target="_blank"&gt;https://software.intel.com/en-&lt;/A&gt;&lt;WBR /&gt;us/forums/topic/515752&lt;/P&gt;

&lt;P&gt;If it isn't, please let us know.&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
	--&lt;BR /&gt;
	Taylor&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 21:03:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021369#M38363</guid>
      <dc:creator>TaylorIoTKidd</dc:creator>
      <dc:date>2014-05-30T21:03:42Z</dc:date>
    </item>
    <item>
      <title>Quote:Taylor Kidd (Intel)</title>
      <link>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021370#M38364</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Taylor Kidd (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I believe this is a duplicate of another forum issue submitted by you: &lt;A href="https://software.intel.com/en-us/forums/topic/515752"&gt;https://software.intel.com/en-us/forums/topic/515752&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If it isn't, please let us know.&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
	&lt;BR /&gt;
	--&lt;BR /&gt;
	&lt;BR /&gt;
	Taylor&lt;BR /&gt;
	&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yes, it is. I don't know how to delete the duplicated topic.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 21:14:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Compile-warnings-and-offload-errors/m-p/1021370#M38364</guid>
      <dc:creator>Cheng_C_</dc:creator>
      <dc:date>2014-05-30T21:14:45Z</dc:date>
    </item>
  </channel>
</rss>

