<?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 The thing is new.f is the in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972956#M97604</link>
    <description>&lt;P&gt;The thing is new.f is the main program and it has a PROGRAM statement.&lt;/P&gt;

&lt;P&gt;All the source files work fine during compilation and linking in windows using visual studio .But, I wanted to compile the sources for Linux and link them to single application using ifort compiler. Then '#' were not recognized and i replaced them by '!dec$ '. and I also convert the sources in to linux file system. I used respective Linux libraries. That was the only change I made on the source code.&lt;/P&gt;

&lt;P&gt;I am guessing that '!dec$ ' replacement creats this mess.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jan 2015 15:04:31 GMT</pubDate>
    <dc:creator>Lina_F_</dc:creator>
    <dc:date>2015-01-30T15:04:31Z</dc:date>
    <item>
      <title>ifort  multiple definition of `main</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972948#M97596</link>
      <description>&lt;P&gt;I am trying to compile my code with intel fortran and C++ compiler,but there is something wrong with me.&lt;/P&gt;
&lt;P&gt;ifort -o aple test_nc.o cam.o-lesmf -nofor_maintest_nc.o In function 'main'test_nc.F90:1: multiple definition of `MAIN__'cam.o:/cam.F90:5: first defined here&lt;/P&gt;
&lt;P&gt;I check test_nc.f90, it have a main，but when I check the cam.f90 ,it only have a cam,without main...&lt;BR /&gt;according to your suggest ,I add-nofor_main ,but it dosn't work!&lt;/P&gt;
&lt;P&gt;can you help me ? Thank you .&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2013 05:15:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972948#M97596</guid>
      <dc:creator>xiaoming_l_</dc:creator>
      <dc:date>2013-05-27T05:15:42Z</dc:date>
    </item>
    <item>
      <title>What is on line 5 of cam.F90?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972949#M97597</link>
      <description>&lt;P&gt;What is on line 5 of cam.F90? It would be helpful if you could attach some code from the files involved in your error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2013 18:52:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972949#M97597</guid>
      <dc:creator>Casey</dc:creator>
      <dc:date>2013-05-27T18:52:51Z</dc:date>
    </item>
    <item>
      <title>#include &lt;misc.h&gt;#include</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972950#M97598</link>
      <description>&lt;P&gt;#include &amp;lt;misc.h&amp;gt;&lt;BR /&gt;#include &amp;lt;params.h&amp;gt;&lt;/P&gt;
&lt;P&gt;#if ( !defined SCAM )&lt;BR /&gt;program cam&lt;BR /&gt;!-----------------------------------------------------------------------&lt;BR /&gt;!&lt;BR /&gt;! Purpose: Entry point for NCAR CAM &lt;BR /&gt;!&lt;BR /&gt;!-----------------------------NOTICE------------------------------------&lt;BR /&gt;!&lt;BR /&gt;! Community Atmospheric Model, $Name: cam3_1_brnchT_release01 $ (CAM)&lt;BR /&gt;!&lt;BR /&gt;! &lt;BR /&gt;! Method: Call appropriate initialization, time-stepping, and finalization routines.&lt;BR /&gt;! &lt;BR /&gt;! Author: CAM Core Group&lt;BR /&gt;! &lt;BR /&gt;!-----------------------------------------------------------------------&lt;BR /&gt; use shr_kind_mod, only: r8 =&amp;gt; SHR_KIND_R8&lt;BR /&gt; use pmgrid&lt;BR /&gt; use dycore, only: dycore_is&lt;BR /&gt; use history, only: bldfld, intht&lt;BR /&gt; use units&lt;BR /&gt; use restart, only: read_restart&lt;BR /&gt; use time_manager, only: get_nstep&lt;BR /&gt; use abortutils, only: endrun&lt;BR /&gt;#if ( defined SPMD || defined COUP_CSM )&lt;BR /&gt; use mpishorthand, only: mpicom, nsend, nrecv, nwsend, nwrecv&lt;BR /&gt;#endif&lt;/P&gt;
&lt;P&gt;these is a part of cam.f90,help you can find the error &amp;nbsp;! thank you .&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 03:16:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972950#M97598</guid>
      <dc:creator>xiaoming_l_</dc:creator>
      <dc:date>2013-05-28T03:16:40Z</dc:date>
    </item>
    <item>
      <title>The name that you place in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972951#M97599</link>
      <description>&lt;P&gt;The name that you place in the PROGRAM &amp;lt;xyzname&amp;gt; statement is immaterial -- it gets replaced by MAIN (or _MAIN or something similar) by the compiler. You are allowed to have only &lt;STRONG&gt;one&lt;/STRONG&gt; source code unit with an entry point, and you are attempting to use &lt;STRONG&gt;two&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 09:48:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972951#M97599</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-05-28T09:48:48Z</dc:date>
    </item>
    <item>
      <title>Yep, having 2 program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972952#M97600</link>
      <description>&lt;P&gt;Yep, having 2 program statements in the code you are linking will result in 2 MAIN functions. You can make the one that is not your entry point into a function or subroutine. Also I'm not sure you are using -nofor_main correctly. It is my understanding that it is meant to be used when one of your object files is from c/c++ source that contains a main() function and inhibits I fort from linking the FORTRAN startup code. I don't think it is able to be used to pick one of 2 FORTRAN entry points.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 13:13:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972952#M97600</guid>
      <dc:creator>Casey</dc:creator>
      <dc:date>2013-05-28T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Thanks for your help .You not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972953#M97601</link>
      <description>&lt;P&gt;Thanks for your help .You not only let me know my error more extensively, but also let me know the use of -nofor_main.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 13:54:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972953#M97601</guid>
      <dc:creator>xiaoming_l_</dc:creator>
      <dc:date>2013-05-28T13:54:23Z</dc:date>
    </item>
    <item>
      <title>I am trying to compile and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972954#M97602</link>
      <description>&lt;P&gt;I am trying to compile and link &amp;nbsp;23 fortran source files using ifort. After successful compilation, i can't pass the linking phase because of the following error.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;xyz.o: In function 'MAIN_'&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;xyz.f: in(text+0X0):multiple definition of 'MAIN_'&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;new.o:new.f &lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;in(text+0X0):&lt;/SPAN&gt;first defined here&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;make ***[test] error1&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Any help please?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 11:43:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972954#M97602</guid>
      <dc:creator>Lina_F_</dc:creator>
      <dc:date>2015-01-30T11:43:43Z</dc:date>
    </item>
    <item>
      <title>As per the messages, the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972955#M97603</link>
      <description>&lt;P&gt;As per the messages, the source files &lt;STRONG&gt;xyz.f&lt;/STRONG&gt; and &lt;STRONG&gt;new.f &lt;/STRONG&gt;both contain a main program in terms of the program unit the compiler has seen in those files.&lt;/P&gt;

&lt;P&gt;Look at both source files to determine which should serve as the main program. It is possible this occurred because either &lt;STRONG&gt;xyz.f&lt;/STRONG&gt; or &lt;STRONG&gt;new.f&lt;/STRONG&gt; is missing what one may have intended to be a &lt;STRONG&gt;SUBROUTINE &lt;/STRONG&gt;or &lt;STRONG&gt;FUNCTION &lt;/STRONG&gt;for the program unit in the file. It is also possible one of those files already contains an explicit &lt;STRONG&gt;PROGRAM &lt;/STRONG&gt;statement to identify the main program in which case it should be more obvious which file you need to modify. In the absence of a &lt;STRONG&gt;PROGRAM &lt;/STRONG&gt;statement the compiler assumes a program unit seen is a main program and thus applies and implicit &lt;STRONG&gt;PROGRAM MAIN&lt;/STRONG&gt; statement.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 12:12:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972955#M97603</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-01-30T12:12:42Z</dc:date>
    </item>
    <item>
      <title>The thing is new.f is the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972956#M97604</link>
      <description>&lt;P&gt;The thing is new.f is the main program and it has a PROGRAM statement.&lt;/P&gt;

&lt;P&gt;All the source files work fine during compilation and linking in windows using visual studio .But, I wanted to compile the sources for Linux and link them to single application using ifort compiler. Then '#' were not recognized and i replaced them by '!dec$ '. and I also convert the sources in to linux file system. I used respective Linux libraries. That was the only change I made on the source code.&lt;/P&gt;

&lt;P&gt;I am guessing that '!dec$ ' replacement creats this mess.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 15:04:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972956#M97604</guid>
      <dc:creator>Lina_F_</dc:creator>
      <dc:date>2015-01-30T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Yes, replacing the '#'s in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972957#M97605</link>
      <description>&lt;P&gt;Yes, replacing the '#'s in the first columns of source files by !dec$ can make a mess . Restore the original files with '#'s in them, and use the -fpp compiler option. That will invoke the preprocessor pass and then the compiler will compile the output of the preprocessor.&lt;/P&gt;

&lt;P&gt;The Linux version of IFort follows the convention that files ending in .F90 or .F should be preprocessed, so another way of fixing your problem is to name those files that need preprocessing with .F or .F90, leaving the other files with .f or .f90 suffixes.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 16:01:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972957#M97605</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-01-30T16:01:00Z</dc:date>
    </item>
    <item>
      <title>Thanks! That helped a lot!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972958#M97606</link>
      <description>&lt;P&gt;Thanks! That helped a lot!&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2015 07:59:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-multiple-definition-of-main/m-p/972958#M97606</guid>
      <dc:creator>Lina_F_</dc:creator>
      <dc:date>2015-01-31T07:59:22Z</dc:date>
    </item>
  </channel>
</rss>

