[MacPorts] #32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure
#32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure ----------------------------------+----------------------------------------- Reporter: xt10@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 2.0.3 Keywords: linking hdf4 library | Port: hdf4 ----------------------------------+----------------------------------------- "h4fc" (the compiling command) fails to compile fortran77 program associated with hdf library. The command and error message is as below: {{{xxxx:xxx xxx$ h4fc sds_rd.f -o sds_rd.exe gfortran-mp-4.5: /opt/local/bin/gfortran-mp-4.5: linker input file unused because linking not done ld: in /opt/local/bin/gfortran-mp-4.5, can't link with a main executable collect2: ld returned 1 exit status }}} -- Ticket URL: <https://trac.macports.org/ticket/32285> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure -----------------------------+---------------------------------------------- Reporter: xt10@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: hdf4 -----------------------------+---------------------------------------------- Changes (by ryandesign@…): * keywords: linking hdf4 library => * priority: High => Normal * owner: macports-tickets@… => takeshi@… Old description:
"h4fc" (the compiling command) fails to compile fortran77 program associated with hdf library. The command and error message is as below: {{{xxxx:xxx xxx$ h4fc sds_rd.f -o sds_rd.exe gfortran-mp-4.5: /opt/local/bin/gfortran-mp-4.5: linker input file unused because linking not done ld: in /opt/local/bin/gfortran-mp-4.5, can't link with a main executable collect2: ld returned 1 exit status }}}
New description: "h4fc" (the compiling command) fails to compile fortran77 program associated with hdf library. The command and error message is as below: {{{ xxxx:xxx xxx$ h4fc sds_rd.f -o sds_rd.exe gfortran-mp-4.5: /opt/local/bin/gfortran-mp-4.5: linker input file unused because linking not done ld: in /opt/local/bin/gfortran-mp-4.5, can't link with a main executable collect2: ld returned 1 exit status }}} -- Comment: Please remember to preview before submitting so you can ensure you got your WikiFormatting right; Don't set Priority to High; Do Cc the maintainer of the affected port. -- Ticket URL: <https://trac.macports.org/ticket/32285#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure -----------------------------+---------------------------------------------- Reporter: xt10@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: hdf4 -----------------------------+---------------------------------------------- Comment(by kgh03@…): the problem lies in /opt/local/bin/h4fc $FFLAGS contains the compiler so it appears twice on the command. passing -echo flag to h4fc reveals this: + eval /opt/local/bin/gfortran-mp-4.5 /opt/local/bin/gfortran-mp-4.5 -pipe -O2 -m32 -arch ppc -L/opt/local/lib -L/opt/local/lib sd_rd.o -L/opt/local/lib -lmfhdf -ldf -lsz -ljpeg -lz ++ /opt/local/bin/gfortran-mp-4.5 /opt/local/bin/gfortran-mp-4.5 -pipe -O2 -m32 -arch ppc -L/opt/local/lib -L/opt/local/lib sd_rd.o -L/opt/local/lib -lmfhdf -ldf -lsz -ljpeg -lz ld: in /opt/local/bin/gfortran-mp-4.5, can't link with a main executable collect2: ld returned 1 exit status + status=1 + exit 1 removing gfortran from the FFLAGS seems to fix this. # FFLAGS="/opt/local/bin/gfortran-mp-4.5 -pipe -O2 -m32 " FFLAGS=" -pipe -O2 -m32 " tian, if you want a work around for now, cp /usr/local/bin/h4fc ~/ edit ~/h4fc as above. then run h4fc as ~/h4fc sds_rd.f thanks for all your hard work Takeshi. kelly Replying to [ticket:32285 xt10@…]:
"h4fc" (the compiling command) fails to compile fortran77 program associated with hdf library. The command and error message is as below: {{{ xxxx:xxx xxx$ h4fc sds_rd.f -o sds_rd.exe gfortran-mp-4.5: /opt/local/bin/gfortran-mp-4.5: linker input file unused because linking not done ld: in /opt/local/bin/gfortran-mp-4.5, can't link with a main executable collect2: ld returned 1 exit status }}}
-- Ticket URL: <https://trac.macports.org/ticket/32285#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure ------------------------------+--------------------------------------------- Reporter: xt10@… | Owner: takeshi@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: fixed | Keywords: Port: hdf4 | ------------------------------+--------------------------------------------- Changes (by takeshi@…): * status: new => closed * resolution: => fixed Comment: configure tries to extract additional flags by grep - from $F77. With gcc4x gfortran-mp-4.x has - within its name so it is regarded as an option. Fixed in r87614. -- Ticket URL: <https://trac.macports.org/ticket/32285#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts