<?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 libraries... in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743563#M2311</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a problem when linking my libraries, even if their a re shared or static ones...&lt;BR /&gt;&lt;BR /&gt;the main program (a.f) is&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;program test&lt;BR /&gt;c&lt;BR /&gt;doubleprecision a, b&lt;BR /&gt;integer i&lt;BR /&gt;c&lt;BR /&gt;external somma, prodotto, divisione&lt;BR /&gt;c&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;write(6,*) 'Routine Maths'&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;write(6,*) 'Sum, type 1'&lt;BR /&gt;write(6,*) 'Product, type 2'&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;read(5,*) i&lt;BR /&gt;c&lt;BR /&gt;a=10.0d0&lt;BR /&gt;b=20.0d0&lt;BR /&gt;c&lt;BR /&gt;if(i.eq.1) then&lt;BR /&gt;call somma(a, b, c)&lt;BR /&gt;else if (i.eq.2) then&lt;BR /&gt;call prodotto(a, b, c)&lt;BR /&gt;end if&lt;BR /&gt;c&lt;BR /&gt;write(6,*) c&lt;BR /&gt;c&lt;BR /&gt;end&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;while the subroutine (b.f90) is&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;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;subroutine somma(a,b,c)&lt;BR /&gt;!&lt;BR /&gt;doubleprecision a, b, c&lt;BR /&gt;!&lt;BR /&gt;c = a + b&lt;BR /&gt;&lt;BR /&gt;end subroutine somma&lt;BR /&gt;!&lt;BR /&gt;!&lt;BR /&gt;!&lt;BR /&gt;subroutine prodotto(a,b,c)&lt;BR /&gt;!&lt;BR /&gt;doubleprecision a, b, c&lt;BR /&gt;!&lt;BR /&gt;c = a * b&lt;BR /&gt;!&lt;BR /&gt;end subroutine prodotto&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I run&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -o a.out a.f b.f90&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;all is okkey...&lt;BR /&gt;&lt;BR /&gt;But, if I run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -fpic -c b.f90&lt;BR /&gt;ifort -shared b.so b.o&lt;BR /&gt;ifort -o a.out a.f b.so&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I find this exit (when i run ./a.out)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;./a.out: error while loading shared libraries: lib.so: cannot open shared object file: No such file or directory&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I use the static library, when I link the main with the library I found&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;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -fpic -c b.f90&lt;BR /&gt;ar rc b.a b.o&lt;BR /&gt;ifort -o a.out a.f b.so&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;/tmp/ifortcOUaGn.o: In function `MAIN__':&lt;BR /&gt;a.f:(.text+0x235): undefined reference to `prodotto_'&lt;BR /&gt;a.f:(.text+0x24e): undefined reference to `somma_'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How I can resolve my problem???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2007 16:17:46 GMT</pubDate>
    <dc:creator>teclis77</dc:creator>
    <dc:date>2007-03-19T16:17:46Z</dc:date>
    <item>
      <title>Problem with libraries...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743563#M2311</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a problem when linking my libraries, even if their a re shared or static ones...&lt;BR /&gt;&lt;BR /&gt;the main program (a.f) is&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;program test&lt;BR /&gt;c&lt;BR /&gt;doubleprecision a, b&lt;BR /&gt;integer i&lt;BR /&gt;c&lt;BR /&gt;external somma, prodotto, divisione&lt;BR /&gt;c&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;write(6,*) 'Routine Maths'&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;write(6,*) 'Sum, type 1'&lt;BR /&gt;write(6,*) 'Product, type 2'&lt;BR /&gt;write(6,*) ''&lt;BR /&gt;read(5,*) i&lt;BR /&gt;c&lt;BR /&gt;a=10.0d0&lt;BR /&gt;b=20.0d0&lt;BR /&gt;c&lt;BR /&gt;if(i.eq.1) then&lt;BR /&gt;call somma(a, b, c)&lt;BR /&gt;else if (i.eq.2) then&lt;BR /&gt;call prodotto(a, b, c)&lt;BR /&gt;end if&lt;BR /&gt;c&lt;BR /&gt;write(6,*) c&lt;BR /&gt;c&lt;BR /&gt;end&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;while the subroutine (b.f90) is&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;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;subroutine somma(a,b,c)&lt;BR /&gt;!&lt;BR /&gt;doubleprecision a, b, c&lt;BR /&gt;!&lt;BR /&gt;c = a + b&lt;BR /&gt;&lt;BR /&gt;end subroutine somma&lt;BR /&gt;!&lt;BR /&gt;!&lt;BR /&gt;!&lt;BR /&gt;subroutine prodotto(a,b,c)&lt;BR /&gt;!&lt;BR /&gt;doubleprecision a, b, c&lt;BR /&gt;!&lt;BR /&gt;c = a * b&lt;BR /&gt;!&lt;BR /&gt;end subroutine prodotto&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I run&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -o a.out a.f b.f90&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;all is okkey...&lt;BR /&gt;&lt;BR /&gt;But, if I run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -fpic -c b.f90&lt;BR /&gt;ifort -shared b.so b.o&lt;BR /&gt;ifort -o a.out a.f b.so&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I find this exit (when i run ./a.out)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;./a.out: error while loading shared libraries: lib.so: cannot open shared object file: No such file or directory&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I use the static library, when I link the main with the library I found&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;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;ifort -fpic -c b.f90&lt;BR /&gt;ar rc b.a b.o&lt;BR /&gt;ifort -o a.out a.f b.so&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;/tmp/ifortcOUaGn.o: In function `MAIN__':&lt;BR /&gt;a.f:(.text+0x235): undefined reference to `prodotto_'&lt;BR /&gt;a.f:(.text+0x24e): undefined reference to `somma_'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How I can resolve my problem???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2007 16:17:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743563#M2311</guid>
      <dc:creator>teclis77</dc:creator>
      <dc:date>2007-03-19T16:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with libraries...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743564#M2312</link>
      <description>&lt;P&gt;In the static case, don't you want b.a rather than b.so?&lt;/P&gt;
&lt;P&gt;Is your .so in a directory named in LD_LIBRARY_PATH?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2007 17:43:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743564#M2312</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-03-19T17:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with libraries...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743565#M2313</link>
      <description>I'm sorry... obviously it is b.a...&lt;BR /&gt;&lt;BR /&gt;but, why I have to put the b.so in teh LD_LIBRARY_PATH, if it is in the same directory?&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Mar 2007 17:50:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743565#M2313</guid>
      <dc:creator>teclis77</dc:creator>
      <dc:date>2007-03-19T17:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with libraries...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743566#M2314</link>
      <description>I'm not familiar enough with Linux to answer that. The references I could find did not indicate that the current directory was included in the search by default.</description>
      <pubDate>Mon, 19 Mar 2007 19:57:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-libraries/m-p/743566#M2314</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-03-19T19:57:23Z</dc:date>
    </item>
  </channel>
</rss>

