<?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 There is no such thing as an  in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020421#M108055</link>
    <description>&lt;P&gt;There is no such thing as an "MPI Fortran compiler". Rather, MPI installations include scripts (such as mpifort) that invoke an existing Fortran compiler with options to add MPI libraries and include files.&lt;/P&gt;

&lt;P&gt;If you are doing MPI development, you need a full MPI installation. If you are only using Fortran coarrays with Intel Fortran, we provide everything you need with the compiler.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2015 16:54:28 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2015-08-10T16:54:28Z</dc:date>
    <item>
      <title>Compiling and Linking Fortran Code with external modules and libraries</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020402#M108036</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I am trying to create a fortran program. I have already done this in Windows and using Visual Studio.&lt;/P&gt;

&lt;P&gt;In linux I am using ifort (ifort (IFORT) 14.0.2 20140120).&lt;/P&gt;

&lt;P&gt;I am very new to this. I appreciate your help. I will explain the procedure I am taking below.&lt;/P&gt;

&lt;P&gt;I have my source code ( File1.f90, File2.f90, File3.f90 and main.f90) and then I have a folder full of external libraries (*.a and *.mod )&lt;/P&gt;

&lt;P&gt;I have not written these libraries nor I have any idea which compiler was used to compile and create those libraries.&lt;/P&gt;

&lt;P&gt;I try to first compile my files using the following:&lt;/P&gt;

&lt;P&gt;File1.90&amp;nbsp; and File2.f90 are not using these external libraries while File3.90 is using these external libraries. At last main.f90 is using File3.90. In order to compile I have used the following commands:&lt;/P&gt;

&lt;P&gt;ifort -c File1.f90&lt;/P&gt;

&lt;P&gt;ifort -c File2.f90&lt;/P&gt;

&lt;P&gt;ifort -c File3.f90 -I&amp;nbsp; mylib&amp;amp;modulesDirectoryAddress &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;ifort -c main.f90&amp;nbsp; -I&amp;nbsp; mylib&amp;amp;modulesDirectoryAddress&lt;/P&gt;

&lt;P&gt;All files are compiled successfully but when I try to link them using the following command I ran in to error :&lt;/P&gt;

&lt;P&gt;ifort&amp;nbsp; File1.o File2.o File3.o main.o -I&amp;nbsp; mylib&amp;amp;modulesDirectoryAddress&lt;/P&gt;

&lt;P&gt;The error is this:&lt;/P&gt;

&lt;P&gt;File3.f90 undefined reference to `m_get_mp_&lt;STRONG&gt;myFunction&lt;/STRONG&gt;_'&lt;/P&gt;

&lt;P&gt;myFunction is a function that I call inside File3.f90 from one of the external modules/libraries.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;subroutine File3_internalFunction&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use &lt;STRONG&gt;externalModule&lt;/STRONG&gt;, only : &lt;STRONG&gt;myFunction&lt;/STRONG&gt;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !external&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=*), intent(in) :: fname&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intent(in) :: timeStep&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=32), intent(in)::&amp;nbsp; vname&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real, pointer&amp;nbsp;&amp;nbsp; :: varValue(:)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logical:: stopIfNotPresent&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=256) ::&amp;nbsp; firstPartOfString&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=80) ::&amp;nbsp; outpStr&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varValue =&amp;gt; &lt;STRONG&gt;myFunction&lt;/STRONG&gt;(fname, vname, timeStep)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine&lt;/P&gt;

&lt;P&gt;Could you please let me know what is the possible reason that I am getting the above error?&amp;nbsp; Also do I need to have additional compile or link options that I am missing right now ? I am coming from Visual Studio and I am&amp;nbsp; quite confused how to get the same exectuable here?&lt;/P&gt;

&lt;P&gt;Also are there any system-dependent options that I will need to define?I am trying to get an executable for 64-bit Linux systems.&lt;/P&gt;

&lt;P&gt;I would really appreciate your help.&lt;/P&gt;

&lt;P&gt;Thank you very much in Advance for your help.&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;/P&gt;

&lt;P&gt;Heli&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 13:20:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020402#M108036</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-07-21T13:20:44Z</dc:date>
    </item>
    <item>
      <title>You need to include in the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020403#M108037</link>
      <description>&lt;P&gt;You need to include in the ifort command for linking the .a for the externally-supplied library.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 14:00:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020403#M108037</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-07-21T14:00:30Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020404#M108038</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;You need to include in the ifort command for linking the .a for the externally-supplied library.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Dear Steve,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I tried to add my libraries with the following command.&lt;/P&gt;

&lt;P&gt;ifort&amp;nbsp; File1.o File2.o File3.o main.o -IMylib&amp;amp;modulesDirectoryAddress -LMylib&amp;amp;modulesDirectoryAddress&lt;/P&gt;

&lt;P&gt;and it still gives me the previous error.&lt;/P&gt;

&lt;P&gt;Then I tried the following option as wel :&lt;/P&gt;

&lt;P&gt;ifort&amp;nbsp; File1.o File2.o File3.o main.o -IMylib&amp;amp;modulesDirectoryAddress -LMylib&amp;amp;modulesDirectoryAddress -lLIB1.a -lLIB2.a&lt;/P&gt;

&lt;P&gt;but still it is not working. It is giving me the following error.&lt;/P&gt;

&lt;P&gt;ld: cannot find -lLIB1.a&lt;/P&gt;

&lt;P&gt;ld: cannot find -lLIB2.a&lt;/P&gt;

&lt;P&gt;What am I doing wrong here?&lt;/P&gt;

&lt;P&gt;Thank you very much in Advance for your help.&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:00:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020404#M108038</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-07-22T13:00:23Z</dc:date>
    </item>
    <item>
      <title>Include files and module</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020405#M108039</link>
      <description>&lt;P&gt;Include files and module files are not used during the link step, so adding -I... to a linker command does nothing other than add to the confusion.&lt;/P&gt;

&lt;P&gt;The Unix/Linux convention for specifying additional libraries is as follows: to use a library with name libmyname.a, the command line option is -lmyname. It is not appropriate to use capital letters when naming library files, especially the "lib" part. If you rename LIB1.a to lib1.a and LIB2.a to lib2.a, the linker command line should contain "-l1 -l2". For each name after "-l", the library file name is constructed by adding "lib" before and ".a" after.&lt;/P&gt;

&lt;P&gt;You can also list the full name without a preceding '-', but you probably do not need to do so in your case.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:45:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020405#M108039</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-07-22T13:45:36Z</dc:date>
    </item>
    <item>
      <title>The .a sufix is not used for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020406#M108040</link>
      <description>&lt;P&gt;The .a sufix is not used for the -l switch - it looks for .a automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:47:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020406#M108040</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-07-22T13:47:25Z</dc:date>
    </item>
    <item>
      <title>Dear all,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020407#M108041</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I corrected my library names. I do not get the &lt;STRONG&gt;can not find library&lt;/STRONG&gt; error, but I ran in to another error. Now my procedure is as follows.&lt;/P&gt;

&lt;P&gt;ifort -c File1.f90&lt;/P&gt;

&lt;P&gt;ifort -c File2.f90&lt;/P&gt;

&lt;P&gt;ifort -c File3.f90 -I&amp;nbsp; mylib&amp;amp;modulesDirectoryAddress &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;ifort -c main.f90&amp;nbsp; -I&amp;nbsp; mylib&amp;amp;modulesDirectoryAddress&lt;/P&gt;

&lt;P&gt;and then I tried to link in two ways:&lt;/P&gt;

&lt;P&gt;Try1:&amp;nbsp; ifort File1.o File2.o File3.o main.o &lt;STRONG&gt;-L&lt;/STRONG&gt;myLibraryDirectory &lt;STRONG&gt;-l&lt;/STRONG&gt;myExternalLib&lt;/P&gt;

&lt;P&gt;Try2: ifort main.o File3.o File2.o File1.o&amp;nbsp; &lt;STRONG&gt;-L&lt;/STRONG&gt;myLibraryDirectory &lt;STRONG&gt;-l&lt;/STRONG&gt;myExternalLib&lt;/P&gt;

&lt;P&gt;using both try1 and try2 I get the same error.&lt;/P&gt;

&lt;P&gt;../Fortran_dbg/Try1/r4/lib/MyExternalLib.a(bci.o): In function `m_bci_mp_bci_start_':&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x3a): undefined reference to `mpi_init_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x55): undefined reference to `mpi_comm_rank_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x79): undefined reference to `mpi_comm_size_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x94): undefined reference to `mpi_finalize_'&lt;/P&gt;

&lt;P&gt;and a lot more of these &lt;STRONG&gt;undefined reference&amp;nbsp; &lt;/STRONG&gt;errors refering to functions apparently inside this library and related to mpi.&lt;/P&gt;

&lt;P&gt;Could you please help me on what I am doing wrong here.&lt;/P&gt;

&lt;P&gt;Thank you very much in Advance for your help.&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 08:57:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020407#M108041</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-07-23T08:57:49Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020408#M108042</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I assume your program has a "use mpi" statement.&lt;/P&gt;

&lt;P&gt;On Windows, this would automatically tell the linker to add the MPI libraries.&lt;/P&gt;

&lt;P&gt;On Linux, this does not happen.&amp;nbsp; YOU need to explicitly add the MPI libraries to your link line.&amp;nbsp;&amp;nbsp;&amp;nbsp; And, what your MPI libraries are named will depend on which MPI you're using.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --Lorri&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 17:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020408#M108042</guid>
      <dc:creator>Lorri_M_Intel</dc:creator>
      <dc:date>2015-07-23T17:03:28Z</dc:date>
    </item>
    <item>
      <title>Can anyone explain how to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020409#M108043</link>
      <description>This comment has been moved to its own &lt;A href="https://community.intel.com/en-us/forums/topic/563443"&gt;thread&lt;/A&gt;</description>
      <pubDate>Fri, 24 Jul 2015 20:20:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020409#M108043</guid>
      <dc:creator>Madhubalan_R_</dc:creator>
      <dc:date>2015-07-24T20:20:42Z</dc:date>
    </item>
    <item>
      <title>Dear Lorri, </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020410#M108044</link>
      <description>&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;Dear Lorri,&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;Thanks for your reply. The libraries that I am using to link with are some libraries from an external software.&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;I am not using this software, but I am using only these libraries and my code does not run any mpi jobs.&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;I have the windows version of my code as well and on windows I have the Intel MPI runtime installed on my machine and not the Intel MPI library.&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;Also the visual estudio for the windows version contains these additional configurations under Properties/Fortran/commandline&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;/libs:static /threads /c&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;and in addition it is asked to ignore MSVCRT.&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;Is my linking error related to any of the above ?&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;Thank you very much in Advance for your help,&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.0080003738403px; line-height: 15.609601020813px;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 15:14:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020410#M108044</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-07-27T15:14:57Z</dc:date>
    </item>
    <item>
      <title>Your source file bci.f is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020411#M108045</link>
      <description>&lt;P&gt;Your source file bci.f is calling MPI routines.&lt;/P&gt;

&lt;P&gt;MSVCRT is strictly a Windows issue and does not apply here.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:14:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020411#M108045</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-07-27T16:14:32Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020412#M108046</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks for your reply. Assuming that my external libraries are calling MPI routine and that the mpi is INTEL MPI. Could you please guide how I should link to Intel mpi libraries ?&lt;/P&gt;

&lt;P&gt;I have already installed Intel MPI&amp;nbsp; in&lt;/P&gt;

&lt;P&gt;/opt/intel/impi/5.1.0.079/&lt;/P&gt;

&lt;P&gt;and there are a number of *.so&amp;nbsp; libraries in the following folder.&amp;nbsp; (including libmpi.so.5)&lt;/P&gt;

&lt;P&gt;/opt/intel/impi/5.1.0.079/lib64/&lt;/P&gt;

&lt;P&gt;How should I link with Intel mpi libraries?&lt;/P&gt;

&lt;P&gt;Also is there any of my operating system kernel libraries that I might have to link with as well?&lt;/P&gt;

&lt;P&gt;I would appreciate any help.&lt;/P&gt;

&lt;P&gt;Thank you very much in Advance for your help,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2015 15:12:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020412#M108046</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-08-07T15:12:56Z</dc:date>
    </item>
    <item>
      <title>mpiifort would automatically</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020413#M108047</link>
      <description>&lt;P&gt;mpiifort would automatically link Intel MPI and compiler libraries.&amp;nbsp; Sourcing the mpivars.&lt;C&gt;sh script&amp;nbsp; will set up the Intel MPI shared object paths for build and run.&amp;nbsp; You would also source compilervars.&amp;nbsp; Intel compilers get the gnu and linux library paths automatically from the g++ which is active when compiling.&lt;/C&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2015 15:51:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020413#M108047</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-08-07T15:51:29Z</dc:date>
    </item>
    <item>
      <title>Hi Tim,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020414#M108048</link>
      <description>&lt;P&gt;Hi Tim,&lt;/P&gt;

&lt;P&gt;Thanks for your answer. I do the following steps but I the command mpiifort still is not recongnized and I get the following:&lt;/P&gt;

&lt;P&gt;1.source compilervars.sh intel64&lt;/P&gt;

&lt;P&gt;now if I do which ifort, i get the folloiwng:&lt;/P&gt;

&lt;P&gt;/opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort&lt;/P&gt;

&lt;P&gt;2. If I check the LD_LIBRARY_PATH, i get the following:&lt;/P&gt;

&lt;P&gt;/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mpirt/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mpirt/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64:/usr/lib64/mpi/gcc/openmpi/lib64&lt;/P&gt;

&lt;P&gt;3. Then I go to the impi forlder and I source mpivars.sh by running (source mpivars.sh)&lt;/P&gt;

&lt;P&gt;cd /opt/intel/impi/5.1.0.079/intel64/bin&lt;/P&gt;

&lt;P&gt;source mpivars.sh&lt;/P&gt;

&lt;P&gt;but still when I run mpiifort I get the following :&lt;/P&gt;

&lt;P&gt;If 'mpiifort' is not a typo you can use command-not-found to lookup the package that contains it, like this:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; cnf mpiifort&lt;/P&gt;

&lt;P&gt;This is while mpif90 works fine and gives this :&lt;/P&gt;

&lt;P&gt;gfortran: fatal error: no input files&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	compilation terminated.&lt;/P&gt;

&lt;P&gt;What am I missing here ? I appreciate your comments.&lt;/P&gt;

&lt;P&gt;Thank you very much in Advance for your help&lt;/P&gt;

&lt;P&gt;Heli&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;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 09:00:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020414#M108048</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-08-10T09:00:02Z</dc:date>
    </item>
    <item>
      <title>You did not show your PATH</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020415#M108049</link>
      <description>&lt;P&gt;You did not show your &lt;STRONG&gt;PATH &lt;/STRONG&gt;after sourcing compilervars or mpivars but in your &lt;STRONG&gt;LD_LIBRARY_PATH&lt;/STRONG&gt; there is a hint that you likely have openmpi in your &lt;STRONG&gt;PATH &lt;/STRONG&gt;based on the appearance of “/usr/lib64/mpi/gcc/openmpi/lib64”. That is most likely where &lt;STRONG&gt;mpif90 &lt;/STRONG&gt;is resolving from.&lt;/P&gt;

&lt;P&gt;Why &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;was not found after sourcing &lt;STRONG&gt;mpivars.sh &lt;/STRONG&gt;is not clear.&lt;/P&gt;

&lt;P&gt;After sourcing &lt;STRONG&gt;mpivars.sh&lt;/STRONG&gt;, what is the &lt;STRONG&gt;I_MPI_ROOT&lt;/STRONG&gt; environment variable set to?&lt;/P&gt;

&lt;P&gt;After sourcing &lt;STRONG&gt;mpivars.sh&lt;/STRONG&gt;, double check &lt;STRONG&gt;PATH &lt;/STRONG&gt;to ensure &lt;STRONG&gt;/opt/intel/impi/5.1.0.079/intel64/bin&lt;/STRONG&gt; is included. The error you received suggests that it is not in your &lt;STRONG&gt;PATH&lt;/STRONG&gt;. You might also double-check also that &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;is present in that directory, it should be.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 09:53:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020415#M108049</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-08-10T09:53:07Z</dc:date>
    </item>
    <item>
      <title>If you have openmpi in your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020416#M108050</link>
      <description>&lt;P&gt;If you have openmpi in your PATH and LD_LIBRARY_PATH after the Intel coarray MPI library path, openmpi won't work even if it is able to compile.&lt;/P&gt;

&lt;P&gt;As Kevin hinted, a build of openmpi provided with your linux would have mpif90 built against gfortran.&amp;nbsp; The mpif90 which comes with Intel MPI would do the same (there is mpif90 -fc=ifort if you prefer that).&amp;nbsp; If your linux provides an openmpi on the default PATH and LD_LIBRARY_PATH, you should remove it.&amp;nbsp; Not only would it conflict with other MPI implementations (including use of openmpi with ifort), it may be out of date.&amp;nbsp; The instructions for building openmpi against either ifort or gfortran are on the openmpi site, in case you still want openmpi; if you build it yourself, you would use --prefix to give it its own installation path (analogous to /opt/intel/impi/version/).&amp;nbsp; Openmpi and Intel mpi don't mix; for example, they have conflicting coding of data types.&lt;/P&gt;

&lt;P&gt;The Intel coarray MPI setup seems to conflict with the advice given by Intel prior to ifort adding it, that each MPI installation should have its own path requiring a specific command like 'source mpivars.sh' to set it up.&amp;nbsp; Large data centers typically use the module command for this purpose.&amp;nbsp; They still have to observe in general the precaution of setting up MPI after ifort, although recent Intel compilervars.sh does check for the case where Intel MPI is already set up.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 11:28:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020416#M108050</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-08-10T11:28:59Z</dc:date>
    </item>
    <item>
      <title>Dear all,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020417#M108051</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I&amp;nbsp; uninstalled openmpi from my machine.&amp;nbsp; Now the command mpif90 is not recognized as well. before setting the compiler and mpi environment variables&amp;nbsp; &lt;STRONG&gt;LD_LIBRARY_PATH&amp;nbsp; &lt;/STRONG&gt;will give me this:&lt;/P&gt;

&lt;P&gt;/usr/lib64/mpi/gcc/openmpi/lib64&amp;nbsp; although I have uninstalled &lt;STRONG&gt;openmpi.&lt;/STRONG&gt; (I can not restart my machine at the moment). I think the &lt;STRONG&gt;openmpi runtime&lt;/STRONG&gt; is still on the machine as some applications depend on it.&lt;/P&gt;

&lt;P&gt;I manually unset &lt;STRONG&gt;LD_LIBRARY_PATH&amp;nbsp; &lt;/STRONG&gt;in a new terminal and then I set the &lt;STRONG&gt;compilervars.sh&lt;/STRONG&gt; and &lt;STRONG&gt;mpivars.sh&lt;/STRONG&gt; and I get the following:&lt;/P&gt;

&lt;P&gt;echo &lt;STRONG&gt;$LD_LIBRARY_PATH &lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;/opt/intel/impi/4.1.3.049/intel64/lib:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mpirt/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64&lt;/P&gt;

&lt;P&gt;echo $&lt;STRONG&gt;I_MPI_ROOT&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;/opt/intel/impi/4.1.3.049&lt;/P&gt;

&lt;P&gt;I am using another impi version now.&lt;/P&gt;

&lt;P&gt;Anyway I do not have an &lt;STRONG&gt;mpiifort&lt;/STRONG&gt; inside the folder&lt;/P&gt;

&lt;P&gt;/opt/intel/impi/4.1.3.049/intel64/bin/&lt;/P&gt;

&lt;P&gt;I have mpirun though.&amp;nbsp; Is there anything wrong with my installation?&lt;/P&gt;

&lt;P&gt;Thanks in Advance,&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;P&gt;&amp;nbsp;&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:32:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020417#M108051</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-08-10T13:32:12Z</dc:date>
    </item>
    <item>
      <title>The contents under /opt/intel</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020418#M108052</link>
      <description>&lt;P&gt;The contents under &lt;STRONG&gt;/opt/intel/impi/4.1.3.049 &lt;/STRONG&gt;sounds like the MPI run-time installed for support of the Fortran Coarray feature which is not the complete MPI installation, hence, the missing &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;as you noted (among others).&lt;/P&gt;

&lt;P&gt;Earlier you mentioned the &lt;STRONG&gt;/opt/intel/impi/5.1.0.079/&lt;/STRONG&gt;. From what you wrote it sounded like you installed that separately yourself and I was expecting that might be the full Intel MPI installation. You could check whether &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;is present under that area. If so, then after sourcing compilervars, source the mpivars from this 5.1.0.079&amp;nbsp; installation and check if the &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;command then works.&lt;/P&gt;

&lt;P&gt;If &lt;STRONG&gt;mpiifort &lt;/STRONG&gt;is not present in the 5.1.0.079 installation, then to use MPI you would need to get the full Intel MPI installation package and install that.&lt;/P&gt;

&lt;P&gt;Sorry about all the problems you are experiencing.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 14:27:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020418#M108052</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-08-10T14:27:41Z</dc:date>
    </item>
    <item>
      <title>Dear Kevin,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020419#M108053</link>
      <description>&lt;P&gt;Dear Kevin,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I am now sure that I do not have the full MPI installation (any versions) and that I only have the MPI runtime.&lt;/P&gt;

&lt;P&gt;My fortran compiler though is part of the &lt;STRONG&gt;Intel® Parallel Studio XE Composer Edition for Fortran Linux*. (2013 update 5)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;According the product information the composer edition does not come with the MPI library adn only the cluster edition has MPI library.&lt;/P&gt;

&lt;P&gt;I am trying to compile a code that uses some external libraries. These libraries are calling some MPI routine which causes errors at the linking step.&lt;/P&gt;

&lt;P&gt;./../Sources/Kernel/bci.f:(.text+0x3a): undefined reference to `mpi_init_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x55): undefined reference to `mpi_comm_rank_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x79): undefined reference to `mpi_comm_size_'&lt;BR /&gt;
	../../Sources/Kernel/bci.f:(.text+0x94): undefined reference to `mpi_finalize_'&lt;/P&gt;

&lt;P&gt;When google , I saw that most poeple solved their problem by using mpi fortran compilers instead of fortran compilers. Is using mpiifort in my case the first thing I must be looking at ?&lt;/P&gt;

&lt;P&gt;When I do &lt;STRONG&gt;strings &lt;/STRONG&gt;over one of these external libraries and search for GCC I see the following:&lt;/P&gt;

&lt;P&gt;-defaultlib:libxnhost -defaultlib:xn_host64d&lt;BR /&gt;
	GCC: (GNU) 4.5.1 20100924 (Red Hat 4.5.1-4)&lt;BR /&gt;
	GCC: (GNU) 3.3.3 (SuSE Linux)&lt;/P&gt;

&lt;P&gt;I would appreciate your experiences.&lt;/P&gt;

&lt;P&gt;Thanks in Advance,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:00:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020419#M108053</guid>
      <dc:creator>Heli_N_</dc:creator>
      <dc:date>2015-08-10T16:00:53Z</dc:date>
    </item>
    <item>
      <title>Ok, looking back over this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020420#M108054</link>
      <description>&lt;P&gt;Ok, looking back over this thread, I think this might work for you since you are trying to link against libraries built with MPI but where your program does not use MPI. I built a small mock-up to test this; a main program linked to a static library built with a routine containing MPI code.&lt;/P&gt;

&lt;P&gt;First, to resolve the MPI routines, on your &lt;STRONG&gt;ifort &lt;/STRONG&gt;command-line for the link step at least, try adding: &lt;STRONG&gt;-L /opt/intel/impi/4.1.3.049/intel64/lib -lmpi -lmpigf -lmpigi&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Second, if the link succeeds, before you run the executable, ensure that &lt;STRONG&gt;LD_LIBRARY_PATH&lt;/STRONG&gt; contains: &lt;STRONG&gt;/opt/intel/impi/4.1.3.049/intel64/lib&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I believe this may enable you to link and run the resulting executable without using &lt;STRONG&gt;mpirun&lt;/STRONG&gt;. For my trivial test case, I could run the executable (a.out in my case) itself directly, and with &lt;STRONG&gt;mpirun &lt;/STRONG&gt;using two ranks.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:53:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020420#M108054</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-08-10T16:53:00Z</dc:date>
    </item>
    <item>
      <title>There is no such thing as an</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020421#M108055</link>
      <description>&lt;P&gt;There is no such thing as an "MPI Fortran compiler". Rather, MPI installations include scripts (such as mpifort) that invoke an existing Fortran compiler with options to add MPI libraries and include files.&lt;/P&gt;

&lt;P&gt;If you are doing MPI development, you need a full MPI installation. If you are only using Fortran coarrays with Intel Fortran, we provide everything you need with the compiler.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:54:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiling-and-Linking-Fortran-Code-with-external-modules-and/m-p/1020421#M108055</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-08-10T16:54:28Z</dc:date>
    </item>
  </channel>
</rss>

