How to link Fortran with the HPC Pack SDK?<p> </p> <p align=left>Hi -- I don't think this is specific to the particular compiler/linker I'm using (PGI)...maybe..</p> <p align=left> </p> <p align=left>We are having difficulties linking Fortran with the new HPC Pack SDK, we can't find any documentation/examples for this.</p> <p align=left> </p> <p align=left>Here's my link line for the CCS SDK. This link line works.</p> <p align=left> </p> <p align=left>PGI$ pgf95 -I&quot;c:\program files\microsoft compute cluster pack\include&quot; Halo.f &quot;c:\program files\microsoft compute cluster pack\lib\amd64\msmpi.lib&quot;</p> <p align=left><font face=Arial size=2></font> </p> <p align=left>We can't figure out what the corresponding link line might be for the HPC Pack SDK. The following line doesn't work because there are many unresolved symbols (e.g., mpi_init_)</p> <p align=left> </p> <p align=left>PGI$ pgf90 -I&quot;c:\program files\microsoft HPC Pack SDK\include&quot; Halo.f &quot;c:\program files\microsoft HPC Pack SDK\lib\amd64\msmpi.lib&quot;</p> <p align=left> </p> <p align=left>What are the other two libraries in c:\program files\microsoft HPC Pack SDK\lib\amd64 for? Adding either of them to the link line appears like progress, but then we get the error &quot;LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'&quot;</p> <p align=left> </p> <p align=left>thanks,</p> <p align=left>Marty</p> <p align=left> </p> <p align=left> </p> <p align=left> </p>© 2009 Microsoft Corporation. All rights reserved.Thu, 26 Mar 2009 00:35:26 Z0dac5c99-c2d2-4d85-96d2-ef87a342b1a2http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#0dac5c99-c2d2-4d85-96d2-ef87a342b1a2http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#0dac5c99-c2d2-4d85-96d2-ef87a342b1a2Marty Humphreyhttp://social.microsoft.com/Profile/en-US/?user=Marty%20HumphreyHow to link Fortran with the HPC Pack SDK?<p> </p> <p align=left>Hi -- I don't think this is specific to the particular compiler/linker I'm using (PGI)...maybe..</p> <p align=left> </p> <p align=left>We are having difficulties linking Fortran with the new HPC Pack SDK, we can't find any documentation/examples for this.</p> <p align=left> </p> <p align=left>Here's my link line for the CCS SDK. This link line works.</p> <p align=left> </p> <p align=left>PGI$ pgf95 -I&quot;c:\program files\microsoft compute cluster pack\include&quot; Halo.f &quot;c:\program files\microsoft compute cluster pack\lib\amd64\msmpi.lib&quot;</p> <p align=left><font face=Arial size=2></font> </p> <p align=left>We can't figure out what the corresponding link line might be for the HPC Pack SDK. The following line doesn't work because there are many unresolved symbols (e.g., mpi_init_)</p> <p align=left> </p> <p align=left>PGI$ pgf90 -I&quot;c:\program files\microsoft HPC Pack SDK\include&quot; Halo.f &quot;c:\program files\microsoft HPC Pack SDK\lib\amd64\msmpi.lib&quot;</p> <p align=left> </p> <p align=left>What are the other two libraries in c:\program files\microsoft HPC Pack SDK\lib\amd64 for? Adding either of them to the link line appears like progress, but then we get the error &quot;LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'&quot;</p> <p align=left> </p> <p align=left>thanks,</p> <p align=left>Marty</p> <p align=left> </p> <p align=left> </p> <p align=left> </p>Sun, 16 Mar 2008 11:58:18 Z2008-03-16T11:58:18Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#efa435b7-1635-4810-b2f0-cb2954fb7f53http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#efa435b7-1635-4810-b2f0-cb2954fb7f53Liohttp://social.microsoft.com/Profile/en-US/?user=LioHow to link Fortran with the HPC Pack SDK?<p>Hi Marty,<br> <br>Yes using the new Fortran static libraries is the way to go. I'm sorry for the lack of documentation we will have the information posted soon.<br> <br>You uncovered a problem with the static library, I will fix that for beta 2. To overcome this problem please add “-nodefaultlib” to your link line.</p> <p align=left> </p> <p>One of the msmpif*.lib is required on the link line in addition to msmpi.lib.<br>The msmpifec.lib supports compiling where the fortran compiler puts string length at the end of the parameter stack (most common case).<br>The msmpifms.lib supports compiling where the Fortran compilers puts the string length right after the string pointer on the parameter stack (mixed).</p> <p> </p> <p align=left>Hope this helps,<br></p> <p align=left>.Erez<br></p>Mon, 17 Mar 2008 20:36:36 Z2008-03-17T20:36:36Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#45480d63-0ff5-40f1-8bb5-3f7d98ae334chttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#45480d63-0ff5-40f1-8bb5-3f7d98ae334cliweiphttp://social.microsoft.com/Profile/en-US/?user=liweipHow to link Fortran with the HPC Pack SDK?<p>Hi Marty,</p> <p align=left> </p> <p align=left>the following is the Makefile I used to compile MPI fortran code using pgi 7.0.4.</p> <p align=left> </p> <p align=left>PGIDIR=d:\hpctest\public\ext\bin\PGI\win64\7.1-3<br>FC=$(PGIDIR)\bin\pgf95.exe<br><a title="mailto:LICENSE_SERVER=27003@hpcisvlicsrv" href="mailto:LICENSE_SERVER=27003@hpcisvlicsrv">LICENSE_SERVER=27003@hpcisvlicsrv</a></p> <p align=left> </p> <p align=left>#for VS2005<br>#VCDIR=$(VCINSTALLDIR)<br>#VCSDKDIR=$(VCINSTALLDIR)</p> <p align=left> </p> <p align=left>#for VS2008<br>VCSDKDIR=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\Lib\x64<br>VCDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64</p> <p align=left>FCFLAGS= -I &quot;$(CCP_INC)amd64&quot; -Mpreprocess -Mnoupcase -DUSE_FORT_CDECL<br>LDFLAGS=/nologo /NODEFAULTLIB /entry:mainCRTStartup /subsystem:console</p> <p align=left> </p> <p align=left>PGFLIBS=\<br>    $(PGIDIR)\lib\pg.lib \<br>    $(PGIDIR)\lib\pgimainxx.obj \<br>    $(PGIDIR)\lib\f90main.obj \<br>    $(PGIDIR)\lib\pgf90.lib \<br>    $(PGIDIR)\lib\libpgf90_rpm1.lib \<br>    $(PGIDIR)\lib\libpgf902.lib \<br>    $(PGIDIR)\lib\libpgf90rtl.lib \<br>    $(PGIDIR)\lib\pgftnrtl.lib \<br>    $(PGIDIR)\lib\pgc.lib \<br>    $(PGIDIR)\lib\libnspgc.lib \</p> <p align=left><br>UMLIBS=\<br>  &quot;$(CCP_LIB64)msmpi.lib&quot; \<br>  &quot;$(CCP_LIB64)msmpifec.lib&quot; \<br>  &quot;$(VCSDKDIR)\uuid.lib&quot; \<br>  &quot;$(VCSDKDIR)\kernel32.lib&quot; \<br>  &quot;$(VCDIR)\libcmt.lib&quot; \<br>  &quot;$(VCSDKDIR)\dbghelp.lib&quot; </p> <p align=left> </p> <p align=left>all<img alt="Stick out tongue" src="http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif">i.exe</p> <p align=left>pi.exe: pi.obj<br> link.exe $(LDFLAGS) -out<img alt="Stick out tongue" src="http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif">i.exe pi.obj $(UMLIBS) $(PGFLIBS)</p> <p align=left>pi.obj: pi.f90<br> @set LM_LICENSE_FILE=$(LICENSE_SERVER)<br> $(FC) $(FCFLAGS) -c pi.f90</p> <p align=left>clean:<br> del pi.obj pi.exe*<br></p> <p align=left><font face=Arial size=2>Please let me know if it doesn't work for you.</font></p> <p align=left>Liwei</p>Mon, 17 Mar 2008 22:42:43 Z2008-03-17T22:42:43Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#714be1ca-fa4a-4e35-aacb-43ed789bfbebhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#714be1ca-fa4a-4e35-aacb-43ed789bfbebMarty Humphreyhttp://social.microsoft.com/Profile/en-US/?user=Marty%20HumphreyHow to link Fortran with the HPC Pack SDK?<p>Hi Erez,</p> <p align=left> </p> <p align=left>thanks for the response! Unfortunately, this doesn't appear to work:</p> <p align=left> </p> <p align=left>PGI$ pgf90 -I&quot;c:\program files\microsoft HPC Pack SDK\include&quot; Halo.f &quot;c:\program files\microsoft HPC Pack SDK\lib\amd64\msmpi.lib&quot; &quot;c:\program files\microsoft hpc pack sdk\lib\amd64\msmpifec.lib&quot; -nodefaultlib</p> <p align=left><br>pgf90-Error-Switch -nodefaultlib expects an argument </p> <p align=left>-nodefaultlib=&lt;lib&gt; Passed to linker; remove library name to library search list<br></p> <p align=left><font face=Arial size=2>thanks,</font></p> <p align=left>Marty</p> <p align=left> </p>Tue, 18 Mar 2008 14:13:13 Z2008-03-18T14:13:13Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#7e23b048-ce2f-41fd-975c-31e229260d52http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#7e23b048-ce2f-41fd-975c-31e229260d52Liohttp://social.microsoft.com/Profile/en-US/?user=LioHow to link Fortran with the HPC Pack SDK?<p align=left><font face=Arial size=2></font> </p> <p>Interesting, it did work for me (but I was using a different linker)</p> <p align=left>what version are you using?</p> <p align=left>how about -nodefaultlib='ifconsol (or 'ifconsol.lib)</p> <p> </p> <p align=left>thanks,</p> <p align=left>.Erez</p>Sat, 22 Mar 2008 19:07:37 Z2008-03-22T19:07:37Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#a70fa1b5-26fd-44ac-be5e-5223358a9a96http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#a70fa1b5-26fd-44ac-be5e-5223358a9a96Liohttp://social.microsoft.com/Profile/en-US/?user=LioHow to link Fortran with the HPC Pack SDK?<p align=left><font face=Arial size=2>what version are you using? (It did work for me, probably because I'm using ms linker).</font></p> <p align=left>Please try using -defaultlib=ifconsol (or ifconsol.lib).</p> <p align=left> </p> <p align=left>thanks,</p> <p align=left>.Erez</p> <p align=left> </p>Mon, 24 Mar 2008 00:04:32 Z2008-03-24T00:04:32Zhttp://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#65b5b226-9577-43cf-9360-a8834ceceb23http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/0dac5c99-c2d2-4d85-96d2-ef87a342b1a2#65b5b226-9577-43cf-9360-a8834ceceb23Liohttp://social.microsoft.com/Profile/en-US/?user=LioHow to link Fortran with the HPC Pack SDK?<p align=left><font face=Arial size=2></font> </p> <p>Hi Marty,</p> <p align=left> </p> <p align=left>adding -nodefaultlib did work for me (but probably because I'm using the ms linker).</p> <p align=left>please try adding -nodefaultlib=ifconsol (or ifconsol.lib).</p> <p align=left> </p> <p align=left>btw: this is fixed for the upcomming beta2</p> <p align=left> </p> <p align=left>thanks,</p> <p align=left>.Erez</p>Mon, 24 Mar 2008 17:18:13 Z2008-03-24T17:18:13Z