<?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 Fortran subModule for OOP meethods in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Fortran-subModule-for-OOP-meethods/m-p/1175803#M8089</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Dear All:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I am trying subModule for OOP methods in Fortran as test case. Followings are code snippets:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Module:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;Module declarations
    type::Car
        character(len=10)::Name
        character(len=10)::Make
        contains
          procedure::print=&amp;gt;Print_CarInfo
    end type Car

    interface
        module subroutine Print_CarInfo(self)
            class(Car)::self
        end subroutine
    end interface
End Module declarations&lt;/PRE&gt;

&lt;P&gt;subModule:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subModule (declarations) definitions
  contains
    module subroutine Print_CarInfo(self)
        class(Car)::self
        print*,self%Name
        print*,self%Make
    end subroutine Print_CarInfo
end subModule definitions&lt;/PRE&gt;

&lt;P&gt;mainProgram:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testOOP
    use declarations
    type(Car)::MyFirstCar

    MyFirstCar%Name='MyCar'
    MyFirstCar%Make='Hyundai'
    call MyFirstCar%print()
end program testOOP&lt;/PRE&gt;

&lt;P&gt;Compile Note: ifort module.f90 submodule.f90 main.f90&lt;/P&gt;

&lt;P&gt;Error:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Undefined symbols for architecture x86_64:
  "_declarations_mp_print_", referenced from:
      _MAIN__ in iforteEEioN.o
     (maybe you meant: _declarations_mp_print_carinfo_)
ld: symbol(s) not found for architecture x86_64&lt;/PRE&gt;

&lt;P&gt;But same things compiled correctly with gfortran-6. By the way i am using ifort-18&lt;/P&gt;

&lt;P&gt;Thanks in Advance,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Masrul&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Dec 2017 01:03:48 GMT</pubDate>
    <dc:creator>Masrul</dc:creator>
    <dc:date>2017-12-21T01:03:48Z</dc:date>
    <item>
      <title>Fortran subModule for OOP meethods</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Fortran-subModule-for-OOP-meethods/m-p/1175803#M8089</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Dear All:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I am trying subModule for OOP methods in Fortran as test case. Followings are code snippets:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Module:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;Module declarations
    type::Car
        character(len=10)::Name
        character(len=10)::Make
        contains
          procedure::print=&amp;gt;Print_CarInfo
    end type Car

    interface
        module subroutine Print_CarInfo(self)
            class(Car)::self
        end subroutine
    end interface
End Module declarations&lt;/PRE&gt;

&lt;P&gt;subModule:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subModule (declarations) definitions
  contains
    module subroutine Print_CarInfo(self)
        class(Car)::self
        print*,self%Name
        print*,self%Make
    end subroutine Print_CarInfo
end subModule definitions&lt;/PRE&gt;

&lt;P&gt;mainProgram:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testOOP
    use declarations
    type(Car)::MyFirstCar

    MyFirstCar%Name='MyCar'
    MyFirstCar%Make='Hyundai'
    call MyFirstCar%print()
end program testOOP&lt;/PRE&gt;

&lt;P&gt;Compile Note: ifort module.f90 submodule.f90 main.f90&lt;/P&gt;

&lt;P&gt;Error:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Undefined symbols for architecture x86_64:
  "_declarations_mp_print_", referenced from:
      _MAIN__ in iforteEEioN.o
     (maybe you meant: _declarations_mp_print_carinfo_)
ld: symbol(s) not found for architecture x86_64&lt;/PRE&gt;

&lt;P&gt;But same things compiled correctly with gfortran-6. By the way i am using ifort-18&lt;/P&gt;

&lt;P&gt;Thanks in Advance,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Masrul&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 01:03:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Fortran-subModule-for-OOP-meethods/m-p/1175803#M8089</guid>
      <dc:creator>Masrul</dc:creator>
      <dc:date>2017-12-21T01:03:48Z</dc:date>
    </item>
  </channel>
</rss>

