<?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 I also used in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055001#M21383</link>
    <description>&lt;P&gt;I also used&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_rt.lib&lt;/P&gt;

&lt;P&gt;It links ok. But during execution,&amp;nbsp;the&amp;nbsp;executable crashes and&amp;nbsp;reports Program received signal SIGSEGV: Segmentation fault - invalid memory reference.&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2015 13:36:28 GMT</pubDate>
    <dc:creator>Yu__Wenbin</dc:creator>
    <dc:date>2015-05-06T13:36:28Z</dc:date>
    <item>
      <title>use gfortran to link mkl libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055000#M21382</link>
      <description>&lt;P&gt;I am writing to ask help for linking mkl&amp;nbsp;with a fortran code&amp;nbsp;on a Surface Pro with win 8.1&amp;nbsp;OS.&amp;nbsp;I am using gfortran 4.9.2 (TDM-GCC-65). The Fortran code is paralleled using OpenMP.&lt;/P&gt;

&lt;P&gt;I am using the following command:&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_rt.lib libiomp5md.lib&lt;/P&gt;

&lt;P&gt;It links ok. But during execution,&amp;nbsp;the&amp;nbsp;executable crashes and&amp;nbsp;reports Program received signal SIGSEGV: Segmentation fault - invalid memory reference.&lt;/P&gt;

&lt;P&gt;I also tried the following&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_rt.lib libiomp5md.lib&lt;/P&gt;

&lt;P&gt;I got the following linking error:&lt;/P&gt;

&lt;P&gt;Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	mkl_intel_thread.lib(mkl_threading.obj):(.text[MKL_get_N_Cores]+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_p4n_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_def_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_avx_dsyrk_pst.obj):../../../../blas/k:(.text+0x10): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc3_dsyrk_pst.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc_dsyrk_pst.obj):../../../../blas/k:(.text+0x12): more undefined references to `__chkstk' follow&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 13:22:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055000#M21382</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-06T13:22:57Z</dc:date>
    </item>
    <item>
      <title>I also used</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055001#M21383</link>
      <description>&lt;P&gt;I also used&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_rt.lib&lt;/P&gt;

&lt;P&gt;It links ok. But during execution,&amp;nbsp;the&amp;nbsp;executable crashes and&amp;nbsp;reports Program received signal SIGSEGV: Segmentation fault - invalid memory reference.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 13:36:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055001#M21383</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-06T13:36:28Z</dc:date>
    </item>
    <item>
      <title>libgomp would not support mkl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055002#M21384</link>
      <description>&lt;P&gt;libgomp would not support mkl parallel. &amp;nbsp;You may be able to use mkl sequential, or if you build without fopenmp, use libiomp5.&lt;/P&gt;

&lt;P&gt;a common reason for segfault could be stack overflow which might be fixed by appending a /link /stack setting.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 15:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055002#M21384</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-05-06T15:29:00Z</dc:date>
    </item>
    <item>
      <title>Dear Tim,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055003#M21385</link>
      <description>&lt;P&gt;Dear Tim,&lt;/P&gt;

&lt;P&gt;Thanks a lot for your suggestion. Can you be more specific? I need&amp;nbsp;the code&amp;nbsp;to be parallel for performance, my whole purpose to turn to MKL libraries. There is a typo in the original post about the second option I tried is&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib&lt;/P&gt;

&lt;P&gt;The error message is&lt;/P&gt;

&lt;P&gt;Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	mkl_intel_thread.lib(mkl_threading.obj):(.text[MKL_get_N_Cores]+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_p4n_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_def_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_avx_dsyrk_pst.obj):../../../../blas/k:(.text+0x10): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc3_dsyrk_pst.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc_dsyrk_pst.obj):../../../../blas/k:(.text+0x12): more undefined references to `__chkstk' follow&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 15:50:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055003#M21385</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-06T15:50:48Z</dc:date>
    </item>
    <item>
      <title>in principle, if you set</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055004#M21386</link>
      <description>&lt;P&gt;in principle, if you set fopenmp, you must not use libiomp or mkl parallel on Windows due to incompatible openMP support.&lt;/P&gt;

&lt;P&gt;If sufficient parallelism can be found outside the MKL function call, it can be more effective to call MKL serial functions from a parallel region, and this could get around the problem with various OpenMP internal conventions.&lt;/P&gt;

&lt;P&gt;As MKL isn't marketed separately from Intel compilers,and builds under Visual Studio&amp;nbsp; are seen as the primary Windows market, Intel may not see sufficient reason to try to improve compatiblity with the various Windows gfortran variants.&amp;nbsp; gfortran compatibility centers primarily on the versions supported by specific linux distros.&lt;/P&gt;

&lt;P&gt;If you could build the open source OpenMP library with compatible mingw compilers, that might do the job, but when I tried it seemed to require the full Visual Studio when building on Windows.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 20:21:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055004#M21386</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-05-06T20:21:00Z</dc:date>
    </item>
    <item>
      <title>Tim,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055005#M21387</link>
      <description>&lt;P&gt;Tim,&lt;/P&gt;

&lt;P&gt;Thanks a lot for your expert opinion! What are the libraries needed for MKL serial functions?&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 01:37:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055005#M21387</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-07T01:37:43Z</dc:date>
    </item>
    <item>
      <title>Hi Wenbin</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055006#M21388</link>
      <description>&lt;P&gt;Hi Wenbin&lt;/P&gt;

&lt;P&gt;The serial link line is&amp;nbsp;like&lt;/P&gt;

&lt;P&gt;gfortran -fopenmp -o mycode *.o mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib&lt;/P&gt;

&lt;P&gt;Agree with Tim,&amp;nbsp; there is &amp;nbsp;two issues here.&lt;/P&gt;

&lt;P&gt;1. under windows, MKL only support libiomp5 or pgi openmp Run time library,&amp;nbsp; no including gfortran openmp.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. if under Linux,&amp;nbsp; mkl can support gfortran openmp.&amp;nbsp; The link line is like&amp;nbsp; &lt;A href="https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor"&gt;https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_gf_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a -Wl,--end-group -ldl -lpthread -lm&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;export MKL_INTERFACE_LAYER=gnu&lt;/P&gt;

&lt;P&gt;export MKL_THREADING_LAYE= gun&lt;/P&gt;

&lt;P&gt;-Wl,--no-as-needed -L${MKLROOT}/lib/intel64&amp;nbsp; -lmkl_rt -lpthread -lm&lt;/P&gt;

&lt;P&gt;-Wl,--no-as-needed -L${MKLROOT}/lib/intel64&amp;nbsp; -lmkl_rt -lpthread -lm&lt;/P&gt;

&lt;P&gt;unlucky, no of them are applicable for your case, so if you have enough openmp parallel work, you may use sequential MKL , or call sequential MKL in OpenMP region.&lt;/P&gt;

&lt;P&gt;Best Regard,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 03:54:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055006#M21388</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-05-07T03:54:35Z</dc:date>
    </item>
    <item>
      <title>Dear Ying, Thanks alot for</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055007#M21389</link>
      <description>&lt;P&gt;Dear Ying, Thanks alot for your advice.&lt;/P&gt;

&lt;P&gt;I used gfortran -fopenmp -o mycode *.o mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib.&lt;/P&gt;

&lt;P&gt;However, during linking, I am still getting similar error message:&lt;/P&gt;

&lt;P&gt;Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	Warning: .drectve `-defaultlib:"uuid.lib" ' unrecognized&lt;BR /&gt;
	Warning: corrupt .drectve at end of def file&lt;BR /&gt;
	mkl_core.lib(_p4n_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_def_xdsyrk.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_avx_xdgemv.obj):../../../../blas/k:(.text+0x10): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc3_xdgemv.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_mc_xdgemv.obj):../../../../blas/k:(.text+0x12): undefined reference to `__chkstk'&lt;BR /&gt;
	mkl_core.lib(_p4n_xdgemv.obj):../../../../blas/k:(.text+0x12): more undefined references to `__chkstk' follow&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 14:52:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055007#M21389</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-07T14:52:42Z</dc:date>
    </item>
    <item>
      <title>You might note that chkstk</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055008#M21390</link>
      <description>&lt;P&gt;You might note that chkstk.obj should be available for borrowing from a visual studio site, and there are many web references about attempts to satisfy __chkstk in mingw, some involving people more expert on the topic than anyone here.&lt;/P&gt;

&lt;P&gt;Do you have the same problem if you try to link against the _dll.lib (dynamic library versions) of MKL?&lt;/P&gt;

&lt;P&gt;Did you try stuff like -Wl,"-nostdlib uuid.lib" if you want to suppress those warnings?&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 15:33:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055008#M21390</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-05-07T15:33:43Z</dc:date>
    </item>
    <item>
      <title>I copied a chkstk.obj into</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055009#M21391</link>
      <description>&lt;P&gt;I copied a chkstk.obj into the folder. But now I got the following complain. What is wrong?&lt;/P&gt;

&lt;P&gt;C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `chkstk.obj' is&lt;BR /&gt;
	incompatible with i386:x86-64 output&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 16:40:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055009#M21391</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2015-05-07T16:40:37Z</dc:date>
    </item>
    <item>
      <title>You would need a chkstk.obj</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055010#M21392</link>
      <description>&lt;P&gt;You would need a chkstk.obj built for X64, including amd64 machine tag.&amp;nbsp; The references I saw indicated this method works in some but not all cases.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 17:37:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055010#M21392</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-05-07T17:37:38Z</dc:date>
    </item>
    <item>
      <title>Hi Wenbin,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055011#M21393</link>
      <description>&lt;P&gt;Hi Wenbin,&lt;/P&gt;

&lt;P&gt;Any news?&lt;/P&gt;

&lt;P&gt;Or&amp;nbsp;try 32bit directly, &amp;gt;&amp;nbsp;gfortran -fopenmp -o mycode *.o mkl_intel_c.lib mkl_sequential.lib mkl_core.lib.&lt;/P&gt;

&lt;P&gt;Another possibility,&amp;nbsp; as you know, Intel MKL are part of Intel Fotran Composer Suite for windows. If with intel MKL, you may work with ifort + MKL on Windows OS directly. Intel fotran compiler support OpenMP&amp;nbsp; definitely.&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 03:12:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/use-gfortran-to-link-mkl-libraries/m-p/1055011#M21393</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-05-12T03:12:43Z</dc:date>
    </item>
  </channel>
</rss>

