<?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:  linking subroutines from different directories     in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756961#M12448</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; I don't see a use of Intel Fortran here - are you using ifort to build the library and then link with a gfortran-compiled main program?  Mixing Fortran compilers is not supported.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
but isnt a static library a stand alone; independent of how they are built?&lt;BR /&gt;</description>
    <pubDate>Sun, 12 Jul 2009 15:47:37 GMT</pubDate>
    <dc:creator>roddur</dc:creator>
    <dc:date>2009-07-12T15:47:37Z</dc:date>
    <item>
      <title>linking subroutines from different directories</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756959#M12446</link>
      <description>&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;hello, &lt;BR /&gt;I post this problem earlier, You tried to help me, but still i am searching. So i am reposting it in more details.&lt;BR /&gt;How can i compile and link a program that uses subroutines in &lt;BR /&gt; different directories? &lt;BR /&gt; as for simple example; &lt;BR /&gt;
&lt;PRE&gt;[cpp]&lt;SPAN&gt;$ cat trial.f90
        call lm(oidxdn,opnu,opold,oqnu,oqold,avw)
        call lm_end(oidxdn,opnu,opold,oqnu,oqold,avw)
        end &lt;/SPAN&gt;[/cpp]&lt;/PRE&gt;
&lt;BR /&gt; is compiling as: &lt;BR /&gt;
&lt;PRE&gt;[cpp]&lt;SPAN&gt; $ gfortran  -c trial.f90 -I/home/rudra/Recursion/LMTO-A &lt;/SPAN&gt;[/cpp]&lt;/PRE&gt;
&lt;BR /&gt; &lt;/SPAN&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;but when i am trying to create the executable, it says: &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;
&lt;PRE&gt;[cpp]&lt;SPAN&gt;gfortran   trial.f90 -L/home/rudra/Recursion/LMTO-A -llm
/tmp/cc2gfNyf.o: In function `MAIN__':
trial.f90:(.text+0x44): undefined reference to `lm_'
collect2: ld returned 1 exit status &lt;/SPAN&gt;[/cpp]&lt;/PRE&gt;
&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;can anyone tell me the wayout? &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;As a work around, i tried to create a library(static) as &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;
&lt;PRE&gt;[cpp]&lt;SPAN&gt;liblm.a:MAIN/lm-lib.f MAIN/lm-lib-end.f $(lmobj)
        $(FC) -c MAIN/lm-lib.f MAIN/lm-lib-end.f $(lmobj)
        ar rcs liblm.a lm-lib.o lm-lib-end.o $(lmobj) &lt;/SPAN&gt;[/cpp]&lt;/PRE&gt;
&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;and link this to my main as: &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;
&lt;PRE&gt;[cpp]&lt;SPAN&gt;irun: $(FOBJ)
        $(FC) $(FFLAGS) $(FPAR) -o $@  $(FOBJ) -L/home/rudra/Recursion/LMTO-
A/ -llm
........
........
main.o : main.f90 util.o ldos.o fermi.o band.o dos.o mmat.o hop.o
shared.o param.o kind.o cgreen.o bit_unm.o nis.o
         $(FC) -c $(FFLAGS) $(FPAR) main.f90 -L/home/rudra/Recursion/LMTO-A -
llm &lt;/SPAN&gt;[/cpp]&lt;/PRE&gt;
&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: Courier,Monospaced;" class="fixed_width"&gt;This one is working fine, only with a problem that even if my library &lt;BR /&gt; (liblm.a) is updated, main is not updating via make and i am forced to &lt;BR /&gt; make clean; make everytime i compile. &lt;BR /&gt; any suggestion? &lt;BR /&gt; (This is historical as i am trying to create and use my FIRST library. &lt;BR /&gt; So plz. be simple) &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jul 2009 06:31:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756959#M12446</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-07-12T06:31:45Z</dc:date>
    </item>
    <item>
      <title>Re:  linking subroutines from different directories</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756960#M12447</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I don't see a use of Intel Fortran here - are you using ifort to build the library and then link with a gfortran-compiled main program? Mixing Fortran compilers is not supported.&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Jul 2009 14:19:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756960#M12447</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-07-12T14:19:55Z</dc:date>
    </item>
    <item>
      <title>Re:  linking subroutines from different directories</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756961#M12448</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; I don't see a use of Intel Fortran here - are you using ifort to build the library and then link with a gfortran-compiled main program?  Mixing Fortran compilers is not supported.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
but isnt a static library a stand alone; independent of how they are built?&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Jul 2009 15:47:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756961#M12448</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-07-12T15:47:37Z</dc:date>
    </item>
    <item>
      <title>Re:  linking subroutines from different directories</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756962#M12449</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/271365"&gt;roddur&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; but isnt a static library a stand alone; independent of how they are built?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Not at all. It has external references to the compiler's language support library and routines may have incompatible calling interfaces. A shared object (.so) can hide most of the support library issues, but even then mixing Fortran compilers is not recommended.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Jul 2009 13:07:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/linking-subroutines-from-different-directories/m-p/756962#M12449</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-07-13T13:07:21Z</dc:date>
    </item>
  </channel>
</rss>

