Resources for IT Professionals > 포럼 홈 > 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일 월요일 오후 5: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일 월요일 오후 8: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일 월요일 오후 10: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일 화요일 오후 2: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일 토요일 오후 7: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일 월요일 오전 12: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일 월요일 오후 5: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