locked
How to link Fortran with the HPC Pack SDK? RRS feed

  • Question

  •  

    Hi -- I don't think this is specific to the particular compiler/linker I'm using (PGI)...maybe..

     

    We are having difficulties linking Fortran with the new HPC Pack SDK, we can't find any documentation/examples for this.

     

    Here's my link line for the CCS SDK. This link line works.

     

    PGI$ pgf95 -I"c:\program files\microsoft compute cluster pack\include" Halo.f "c:\program files\microsoft compute cluster pack\lib\amd64\msmpi.lib"

     

    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_)

     

    PGI$ pgf90 -I"c:\program files\microsoft HPC Pack SDK\include" Halo.f "c:\program files\microsoft HPC Pack SDK\lib\amd64\msmpi.lib"

     

    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 "LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'"

     

    thanks,

    Marty

     

     

     

    Sunday, March 16, 2008 11:58 AM

Answers

  •  

    Hi Marty,

     

    adding -nodefaultlib did work for me (but probably because I'm using the ms linker).

    please try adding -nodefaultlib=ifconsol (or ifconsol.lib).

     

    btw: this is fixed for the upcomming beta2

     

    thanks,

    .Erez

    • Marked as answer by Josh Barnard Thursday, March 26, 2009 12:35 AM
    Monday, March 24, 2008 5:18 PM

All replies

  • Hi Marty,
     
    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.
     
    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.

     

    One of the msmpif*.lib is required on the link line in addition to msmpi.lib.
    The msmpifec.lib supports compiling where the fortran compiler puts string length at the end of the parameter stack (most common case).
    The msmpifms.lib supports compiling where the Fortran compilers puts the string length right after the string pointer on the parameter stack (mixed).

     

    Hope this helps,

    .Erez

    Monday, March 17, 2008 8:36 PM
  • Hi Marty,

     

    the following is the Makefile I used to compile MPI fortran code using pgi 7.0.4.

     

    PGIDIR=d:\hpctest\public\ext\bin\PGI\win64\7.1-3
    FC=$(PGIDIR)\bin\pgf95.exe
    LICENSE_SERVER=27003@hpcisvlicsrv

     

    #for VS2005
    #VCDIR=$(VCINSTALLDIR)
    #VCSDKDIR=$(VCINSTALLDIR)

     

    #for VS2008
    VCSDKDIR=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\Lib\x64
    VCDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64

    FCFLAGS= -I "$(CCP_INC)amd64" -Mpreprocess -Mnoupcase -DUSE_FORT_CDECL
    LDFLAGS=/nologo /NODEFAULTLIB /entry:mainCRTStartup /subsystem:console

     

    PGFLIBS=\
        $(PGIDIR)\lib\pg.lib \
        $(PGIDIR)\lib\pgimainxx.obj \
        $(PGIDIR)\lib\f90main.obj \
        $(PGIDIR)\lib\pgf90.lib \
        $(PGIDIR)\lib\libpgf90_rpm1.lib \
        $(PGIDIR)\lib\libpgf902.lib \
        $(PGIDIR)\lib\libpgf90rtl.lib \
        $(PGIDIR)\lib\pgftnrtl.lib \
        $(PGIDIR)\lib\pgc.lib \
        $(PGIDIR)\lib\libnspgc.lib \


    UMLIBS=\
      "$(CCP_LIB64)msmpi.lib" \
      "$(CCP_LIB64)msmpifec.lib" \
      "$(VCSDKDIR)\uuid.lib" \
      "$(VCSDKDIR)\kernel32.lib" \
      "$(VCDIR)\libcmt.lib" \
      "$(VCSDKDIR)\dbghelp.lib"

     

    allStick out tonguei.exe

    pi.exe: pi.obj
     link.exe $(LDFLAGS) -outStick out tonguei.exe pi.obj $(UMLIBS) $(PGFLIBS)

    pi.obj: pi.f90
     @set LM_LICENSE_FILE=$(LICENSE_SERVER)
     $(FC) $(FCFLAGS) -c pi.f90

    clean:
     del pi.obj pi.exe*

    Please let me know if it doesn't work for you.

    Liwei

    Monday, March 17, 2008 10:42 PM
  • Hi Erez,

     

    thanks for the response! Unfortunately, this doesn't appear to work:

     

    PGI$ pgf90 -I"c:\program files\microsoft HPC Pack SDK\include" Halo.f "c:\program files\microsoft HPC Pack SDK\lib\amd64\msmpi.lib" "c:\program files\microsoft hpc pack sdk\lib\amd64\msmpifec.lib" -nodefaultlib


    pgf90-Error-Switch -nodefaultlib expects an argument

    -nodefaultlib=<lib> Passed to linker; remove library name to library search list

    thanks,

    Marty

     

    Tuesday, March 18, 2008 2:13 PM
  •  

    Interesting, it did work for me (but I was using a different linker)

    what version are you using?

    how about -nodefaultlib='ifconsol (or 'ifconsol.lib)

     

    thanks,

    .Erez

    Saturday, March 22, 2008 7:07 PM
  • what version are you using? (It did work for me, probably because I'm using ms linker).

    Please try using -defaultlib=ifconsol (or ifconsol.lib).

     

    thanks,

    .Erez

     

    Monday, March 24, 2008 12:04 AM
  •  

    Hi Marty,

     

    adding -nodefaultlib did work for me (but probably because I'm using the ms linker).

    please try adding -nodefaultlib=ifconsol (or ifconsol.lib).

     

    btw: this is fixed for the upcomming beta2

     

    thanks,

    .Erez

    • Marked as answer by Josh Barnard Thursday, March 26, 2009 12:35 AM
    Monday, March 24, 2008 5:18 PM