<?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: Fortran shared lib .so shows undefined symbol error in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322530#M158040</link>
    <description>&lt;P&gt;Thank you Steve! Yes, I think&amp;nbsp;&lt;SPAN&gt;dllexport should be removed.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Oct 2021 15:09:10 GMT</pubDate>
    <dc:creator>csH2</dc:creator>
    <dc:date>2021-10-16T15:09:10Z</dc:date>
    <item>
      <title>Fortran shared lib .so shows undefined symbol error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322014#M158011</link>
      <description>&lt;P&gt;Hi everyone I need help about a compilation issue.&lt;/P&gt;
&lt;P&gt;I'm compiling a Fortran code to obtain shared library .so. In the code it uses a module. The compiling has no problem while it reports undefined symbol error when opening the .so library.&lt;/P&gt;
&lt;P&gt;Code &lt;STRONG&gt;mesh_map.F&amp;nbsp;&lt;/STRONG&gt;are as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#include "cfx5ext.h"

    dllexport(mesh_map)
          SUBROUTINE mesh_map (CZ, DZ, IZ, LZ, RZ)
          USE EXTRA_FLUID2
          USE ISO_C_BINDING
          USE IFPORT
          IMPLICIT NONE
          CHARACTER*(1) CZ(*)
          DOUBLE PRECISION DZ(*)
          INTEGER IZ(*)
          LOGICAL LZ(*)
          REAL RZ(*)

          MAP_STATUS = 1

          END&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;extra_fluid2.f90&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    Module EXTRA_FLUID2
    INTEGER :: map_status = 0
    end module EXTRA_FLUID2&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Compiling command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; ifort -c extra_fluid2.f90

/home/xxx/intel/oneapi/compiler/2021.4.0/linux/bin/intel64/ifort -fpic -assume 2underscore -check uninit -warn declarations -diag-error 6717 -ftz -O2 -fp-speculation=safe -fp-model=precise -fp-model=source -fimf-arch-consistency=true -qno-opt-dynamic-align -fpe0 -fomit-frame-pointer -real-size 32 -integer-size 32 -I/usr/ansys_inc/v192/CFX/include -o linux-amd64/ifort/mesh_map.o -c mesh_map.F 
-lrt/xxx/intel/oneapi/compiler/2021.4.0/linux/bin/intel64/ifort -shared -o ./linux-amd64/ifort/libmesh_map.so linux-amd64/ifort/mesh_map.o extra_fluid2.o&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I check the .so library using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ldd -r libmesh_map.so&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result shows as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;undefined symbol: extra_fluid2_mp_map_status__        (./libmesh_map.so)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I fix this? Thanks in advance.&lt;/P&gt;
&lt;P&gt;I've tried compilation in Windows and no problem was found for the dll file. While in Linux it reports above error.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 15:30:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322014#M158011</guid>
      <dc:creator>csH2</dc:creator>
      <dc:date>2021-10-14T15:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran shared lib .so shows undefined symbol error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322035#M158012</link>
      <description>&lt;P&gt;When you compiled&amp;nbsp; mesh_map.F, you specified -assume 2underscore, but didn't specify that when compiling extra_fluid2.f90. This causes the global symbols to be inconsistent. Take that off.&lt;/P&gt;
&lt;P&gt;I'm also puzzled by the "dllexport(meshmap)" in mesh_map.F. I have to assume that's a macro defined in the #include.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 16:53:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322035#M158012</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-10-14T16:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran shared lib .so shows undefined symbol error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322095#M158018</link>
      <description>&lt;P&gt;dllexport is not required for Linux.&amp;nbsp; Here's &lt;A href="https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/a-to-b/attributes/attributes-dllexport-and-dllimport.html" target="_blank" rel="noopener"&gt;more info&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 20:41:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322095#M158018</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2021-10-14T20:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran shared lib .so shows undefined symbol error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322530#M158040</link>
      <description>&lt;P&gt;Thank you Steve! Yes, I think&amp;nbsp;&lt;SPAN&gt;dllexport should be removed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 15:09:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322530#M158040</guid>
      <dc:creator>csH2</dc:creator>
      <dc:date>2021-10-16T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran shared lib .so shows undefined symbol error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322532#M158041</link>
      <description>&lt;P&gt;Yes. Thank you for your reply!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 15:10:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-shared-lib-so-shows-undefined-symbol-error/m-p/1322532#M158041</guid>
      <dc:creator>csH2</dc:creator>
      <dc:date>2021-10-16T15:10:06Z</dc:date>
    </item>
  </channel>
</rss>

