<?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 Hello Comput,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163832#M28082</link>
    <description>&lt;P&gt;Hello Comput,&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	You are welcomed.&amp;nbsp; About the static link, for intel mpi .&amp;nbsp; Generally, we use the&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;mpicc&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;xxx&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;-static_mpi&amp;nbsp; &amp;nbsp;and let them to help find needed libraries, include mpi's static librares.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;for example,&amp;nbsp; we have mkl&amp;nbsp; cluster sample under mkl install folder (you can test them too).&amp;nbsp;&lt;STRONG style="font-size: 1em;"&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;[yhu5@hsw-ep01 pblasc]$ mpicc&amp;nbsp; &amp;nbsp;-o pblas1_d_example source/pblas1_d_example.c -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64&amp;nbsp; -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64 -Wl,--start-group /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_sequential.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -static_mpi -lpthread -lm -ldl&lt;/P&gt;

&lt;P&gt;and if you use gcc directly, then you have to add all needed libraries&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;manually, for example&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;gcc&amp;nbsp; &amp;nbsp;-o pblas1_d_example source/pblas1_d_example.c -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64&amp;nbsp; -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64 -Wl,--start-group /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_sequential.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread &lt;STRONG&gt;/opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpi_mt.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigi.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigf.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpicxx.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigc4.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpifort.a&lt;/STRONG&gt; -lm -ldl &lt;STRONG&gt;-lrt&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 01:47:00 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2018-08-02T01:47:00Z</dc:date>
    <item>
      <title>Link errors for MKL function from mkl_scalapack.h with C++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163829#M28079</link>
      <description>&lt;P&gt;&lt;BR /&gt;
	Hello,&lt;BR /&gt;
	I hope you could help please in this problem.&lt;BR /&gt;
	I try to compile a small C++ function that calls the MKL function "pdgesvd" from the header "mkl_scalapack.h".&lt;BR /&gt;
	The C++ code is:&lt;/P&gt;

&lt;P&gt;#include "mkl_scalapack.h"&lt;BR /&gt;
	int main()&lt;BR /&gt;
	{&lt;BR /&gt;
	// defining the variables ...&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;pdgesvd(jobu, jobvt, m, n,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;a, ia, ja, desca,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;s, u, iu, ju, descu,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;vt, ivt, jvt, descvt,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;work, lwork, info);&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;The link fails with the errors in the attached file "link_errors.pdf".&lt;/P&gt;

&lt;P&gt;I have run the script:&lt;BR /&gt;
	source /intel/bin/compilervars.sh -arch intel64 -platform linux&lt;/P&gt;

&lt;P&gt;I got the compilation/link options from the online "Intel® Math Kernel Library Link Line Advisor" (the options attached in the snapshot intel_advisor.jpg) and compiling as below:&lt;/P&gt;

&lt;P&gt;g++ -O main.cpp \&lt;BR /&gt;
	-DMKL_ILP64 -m64 -I${MKLROOT}/include \&lt;BR /&gt;
	${MKLROOT}/lib/intel64/libmkl_scalapack_ilp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl&lt;/P&gt;

&lt;P&gt;I would appreciate any assistance,&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 16:23:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163829#M28079</guid>
      <dc:creator>comput</dc:creator>
      <dc:date>2018-07-30T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Hi Comput,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163830#M28080</link>
      <description>&lt;P&gt;Hi Comput,&lt;/P&gt;

&lt;P&gt;​The link errors are mainly MPI&amp;nbsp;related symbols.&amp;nbsp; You can resolve them by&amp;nbsp;adding MPI runtime library in the command line. For example, if you use Intel MPI&lt;/P&gt;

&lt;P&gt;source /opt/intel/bin/compilervars.sh intel64&lt;BR /&gt;
	&lt;STRONG&gt;source /opt/intel/impi/201x.x.0xx/intel64/bin/mpivars.sh&amp;nbsp; (replace the x with your MPI version) &lt;/STRONG&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	mpiicc&amp;nbsp; -DMKL_ILP64 -m64 -I${MKLROOT}/include&amp;nbsp; -Wl,--start-group&amp;nbsp; "/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64"/libmkl_blacs_intelmpi_ilp64.a "/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64"/libmkl_intel_ilp64.a "/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64"/libmkl_core.a "/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64"/libmkl_intel_thread.a -Wl,--end-group -L &lt;STRONG&gt;"/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/../compiler/lib/intel64" -liomp5 -mt_mpi&lt;/STRONG&gt; -lm -ldl&lt;BR /&gt;
	&lt;BR /&gt;
	​Best Regards,&lt;BR /&gt;
	​Ying&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 01:03:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163830#M28080</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2018-07-31T01:03:56Z</dc:date>
    </item>
    <item>
      <title>Hello Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163831#M28081</link>
      <description>&lt;P&gt;Hello Ying,&lt;BR /&gt;
	Thank you for your reply.&lt;/P&gt;

&lt;P&gt;I tried as you suggested and it compiles now:&lt;BR /&gt;
	&lt;STRONG&gt;source /intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/bin/mpivars.sh&lt;/STRONG&gt;&lt;BR /&gt;
	source /intel/bin/compilervars.sh -arch intel64 -platform linux&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;g++ -O main.cpp \&lt;BR /&gt;
	-DMKL_ILP64 -m64 -I${MKLROOT}/include \&lt;BR /&gt;
	${MKLROOT}/lib/intel64/libmkl_scalapack_ilp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl &lt;STRONG&gt;-L/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/lib -lmpi_mt&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;However the MPI library is dynamic, not static.&lt;/P&gt;

&lt;P&gt;I had tried all the above commands (including the mpivars.sh) before posting to the forum, but I had tried linking with the static libmpi_mt.a instead of the dynamic libmpi_mt.so and it was giving link errors. It still gives those link errors with the static MPI library.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Namely, if instead of the dynamic MPI library:&lt;BR /&gt;
	-L/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/lib -lmpi_mt&lt;/P&gt;

&lt;P&gt;using instead the static one, that gives link errors:&lt;BR /&gt;
	/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/lib/libmpi_mt.a&lt;BR /&gt;
	I think this is not important, but I attach anyway those errors in the file "static_mpi_link_errors.pdf" just in case it is useful to know.&lt;/P&gt;

&lt;P&gt;It is not a problem for me to use the dynamic MPI library as long as the dynamic MPI library would not give errors on run-time (the same errors with the static MPI library).&lt;BR /&gt;
	From a quick run with all the pointer arguments of the function "pdgesvd" set to zero, it runs without any link errors. Only it gives a segmentation fault, which is expected since the arguments are set to zero at the moment (I need some time to study the arguments from the manual).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;I think the problem is solved.&lt;BR /&gt;
	I would let you know if there is any difference on the run-time.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Best regards and thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 04:47:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163831#M28081</guid>
      <dc:creator>comput</dc:creator>
      <dc:date>2018-07-31T04:47:18Z</dc:date>
    </item>
    <item>
      <title>Hello Comput, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163832#M28082</link>
      <description>&lt;P&gt;Hello Comput,&amp;nbsp;&lt;BR /&gt;
	&lt;BR /&gt;
	You are welcomed.&amp;nbsp; About the static link, for intel mpi .&amp;nbsp; Generally, we use the&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;mpicc&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;xxx&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;-static_mpi&amp;nbsp; &amp;nbsp;and let them to help find needed libraries, include mpi's static librares.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;for example,&amp;nbsp; we have mkl&amp;nbsp; cluster sample under mkl install folder (you can test them too).&amp;nbsp;&lt;STRONG style="font-size: 1em;"&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;[yhu5@hsw-ep01 pblasc]$ mpicc&amp;nbsp; &amp;nbsp;-o pblas1_d_example source/pblas1_d_example.c -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64&amp;nbsp; -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64 -Wl,--start-group /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_sequential.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -static_mpi -lpthread -lm -ldl&lt;/P&gt;

&lt;P&gt;and if you use gcc directly, then you have to add all needed libraries&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;manually, for example&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;gcc&amp;nbsp; &amp;nbsp;-o pblas1_d_example source/pblas1_d_example.c -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64&amp;nbsp; -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64 -Wl,--start-group /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_sequential.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread &lt;STRONG&gt;/opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpi_mt.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigi.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigf.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpicxx.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpigc4.a /opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/libmpifort.a&lt;/STRONG&gt; -lm -ldl &lt;STRONG&gt;-lrt&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 01:47:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163832#M28082</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2018-08-02T01:47:00Z</dc:date>
    </item>
    <item>
      <title>This is useful to know, thank</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163833#M28083</link>
      <description>&lt;P&gt;This is useful to know, thank you.&lt;BR /&gt;
	Best regards,&lt;BR /&gt;
	Compute&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 20:28:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Link-errors-for-MKL-function-from-mkl-scalapack-h-with-C/m-p/1163833#M28083</guid>
      <dc:creator>comput</dc:creator>
      <dc:date>2018-08-14T20:28:35Z</dc:date>
    </item>
  </channel>
</rss>

