<?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: Undefined reference to MAIN__ ??? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742997#M1930</link>
    <description>Yes that did the trick &lt;IMG src="https://community.intel.com/file/6746" alt="smiley [:-)]" /&gt;. Thanks mate&lt;BR /&gt;&lt;BR /&gt;BRP&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Jan 2007 18:10:32 GMT</pubDate>
    <dc:creator>paitor</dc:creator>
    <dc:date>2007-01-30T18:10:32Z</dc:date>
    <item>
      <title>Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742995#M1928</link>
      <description>&lt;DIV align="left"&gt;Hi I might as well start by saying that Im a total newbie to programming, thus my problem might seem ridiculous to most of you. &lt;BR /&gt;&lt;BR /&gt;Anyway, Im trying to compile an executable from src for the finite element code CalCulix, but constantly get the error (last lines):&lt;BR /&gt;&lt;BR /&gt;ifort -warn unused -warn declarations -O2 -o ccx_1.5 ccx_1.5.o ccx_1.5.a ../../../SPOOLES.2.2/spooles.a ../../../ARPACK/libarpack_SUN4.a -lm&lt;BR /&gt;ccx_1.5.o: In function `main':&lt;BR /&gt;ccx_1.5.c:(.text+0x0): multiple definition of `main'&lt;BR /&gt;/opt/intel/fc/9.1.036/lib/for_main.o:./src/libfor/for_main.c:(.text+0x0): first defined here&lt;BR /&gt;ld: Warning: size of symbol `main' changed from 88 in /opt/intel/fc/9.1.036/lib/for_main.o to 29557 in ccx_1.5.o&lt;BR /&gt;/opt/intel/fc/9.1.036/lib/for_main.o: In function `main':&lt;BR /&gt;./src/libfor/for_main.c:(.text+0x3e): undefined reference to `MAIN__'&lt;BR /&gt;make: *** [ccx_1.5] Error 1&lt;BR /&gt;&lt;BR /&gt;As Im using the ifort compiler I had to try to modify the make file which originally used:   g77 -Warn -O&lt;BR /&gt;&lt;BR /&gt;which I translated into: ifort -warn unused -warn declarations -O2&lt;BR /&gt;&lt;BR /&gt;I have also tried to use the flags: -nus -names as_is&lt;BR /&gt;&lt;BR /&gt;but no change. Also, as the code is partly written in c , Ive keept the old c-compiler options: cc -Wall -O -I&lt;BR /&gt;&lt;BR /&gt;welll, thats it, any suggestions for a stupid newbie (by the way, Im running openSuSE 10.2 on a Dell Precision, with two dual core 2.0 MHz intel Xenon processors, if this has any importance) Thanks in advance paitor&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Jan 2007 17:03:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742995#M1928</guid>
      <dc:creator>paitor</dc:creator>
      <dc:date>2007-01-29T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742996#M1929</link>
      <description>&lt;P&gt;Does this option fit your situation?&lt;/P&gt;
&lt;P&gt;-nofor-main do not link against Fortran main object&lt;BR /&gt; Used when linking Fortran objects with C main program&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2007 22:09:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742996#M1929</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2007-01-29T22:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742997#M1930</link>
      <description>Yes that did the trick &lt;IMG src="https://community.intel.com/file/6746" alt="smiley [:-)]" /&gt;. Thanks mate&lt;BR /&gt;&lt;BR /&gt;BRP&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jan 2007 18:10:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742997#M1930</guid>
      <dc:creator>paitor</dc:creator>
      <dc:date>2007-01-30T18:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742998#M1931</link>
      <description>I have a similar type of problem, but unfortunately the proposed compiler option does not work for me as I am compiling for Fortran main code (all code is frottran).&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;/opt/intel/Compiler/11.1/072/lib/intel64/for_main.o: In function `main':&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/export/users/nbtester/efi2linux_nightly/branch-11_1/20100415_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;I'll appreciate some help&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 17:07:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742998#M1931</guid>
      <dc:creator>bredsj</dc:creator>
      <dc:date>2010-08-27T17:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742999#M1932</link>
      <description>Please make sure that there is one (and only one) main program that has been compiled and included in the linking step. If you still have the problem, please report the command line and the error messages verbatim.</description>
      <pubDate>Fri, 27 Aug 2010 18:54:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/742999#M1932</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-08-27T18:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743000#M1933</link>
      <description>Thanks for coming back.&lt;BR /&gt;&lt;BR /&gt;I've solved the problem (at least for now) by using the -c compiler directive when compiling the individual subprograms:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;ifort -O2 -i8 -r8 -assume byterecl -c -nodefaultlibs *.for&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;Then I compile the .o files:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;ifort -O2 -i8 -r8 -assume byterecl *.o -o myprog&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;Whether this is correct only time will tell as I am debugging now.&lt;BR /&gt;&lt;BR /&gt;I can confirm that my program has about 20 files with routines and only one main program.&lt;BR /&gt;&lt;BR /&gt;What I gathered from the error message I got the compiler was looking for a MAIN__ program in the default directories hence the reference to ......../src/libfor/for_main.c - I have no for_main.c program and have no clue where this reference comes from.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2010 20:07:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743000#M1933</guid>
      <dc:creator>bredsj</dc:creator>
      <dc:date>2010-08-27T20:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743001#M1934</link>
      <description>| Then I compile the .o files:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;| ifort -O2 -i8 -r8 -assume byterecl *.o -o myprog&lt;BR /&gt;&lt;/I&gt;&lt;BR /&gt;No, there is no "compilation" being done with this command. The compiler parses the arguments given to it, notices that no source files were specified, and hands over the task to the linker. In fact, .o files result from a compilation, and cannot be compiled again because they are not Fortran source files.&lt;BR /&gt;&lt;BR /&gt;| I have no for_main.c program and have no clue where this reference comes from.&lt;BR /&gt;&lt;BR /&gt;The compiler run-time starts in a C main program, which does some setting up and then calls your Fortran main. The object for_main.o is part of the compiler runtime, and contains a reference to MAIN__ which, if you do not supply the object file resulting from compiling a Fortran main program, remains unsatisfied.&lt;BR /&gt;&lt;BR /&gt;Given that all your source code is in Fortran, your post is a bit out of place in this thread!&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2010 23:10:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743001#M1934</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-08-27T23:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference to MAIN__ ???</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743002#M1935</link>
      <description>My apologies for posting on the wrong thread. &lt;BR /&gt;&lt;BR /&gt;However, thanks anyway.</description>
      <pubDate>Sat, 28 Aug 2010 10:13:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-reference-to-MAIN/m-p/743002#M1935</guid>
      <dc:creator>bredsj</dc:creator>
      <dc:date>2010-08-28T10:13:30Z</dc:date>
    </item>
  </channel>
</rss>

