<?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 problem with modules and ifort (10.1.008) under Mac OS in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746729#M4488</link>
    <description>Hi,
&lt;BR /&gt;I have problems compiling our software using ifort under Mac OS. The error I get happens during the building of the binary. I have included a sample program that gives the identical error as I get with our software and ifort. The sample program compiles without error using g95 (0.91). The error I get is: 
&lt;BR /&gt;
&lt;BR /&gt;ifort  -c testmod2.f90 -o testmod2.o
&lt;BR /&gt;ifort  -c testmod.f90 -o testmod.o
&lt;BR /&gt;ifort  -c test.f90 -o test.o
&lt;BR /&gt;ar -r testlib.a test.o testmod.o testmod2.o
&lt;BR /&gt;ar: creating archive testlib.a
&lt;BR /&gt;ifort  -o test.bin test.o testlib.a
&lt;BR /&gt;ld: Undefined symbols:
&lt;BR /&gt;_testmod2_mp_var1_module2_
&lt;BR /&gt;make: *** [test.bin] Error 1
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;As can be seen from the program included below ifort has no problems with the module variables from testmod but has problems with the testmod2 variables.
&lt;BR /&gt;
&lt;BR /&gt;The main program and modules:
&lt;BR /&gt;
&lt;BR /&gt;PROGRAM test
&lt;BR /&gt;
&lt;BR /&gt;USE testmod
&lt;BR /&gt;USE testmod2
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;integer				:: a,b,c,d
&lt;BR /&gt;
&lt;BR /&gt;write (*,*) 'Hello World'
&lt;BR /&gt;
&lt;BR /&gt;a = 1
&lt;BR /&gt;b = 4
&lt;BR /&gt;c = 7
&lt;BR /&gt;
&lt;BR /&gt;write (*,*) a,c,d
&lt;BR /&gt;testmod_var = 10
&lt;BR /&gt;var1_module2 = testmod_var
&lt;BR /&gt;d = test_func(a,c)
&lt;BR /&gt;write (*,*) testmod_var,d
&lt;BR /&gt;write (*,*) var1_module2
&lt;BR /&gt;
&lt;BR /&gt;END PROGRAM test
&lt;BR /&gt;
&lt;BR /&gt;MODULE testmod
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;PRIVATE
&lt;BR /&gt;PUBLIC testmod_var,test_func
&lt;BR /&gt;
&lt;BR /&gt;INTEGER,SAVE   :: testmod_var
&lt;BR /&gt;
&lt;BR /&gt;CONTAINS
&lt;BR /&gt;
&lt;BR /&gt;FUNCTION test_func(a,b)
&lt;BR /&gt;  INTEGER :: test_func
&lt;BR /&gt;  INTEGER, INTENT(IN) :: a,b
&lt;BR /&gt;  test_func = a + b + 3
&lt;BR /&gt;END FUNCTION test_func
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;END MODULE testmod
&lt;BR /&gt;
&lt;BR /&gt;MODULE testmod2
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;PRIVATE var2_module2
&lt;BR /&gt;PUBLIC var1_module2
&lt;BR /&gt;
&lt;BR /&gt;INTEGER  :: var1_module2,var2_module2
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;END MODULE testmod2
&lt;BR /&gt;
&lt;BR /&gt;</description>
    <pubDate>Wed, 06 Feb 2008 22:36:58 GMT</pubDate>
    <dc:creator>michielotten</dc:creator>
    <dc:date>2008-02-06T22:36:58Z</dc:date>
    <item>
      <title>problem with modules and ifort (10.1.008) under Mac OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746729#M4488</link>
      <description>Hi,
&lt;BR /&gt;I have problems compiling our software using ifort under Mac OS. The error I get happens during the building of the binary. I have included a sample program that gives the identical error as I get with our software and ifort. The sample program compiles without error using g95 (0.91). The error I get is: 
&lt;BR /&gt;
&lt;BR /&gt;ifort  -c testmod2.f90 -o testmod2.o
&lt;BR /&gt;ifort  -c testmod.f90 -o testmod.o
&lt;BR /&gt;ifort  -c test.f90 -o test.o
&lt;BR /&gt;ar -r testlib.a test.o testmod.o testmod2.o
&lt;BR /&gt;ar: creating archive testlib.a
&lt;BR /&gt;ifort  -o test.bin test.o testlib.a
&lt;BR /&gt;ld: Undefined symbols:
&lt;BR /&gt;_testmod2_mp_var1_module2_
&lt;BR /&gt;make: *** [test.bin] Error 1
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;As can be seen from the program included below ifort has no problems with the module variables from testmod but has problems with the testmod2 variables.
&lt;BR /&gt;
&lt;BR /&gt;The main program and modules:
&lt;BR /&gt;
&lt;BR /&gt;PROGRAM test
&lt;BR /&gt;
&lt;BR /&gt;USE testmod
&lt;BR /&gt;USE testmod2
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;integer				:: a,b,c,d
&lt;BR /&gt;
&lt;BR /&gt;write (*,*) 'Hello World'
&lt;BR /&gt;
&lt;BR /&gt;a = 1
&lt;BR /&gt;b = 4
&lt;BR /&gt;c = 7
&lt;BR /&gt;
&lt;BR /&gt;write (*,*) a,c,d
&lt;BR /&gt;testmod_var = 10
&lt;BR /&gt;var1_module2 = testmod_var
&lt;BR /&gt;d = test_func(a,c)
&lt;BR /&gt;write (*,*) testmod_var,d
&lt;BR /&gt;write (*,*) var1_module2
&lt;BR /&gt;
&lt;BR /&gt;END PROGRAM test
&lt;BR /&gt;
&lt;BR /&gt;MODULE testmod
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;PRIVATE
&lt;BR /&gt;PUBLIC testmod_var,test_func
&lt;BR /&gt;
&lt;BR /&gt;INTEGER,SAVE   :: testmod_var
&lt;BR /&gt;
&lt;BR /&gt;CONTAINS
&lt;BR /&gt;
&lt;BR /&gt;FUNCTION test_func(a,b)
&lt;BR /&gt;  INTEGER :: test_func
&lt;BR /&gt;  INTEGER, INTENT(IN) :: a,b
&lt;BR /&gt;  test_func = a + b + 3
&lt;BR /&gt;END FUNCTION test_func
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;END MODULE testmod
&lt;BR /&gt;
&lt;BR /&gt;MODULE testmod2
&lt;BR /&gt;
&lt;BR /&gt;IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;PRIVATE var2_module2
&lt;BR /&gt;PUBLIC var1_module2
&lt;BR /&gt;
&lt;BR /&gt;INTEGER  :: var1_module2,var2_module2
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;END MODULE testmod2
&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Feb 2008 22:36:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746729#M4488</guid>
      <dc:creator>michielotten</dc:creator>
      <dc:date>2008-02-06T22:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem with modules and ifort (10.1.008) under Mac OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746730#M4489</link>
      <description>After your 'ar' command, you need to run ranlib -c against it:&lt;BR /&gt;&lt;BR /&gt;ranlib -c testlib.a&lt;BR /&gt;&lt;BR /&gt;ron&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Feb 2008 23:21:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746730#M4489</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2008-02-06T23:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with modules and ifort (10.1.008) under Mac OS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746731#M4490</link>
      <description>Thanks Ron!
that did it :-)
Cheers,
Michiel.</description>
      <pubDate>Wed, 06 Feb 2008 23:50:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-modules-and-ifort-10-1-008-under-Mac-OS/m-p/746731#M4490</guid>
      <dc:creator>michielotten</dc:creator>
      <dc:date>2008-02-06T23:50:36Z</dc:date>
    </item>
  </channel>
</rss>

