<?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: makefile question: setting source code path in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890179#M78005</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADsblionel:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;I don't see how that's going to work - the compiler would see a semicolon-separated list for the input file and won't know what to make of it.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;It's not &lt;I&gt;just &lt;/I&gt;a semicolon-separated list -- the curly braces [are supposed to] make the difference. With the braces, NMAKE should search through the directories in order and substitute the first one which does contain the source file, then give it to the compiler. At least according to [my reading of] MSDN.&lt;BR /&gt;</description>
    <pubDate>Tue, 09 Sep 2008 14:36:36 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2008-09-09T14:36:36Z</dc:date>
    <item>
      <title>makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890175#M78001</link>
      <description>I'm trying to set up a makefile to, when compiling each source file,
look through three directories in order, and compile the first version
it finds. The &lt;A href="http://www.opussoftware.com/tutorial/TutAdvanced.htm#Search%20Directories" target="_blank"&gt;.PATH.c macro shown here&lt;/A&gt;
is an example of what I want to do, but that syntax is for Opus make,
and doesn't work for me. I'm using the nmake that came with the Fortran 9.0 compiler (I think this is the Microsoft nmake,
not the ATT or Lucent nmake?). Is there a way to do this in regular make,
or my version of nmake? I've searched through previous questions here, and I've tried to google the answer, but between
the different versions of nmake, and the &lt;A href="http://msdn.microsoft.com/en-us/library/y2be734c.aspx" target="_blank"&gt;indecipherable Microsoft MSDN reference site&lt;/A&gt;, I'm stumped.&lt;BR /&gt;&lt;BR /&gt; I have the code compiling in the IDE for 32 bit windows, but I need to also compile the code for 64 bit windows, where there are
only a few differences. I'd like to make a directory with just the makefile and the code that differs, and have the directories
searched in order, e.g. c:maindir64bitcode, c:maindir, c:maindircommon,
with the first match found used. There are a lot of source
code files, but only a few that need to change for the 64 bit version.&lt;BR /&gt;
&lt;BR /&gt;
Currently, I'm just copying &lt;I&gt;all&lt;/I&gt; the source code to a
separate directory, and I have a makefile working that way, but I have to
be careful to not overwrite the 64 bit-only source files with changed
32 bit source files.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 12:48:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890175#M78001</guid>
      <dc:creator>blischke</dc:creator>
      <dc:date>2008-09-09T12:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890176#M78002</link>
      <description>A google search for nmake ".PATH." gives &lt;A href="http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/c8525b32-ef96-413f-af4e-f2c78acca589/"&gt;this MSDN forum&lt;/A&gt; thread, which leads to &lt;A href="http://msdn.microsoft.com/en-us/library/12y3a72c.aspx"&gt;this MSDN entry&lt;/A&gt;. Is that [similar to] what you've been looking for (admittedly I'm not an expert on the issue)?&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 13:43:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890176#M78002</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2008-09-09T13:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890177#M78003</link>
      <description>...in other words, a generic solution should look similar to (untested):&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;INTDIR = .Debug&lt;/PRE&gt;&lt;PRE&gt;&lt;B&gt;SRCDIRS = {.64bitcode; .; .common}&lt;/B&gt; #Assuming that makefile lies in C:maindir&lt;/PRE&gt;&lt;PRE&gt;MSG_F90 = echo "Compiling Fortran ($@)"&lt;B&gt;&lt;/B&gt;&lt;BR /&gt;F90 = ifort&lt;BR /&gt;&lt;/PRE&gt;&lt;PRE&gt;F90_OPTS= /c /debug /O0 /include:$(INTDIR) /module $(INTDIR)&lt;/PRE&gt;&lt;PRE&gt;...&lt;/PRE&gt;&lt;PRE&gt;$(INTDIR)source1.obj : $(SRCDIRS)source1.f90&lt;/PRE&gt;&lt;PRE&gt; @ $(MSG_F90)&lt;/PRE&gt;&lt;PRE&gt; @ $(F90) $(F90_OPTS) $(SRCDIRS)source1.f90&lt;/PRE&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 14:04:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890177#M78003</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2008-09-09T14:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890178#M78004</link>
      <description>I don't see how that's going to work - the compiler would see a semicolon-separated list for the input file and won't know what to make of it.&lt;BR /&gt;&lt;BR /&gt;What you COULD do is something like this. Have the main source be the following:&lt;BR /&gt;&lt;BR /&gt;INCLUDE 'real_source_1.f90'&lt;BR /&gt;&lt;BR /&gt;Now you can specify a list of folders for /INCLUDE and the compiler will pick the first 'real_source_1.f90' it finds.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 14:26:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890178#M78004</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-09-09T14:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890179#M78005</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADsblionel:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;I don't see how that's going to work - the compiler would see a semicolon-separated list for the input file and won't know what to make of it.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;It's not &lt;I&gt;just &lt;/I&gt;a semicolon-separated list -- the curly braces [are supposed to] make the difference. With the braces, NMAKE should search through the directories in order and substitute the first one which does contain the source file, then give it to the compiler. At least according to [my reading of] MSDN.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 14:36:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890179#M78005</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2008-09-09T14:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890180#M78006</link>
      <description>Thanks Jugoslav. I've come across that page, which is part of where the "indecipherable" comment came from. I don't really understand what it means, since the example has zero context. I'm trying your suggestions from your next post, but no luck yet.&lt;BR /&gt;&lt;BR /&gt;Is there any kind of manual for the nmake command, especially for the makefile it uses? The Fortran help in the IDE just gives the command line usage, but doesn't say anything about the format in the makefile. I haven't found anything online specifically for nmake, just other versions of make that don't work the same for this particular problem.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 15:49:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890180#M78006</guid>
      <dc:creator>blischke</dc:creator>
      <dc:date>2008-09-09T15:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890181#M78007</link>
      <description>(This is reply to Steve Lionel. I thought it would quote him, but it didn't)&lt;BR /&gt;&lt;BR /&gt;Wouldn't I have to do this for every file? Otherwise, if I lumped all the includes into one reallyBigFile.for, every time I changed one one file, wouldn't everything get recompiled to make reallyBigFile.obj?</description>
      <pubDate>Tue, 09 Sep 2008 15:52:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890181#M78007</guid>
      <dc:creator>blischke</dc:creator>
      <dc:date>2008-09-09T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890182#M78008</link>
      <description>Yes, you'd have to do that for every file that was different.&lt;BR /&gt;&lt;BR /&gt;NMAKE is documented as part of Visual Studio. See the MSDN Library documentation.&lt;BR /&gt;&lt;BR /&gt;Have you considered conditional compilation as an alternative?&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Sep 2008 15:56:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890182#M78008</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-09-09T15:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890183#M78009</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;blischke:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks Jugoslav. I've come across that page, which is part of where the "indecipherable" comment came from. I don't really understand what it means, since the example has zero context. I'm trying your suggestions from your next post, but no luck yet.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Yes, the nmake documentation is quite dense. My suggested code doesn't work indeed: while the directories are searched for dependents, ifort gets a wrong command line (as Steve predicted). &lt;BR /&gt;&lt;BR /&gt;I played with &lt;A href="http://"&gt;inference rules&lt;/A&gt; instead (see the samples ), and I managed to get a solution that works; see the attachment. Rather than the mentioned macro, it spells out the inference rules for each folder. Nmake will find the appropriate source file and pass it to the compiler.&lt;BR /&gt;&lt;BR /&gt;Caveat: when Source.f90 exists in several directories, Nmake seems to apply the rules in reverse order, i.e. when inference rule for Folder1 is specified first, it has the lowest search priority. I'm not sure whether you can depend on that though, and whether it's portable. &lt;BR /&gt;</description>
      <pubDate>Wed, 10 Sep 2008 09:59:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890183#M78009</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2008-09-10T09:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890184#M78010</link>
      <description>I see a lot more usage of gnu make than other brands, even on Windows. I don't entirely sympathize with such a big effort to use a utility which is incompatible with standards (and with supporting software on more than one operating system). I started with another of the commercial make utilities for Windows, but never found sufficient advantages in any non-standard make. My customers haven't found Microsoft more willing to support nmake.&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Sep 2008 12:25:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890184#M78010</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-09-10T12:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: makefile question: setting source code path</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890185#M78011</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;JugoslavDujic:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I played with &lt;A href="http://"&gt;inference rules&lt;/A&gt; instead (see the samples ), and I managed to get a solution that works; see the attachment. Rather than the mentioned macro, it spells out the inference rules for each folder. Nmake will find the appropriate source file and pass it to the compiler.&lt;BR /&gt;&lt;BR /&gt;Caveat: when Source.f90 exists in several directories, Nmake seems to apply the rules in reverse order, i.e. when inference rule for Folder1 is specified first, it has the lowest search priority. I'm not sure whether you can depend on that though, and whether it's portable. &lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Excellent! Thank you very much.&lt;BR /&gt;&lt;BR /&gt;So anyone else reading this doesn't have to download &lt;B&gt;JugoslavDujic&lt;/B&gt;'s attachment (or if it isn't there later), the key is, instead of the rule&lt;BR /&gt;&lt;BR /&gt;.f90{$(INTDIR)}.obj :&lt;BR /&gt;
 $(F90) $(F90_OPTS) $&amp;lt;&lt;BR /&gt;&lt;BR /&gt;use one rule per source folder, (with Folder2 searched &lt;I&gt;before&lt;/I&gt; Folder1)&lt;BR /&gt;&lt;BR /&gt;#inference rule for folder1 &lt;BR /&gt;{.Folder1}.f90{$(INTDIR)}.obj :&lt;BR /&gt; $(F90) $(F90_OPTS) $&amp;lt;&lt;BR /&gt; &lt;BR /&gt;#inference rule for folder2&lt;BR /&gt;{.Folder2}.f90{$(INTDIR)}.obj :&lt;BR /&gt; $(F90) $(F90_OPTS) $&amp;lt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Sep 2008 13:30:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/makefile-question-setting-source-code-path/m-p/890185#M78011</guid>
      <dc:creator>blischke</dc:creator>
      <dc:date>2008-09-10T13:30:45Z</dc:date>
    </item>
  </channel>
</rss>

