<?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 Re: Ipo with shared library in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1593518#M171980</link>
    <description>&lt;P&gt;Thanks for the additional info,&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/350016"&gt;@ChrisC2&lt;/a&gt;. This issue may be related to your environment. Maybe the PATH? Do you have CLANG products installed?&lt;/P&gt;
&lt;P&gt;The version of llvm-nm distributed by Intel is in&amp;nbsp;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\compiler\llvm-nm.exe.&lt;/P&gt;
&lt;P&gt;We noticed that the -help output is a bit different between what you posted and what we get from the Intel distribution&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 14:54:31 GMT</pubDate>
    <dc:creator>Barbara_P_Intel</dc:creator>
    <dc:date>2024-04-29T14:54:31Z</dc:date>
    <item>
      <title>Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1586335#M171607</link>
      <description>&lt;P&gt;I've been trying on an off for some time now to get Ipo compilation and linking to work with a shared library I am building.&amp;nbsp; &amp;nbsp;Thought I would try again with 2024.1, and still no luck.&amp;nbsp; &amp;nbsp; Project is build with CMake (3.28) in VS2022.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Long story short, I get the message 'llvm-nm returned an error : /usr/bin/nm: unrecognized option '--no-weak'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume Cmake is trying to turn off weak linking, which is causing a failure.&amp;nbsp; &amp;nbsp;I've both tried manually specifying the ipo commands, and also using setting INTERPROCEDURAL_OPTIMIZTION to True to let Cmake handle the flags.&amp;nbsp; Both get the same message above.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:06:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1586335#M171607</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-04T16:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1587452#M171680</link>
      <description>&lt;P&gt;Please post a small reproducer. There's not enough information here to offer any advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 19:24:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1587452#M171680</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-08T19:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1587893#M171726</link>
      <description>&lt;P&gt;I've attached a simple CMake project that replicates the error for me.&amp;nbsp; I'm using VS2022 to run this, but should be able to run it in a standalone CLI as well.&amp;nbsp; &amp;nbsp;If the library type is changed from SHARED to STATIC, it compiles with no issues.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 02:27:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1587893#M171726</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-10T02:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1589729#M171815</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/350016"&gt;@ChrisC2&lt;/a&gt;, have you had any success in resolving this?&lt;/P&gt;
&lt;P&gt;Are you using ifort or ifx? For me your .sln is using ifort.&lt;/P&gt;
&lt;P&gt;I'm a little confused about what OS you are using. You mention VS 2022, but the path in the error message is a Linux path.&lt;/P&gt;
&lt;P&gt;Does the .sln you uploaded compile successfully for you or is this the failing version?&lt;/P&gt;
&lt;P&gt;I'm using Windows 11, VS2022 17.8.1, cmake version 3.27.2-msvc1, ifort 2021.12.0.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 20:19:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1589729#M171815</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-16T20:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1589733#M171816</link>
      <description>&lt;P&gt;I have not resolved it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compiler is ifx.&amp;nbsp; &amp;nbsp;(Line 3 of the top level CMakeLists.txt sets compiler to ifx)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to build in both Linux and Windows and both show a similar error.&amp;nbsp; &amp;nbsp;I must have grabbed the error message from linux.&amp;nbsp; (Though Windows I have OneAPI 2024.1, Linux is 2023.2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This being a CMake project, there is no sln file.&amp;nbsp; But you can open it in Visual Studio via File &amp;gt; Open &amp;gt; Folder.&amp;nbsp; And yes, the uploaded project shows the behavior for me.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've copied in the build output file for a Windows build in Visual Studio.&amp;nbsp; &amp;nbsp;Perhaps this provides some more details.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;------ Build All started: Project: dynamic_link_error, Configuration: x64-release ------&lt;BR /&gt;[1/6] Building Fortran preprocessed src\CMakeFiles\test_module.dir\test_module.f90-pp.f90&lt;BR /&gt;[2/6] Generating Fortran dyndep file src\CMakeFiles\test_module.dir\Fortran.dd&lt;BR /&gt;[3/6] Generating Fortran dyndep file app\CMakeFiles\test_exe.dir\Fortran.dd&lt;BR /&gt;[4/7] Building Fortran object src\CMakeFiles\test_module.dir\test_module.f90.obj&lt;BR /&gt;[5/7] Building Fortran object app\CMakeFiles\test_exe.dir\test_exe.f90.obj&lt;BR /&gt;[6/7] Linking Fortran shared library src\test_module.dll&lt;BR /&gt;FAILED: src/test_module.dll src/test_module.lib&lt;BR /&gt;C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C ""C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __create_def C:\Work\Fortran\dynamic_link_error\out\build\x64-release\src\CMakeFiles\test_module.dir\.\exports.def C:\Work\Fortran\dynamic_link_error\out\build\x64-release\src\CMakeFiles\test_module.dir\.\exports.def.objs &amp;amp;&amp;amp; cd C:\Work\Fortran\dynamic_link_error\out\build\x64-release" &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\test_module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo src\CMakeFiles\test_module.dir\test_module.f90.obj -LD /Qoption,link,/machine:x64 /debug /INCREMENTAL -Qipo /Qoption,link,/DEF:src\CMakeFiles\test_module.dir\.\exports.def user32.lib -link /out:src\test_module.dll /implib:src\test_module.lib /pdb:test_module.dll.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;C:\Work\Fortran\dynamic_link_error\out\build\x64-release\EXEC : llvm-nm returned an error : nm: unrecognized option `--no-weak'&lt;BR /&gt;Usage: nm [option(s)] [file(s)]&lt;BR /&gt;List symbols in [file(s)] (a.out by default).&lt;BR /&gt;The options are:&lt;BR /&gt;-a, --debug-syms Display debugger-only symbols&lt;BR /&gt;-A, --print-file-name Print name of the input file before every symbol&lt;BR /&gt;-B Same as --format=bsd&lt;BR /&gt;-C, --demangle[=STYLE] Decode low-level symbol names into user-level names&lt;BR /&gt;The STYLE, if specified, can be `auto' (the default),&lt;BR /&gt;`gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'&lt;BR /&gt;or `gnat'&lt;BR /&gt;--no-demangle Do not demangle low-level symbol names&lt;BR /&gt;-D, --dynamic Display dynamic symbols instead of normal symbols&lt;BR /&gt;--defined-only Display only defined symbols&lt;BR /&gt;-e (ignored)&lt;BR /&gt;-f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',&lt;BR /&gt;`sysv' or `posix'. The default is `bsd'&lt;BR /&gt;-g, --extern-only Display only external symbols&lt;BR /&gt;-l, --line-numbers Use debugging information to find a filename and&lt;BR /&gt;line number for each symbol&lt;BR /&gt;-n, --numeric-sort Sort symbols numerically by address&lt;BR /&gt;-o Same as -A&lt;BR /&gt;-p, --no-sort Do not sort the symbols&lt;BR /&gt;-P, --portability Same as --format=posix&lt;BR /&gt;-r, --reverse-sort Reverse the sense of the sort&lt;BR /&gt;--plugin NAME Load the specified plugin&lt;BR /&gt;-S, --print-size Print size of defined symbols&lt;BR /&gt;-s, --print-armap Include index for symbols from archive members&lt;BR /&gt;--size-sort Sort symbols by size&lt;BR /&gt;--special-syms Include special symbols in the output&lt;BR /&gt;--synthetic Display synthetic symbols as well&lt;BR /&gt;-t, --radix=RADIX Use RADIX for printing symbol values&lt;BR /&gt;--target=BFDNAME Specify the target object format as BFDNAME&lt;BR /&gt;-u, --undefined-only Display only undefined symbols&lt;BR /&gt;&lt;BR /&gt;-X 32_64 (ignored)&lt;BR /&gt;&lt;BR /&gt;@FILE Read options from FILE&lt;BR /&gt;&lt;BR /&gt;-h, --help Display this information&lt;BR /&gt;&lt;BR /&gt;-V, --version Display this program's version number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;nm: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ninja: build stopped: subcommand failed.&lt;/P&gt;&lt;P&gt;Build All failed.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 21:06:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1589733#M171816</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-16T21:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590158#M171835</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/350016"&gt;@ChrisC2&lt;/a&gt;, you wrote that you have the same issue on Linux. Can you please upload a .zip for the Linux version?&lt;/P&gt;
&lt;P&gt;I ask because I see the .json file is all about Windows and ninja.&lt;/P&gt;
&lt;P&gt;Or does that even matter? My skills are better with Linux.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 23:06:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590158#M171835</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-17T23:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590470#M171847</link>
      <description>&lt;P&gt;One more thing... When I use the .zip file you uploaded on Windows, it builds with ifort, not ifx. Please upload a reproducer for Windows that uses ifx.&lt;/P&gt;
&lt;P&gt;I've been in touch with Intel's CMake engineer; he uploads Intel updates for CMake. He wrote that the MSVC generator ignores CMAKE_Fortran_COMPILER, you need to set the platform toolset. &amp;nbsp;For CMake 3.29, to use ifx you can use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; cmake&amp;nbsp; -T "Intel C++ Compiler 2024,fortran=ifx" ..&lt;/P&gt;
&lt;P&gt;Please share the exact CMake commands you are using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 17:15:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590470#M171847</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-18T17:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590490#M171849</link>
      <description>&lt;P&gt;Barbara, thanks for your persistence on this.&amp;nbsp; &amp;nbsp;First off, I was wrong about LInux.&amp;nbsp; I thought it showed similar behavior there, but I tried my simple reproducer on LInux and it worked fine.&amp;nbsp; &amp;nbsp;Should note while it was using CMake the build system on Linux is Make.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To reproduce the error, in a IntelOneAPI command prompt for VS2022, in the directory the project is in:&lt;/P&gt;&lt;P&gt;cmake -B out --preset x64-release&lt;/P&gt;&lt;P&gt;cmake --build out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(If you don't specify the preset I also get iFort instead of ifx).&amp;nbsp; Just as a test, I downloaded the latest release version of CMake (3.29.2) and Ninja (v1.12) and tried to build using that version and get the same error.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I went and pulled the link commands the are being specified to link the exe, ran those commands manually, and the link process worked fine.&amp;nbsp; &amp;nbsp;So as best I can tell the issue is in either CMake or Ninja in the way it packages the link commands?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 18:29:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1590490#M171849</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-18T18:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591467#M171887</link>
      <description>&lt;P&gt;Can you please do `cmake –build out -v` and share the output?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ninja will print out all the commands it uses and we can see what is missing or incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 15:26:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591467#M171887</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-22T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591631#M171904</link>
      <description>&lt;P&gt;Sure.&amp;nbsp; I've run those commands, output below.&amp;nbsp; &amp;nbsp;I've posted the first command output first.&amp;nbsp; &amp;nbsp;Then I tried running the build command again, and showed a different error that may be more specific regarding undefined symbol.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First run:&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Work\Fortran\dynamic_link_error&amp;gt;cmake --build out -v&lt;BR /&gt;Change Dir: 'C:/Work/Fortran/dynamic_link_error/out'&lt;/P&gt;&lt;P&gt;Run Build Command(s): C:/PROGRA~1/MICROS~4/2022/PROFES~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v&lt;BR /&gt;[1/8] C:\WINDOWS\system32\cmd.exe /C "C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe -fpp -Dtest_module_EXPORTS /W1 /nologo /fpp /libs:dll /threads /O3 /debug /arch:AVX2 /fp:fast=2 /Qprec-div- /Qopenmp /Qopt-report -Qipo -module:Modules -P C:\Work\Fortran\dynamic_link_error\src\test_module.f90 -Fisrc\CMakeFiles\test_module.dir\test_module.f90-pp.f90 &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_ninja_depends --tdi=src\CMakeFiles\test_module.dir\FortranDependInfo.json --lang=Fortran --src=src\CMakeFiles\test_module.dir\test_module.f90-pp.f90 --out=src\CMakeFiles\test_module.dir\test_module.f90-pp.f90 --dep=src\CMakeFiles\test_module.dir\test_module.f90-pp.f90.d --obj=src\CMakeFiles\test_module.dir\test_module.f90.obj --ddi=src\CMakeFiles\test_module.dir\test_module.f90.obj.ddi"&lt;BR /&gt;[2/8] C:\WINDOWS\system32\cmd.exe /C "C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe -fpp /W1 /nologo /fpp /libs:dll /threads /O3 /debug /arch:AVX2 /fp:fast=2 /Qprec-div- /Qopenmp /Qopt-report -Qipo -module:Modules -P C:\Work\Fortran\dynamic_link_error\app\test_exe.f90 -Fiapp\CMakeFiles\test_exe.dir\test_exe.f90-pp.f90 &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_ninja_depends --tdi=app\CMakeFiles\test_exe.dir\FortranDependInfo.json --lang=Fortran --src=app\CMakeFiles\test_exe.dir\test_exe.f90-pp.f90 --out=app\CMakeFiles\test_exe.dir\test_exe.f90-pp.f90 --dep=app\CMakeFiles\test_exe.dir\test_exe.f90-pp.f90.d --obj=app\CMakeFiles\test_exe.dir\test_exe.f90.obj --ddi=app\CMakeFiles\test_exe.dir\test_exe.f90.obj.ddi"&lt;BR /&gt;[3/8] "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_ninja_dyndep --tdi=src\CMakeFiles\test_module.dir\FortranDependInfo.json --lang=Fortran --dd=src\CMakeFiles\test_module.dir\Fortran.dd &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/323096"&gt;@SRC&lt;/a&gt;\CMakeFiles\test_module.dir\Fortran.dd.rsp&lt;BR /&gt;[4/8] "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_ninja_dyndep --tdi=app\CMakeFiles\test_exe.dir\FortranDependInfo.json --lang=Fortran --dd=app\CMakeFiles\test_exe.dir\Fortran.dd &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/122644"&gt;@app&lt;/a&gt;\CMakeFiles\test_exe.dir\Fortran.dd.rsp&lt;BR /&gt;[5/8] C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo /fpp -Dtest_module_EXPORTS -IC:\Work\Fortran\dynamic_link_error\src /W1 /nologo /fpp /libs:dll /threads /O3 /debug /arch:AVX2 /fp:fast=2 /Qprec-div- /Qopenmp /Qopt-report -Qipo -module:Modules /Fosrc\CMakeFiles\test_module.dir\test_module.f90.obj /Fd -c src\CMakeFiles\test_module.dir\test_module.f90-pp.f90&lt;BR /&gt;[6/8] C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo /fpp -IC:\Work\Fortran\dynamic_link_error\app /W1 /nologo /fpp /libs:dll /threads /O3 /debug /arch:AVX2 /fp:fast=2 /Qprec-div- /Qopenmp /Qopt-report -Qipo -module:Modules /Foapp\CMakeFiles\test_exe.dir\test_exe.f90.obj /Fd -c app\CMakeFiles\test_exe.dir\test_exe.f90-pp.f90&lt;BR /&gt;[7/8] C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C ""C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __create_def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def.objs &amp;amp;&amp;amp; cd C:\Work\Fortran\dynamic_link_error\out" &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\test_module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo src\CMakeFiles\test_module.dir\test_module.f90.obj -LD /Qoption,link,/machine:x64 /debug /INCREMENTAL -Qipo /Qoption,link,/DEF:src\CMakeFiles\test_module.dir\.\exports.def user32.lib -link /out:src\test_module.dll /implib:src\test_module.lib /pdb:test_module.dll.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;FAILED: src/test_module.dll src/test_module.lib&lt;BR /&gt;C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C ""C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __create_def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def.objs &amp;amp;&amp;amp; cd C:\Work\Fortran\dynamic_link_error\out" &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\test_module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo src\CMakeFiles\test_module.dir\test_module.f90.obj -LD /Qoption,link,/machine:x64 /debug /INCREMENTAL -Qipo /Qoption,link,/DEF:src\CMakeFiles\test_module.dir\.\exports.def user32.lib -link /out:src\test_module.dll /implib:src\test_module.lib /pdb:test_module.dll.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;llvm-nm returned an error: nm: unrecognized option `--no-weak'&lt;BR /&gt;Usage: nm [option(s)] [file(s)]&lt;BR /&gt;List symbols in [file(s)] (a.out by default).&lt;BR /&gt;The options are:&lt;BR /&gt;-a, --debug-syms Display debugger-only symbols&lt;BR /&gt;-A, --print-file-name Print name of the input file before every symbol&lt;BR /&gt;-B Same as --format=bsd&lt;BR /&gt;-C, --demangle[=STYLE] Decode low-level symbol names into user-level names&lt;BR /&gt;The STYLE, if specified, can be `auto' (the default),&lt;BR /&gt;`gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'&lt;BR /&gt;or `gnat'&lt;BR /&gt;--no-demangle Do not demangle low-level symbol names&lt;BR /&gt;-D, --dynamic Display dynamic symbols instead of normal symbols&lt;BR /&gt;--defined-only Display only defined symbols&lt;BR /&gt;-e (ignored)&lt;BR /&gt;-f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',&lt;BR /&gt;`sysv' or `posix'. The default is `bsd'&lt;BR /&gt;-g, --extern-only Display only external symbols&lt;BR /&gt;-l, --line-numbers Use debugging information to find a filename and&lt;BR /&gt;line number for each symbol&lt;BR /&gt;-n, --numeric-sort Sort symbols numerically by address&lt;BR /&gt;-o Same as -A&lt;BR /&gt;-p, --no-sort Do not sort the symbols&lt;BR /&gt;-P, --portability Same as --format=posix&lt;BR /&gt;-r, --reverse-sort Reverse the sense of the sort&lt;BR /&gt;--plugin NAME Load the specified plugin&lt;BR /&gt;-S, --print-size Print size of defined symbols&lt;BR /&gt;-s, --print-armap Include index for symbols from archive members&lt;BR /&gt;--size-sort Sort symbols by size&lt;BR /&gt;--special-syms Include special symbols in the output&lt;BR /&gt;--synthetic Display synthetic symbols as well&lt;BR /&gt;-t, --radix=RADIX Use RADIX for printing symbol values&lt;BR /&gt;--target=BFDNAME Specify the target object format as BFDNAME&lt;BR /&gt;-u, --undefined-only Display only undefined symbols&lt;BR /&gt;-X 32_64 (ignored)&lt;BR /&gt;@FILE Read options from FILE&lt;BR /&gt;-h, --help Display this information&lt;BR /&gt;-V, --version Display this program's version number&lt;/P&gt;&lt;P&gt;nm: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex&lt;/P&gt;&lt;P&gt;ninja: build stopped: subcommand failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second run:&lt;/P&gt;&lt;P&gt;C:\Work\Fortran\dynamic_link_error&amp;gt;cmake --build out -v&lt;BR /&gt;Change Dir: 'C:/Work/Fortran/dynamic_link_error/out'&lt;/P&gt;&lt;P&gt;Run Build Command(s): C:/PROGRA~1/MICROS~4/2022/PROFES~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v&lt;BR /&gt;[1/2] C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C ""C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E __create_def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def.objs &amp;amp;&amp;amp; cd C:\Work\Fortran\dynamic_link_error\out" &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\CMakeFiles\test_module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo src\CMakeFiles\test_module.dir\test_module.f90.obj -LD /Qoption,link,/machine:x64 /debug /INCREMENTAL -Qipo /Qoption,link,/DEF:src\CMakeFiles\test_module.dir\.\exports.def user32.lib -link /out:src\test_module.dll /implib:src\test_module.lib /pdb:test_module.dll.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=app\CMakeFiles\test_exe.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo app\CMakeFiles\test_exe.dir\test_exe.f90.obj /Qoption,link,/machine:x64 /debug /INCREMENTAL /Qoption,link,/subsystem:console -Qipo src\test_module.lib user32.lib /link /out:app\test_exe.exe /implib:app\test_exe.lib /pdb:test_exe.exe.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;FAILED: app/test_exe.exe&lt;BR /&gt;C:\WINDOWS\system32\cmd.exe /C "cd . &amp;amp;&amp;amp; "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=app\CMakeFiles\test_exe.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo app\CMakeFiles\test_exe.dir\test_exe.f90.obj /Qoption,link,/machine:x64 /debug /INCREMENTAL /Qoption,link,/subsystem:console -Qipo src\test_module.lib user32.lib /link /out:app\test_exe.exe /implib:app\test_exe.lib /pdb:test_exe.exe.dbg /version:0.0 &amp;amp;&amp;amp; cd ."&lt;BR /&gt;LINK Pass 1: command "C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\ifx.exe /nologo app\CMakeFiles\test_exe.dir\test_exe.f90.obj /Qoption,link,/machine:x64 /debug /INCREMENTAL /Qoption,link,/subsystem:console -Qipo src\test_module.lib user32.lib /link /out:app\test_exe.exe /implib:app\test_exe.lib /pdb:test_exe.exe.dbg /version:0.0 /MANIFEST /MANIFESTFILE:app\CMakeFiles\test_exe.dir/intermediate.manifest app\CMakeFiles\test_exe.dir/manifest.res" failed (exit code 1) with the following output:&lt;BR /&gt;lld-link: error: undefined symbol: TEST_MODULE_mp_TEST_FUNC&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; referenced by 4024446.i90&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; app\CMakeFiles\test_exe.dir\test_exe.f90.obj&lt;BR /&gt;ninja: build stopped: subcommand failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 23:46:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591631#M171904</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-22T23:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591636#M171905</link>
      <description>&lt;P&gt;&lt;SPAN&gt;C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\.\exports.def&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The path to the exports files looks suspect.&amp;nbsp; &amp;nbsp;The actual path is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C:\Work\Fortran\dynamic_link_error\out\src\CMakeFiles\test_module.dir\exports.def&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 23:50:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1591636#M171905</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-04-22T23:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1593518#M171980</link>
      <description>&lt;P&gt;Thanks for the additional info,&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/350016"&gt;@ChrisC2&lt;/a&gt;. This issue may be related to your environment. Maybe the PATH? Do you have CLANG products installed?&lt;/P&gt;
&lt;P&gt;The version of llvm-nm distributed by Intel is in&amp;nbsp;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\compiler\llvm-nm.exe.&lt;/P&gt;
&lt;P&gt;We noticed that the -help output is a bit different between what you posted and what we get from the Intel distribution&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 14:54:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1593518#M171980</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-04-29T14:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ipo with shared library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1624295#M173339</link>
      <description>&lt;P&gt;Quick follow-up to this topic to document what I've found.&amp;nbsp; I do have an install of Cygwin installed with the bin directory in my Path, which Barbara noted above.&amp;nbsp; &amp;nbsp;This was confusing, but once this was removed, the errors changed to a consistent lack of export symbols for the linker.&amp;nbsp; &amp;nbsp;Doing some more digging, I believe the github issue below describes in detail the issue that caused this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/luxonis/depthai-core/issues/334" target="_blank" rel="noopener"&gt;https://github.com/luxonis/depthai-core/issues/334&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, CMake has a flag,&amp;nbsp;CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS&lt;SPAN&gt;&amp;nbsp;which is very handy when building shared libraries on Windows.&amp;nbsp; &amp;nbsp;CMake scans the obj files to generate a def list.&amp;nbsp; However that doesn't work with ipo enabled, and Cmake generates emtpy def files.&amp;nbsp; As a result, I"ve gone back to using&amp;nbsp;!DIR$ ATTRIBUTES DLLEXPORT for this particular project, which seems to have corrected this.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 02:46:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Ipo-with-shared-library/m-p/1624295#M173339</guid>
      <dc:creator>ChrisC2</dc:creator>
      <dc:date>2024-08-20T02:46:29Z</dc:date>
    </item>
  </channel>
</rss>

