IT 专业人士的资源 > 论坛主页 > Windows HPC Server Developers - General > How to link Fortran with the HPC Pack SDK?
提出问题提出问题
 

已答复How to link Fortran with the HPC Pack SDK?

  • 2008年3月16日 11:58Marty Humphrey 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

     

    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

     

     

     

答案

  • 2008年3月24日 17:18LioMSFT用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

     

    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

全部回复

  • 2008年3月17日 20:36LioMSFT用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    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

  • 2008年3月17日 22:42liweip 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    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

  • 2008年3月18日 14:13Marty Humphrey 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    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

     

  • 2008年3月22日 19:07LioMSFT用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

     

    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

  • 2008年3月24日 0:04LioMSFT用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    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

     

  • 2008年3月24日 17:18LioMSFT用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

     

    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