[MacPorts] #32285: hdf4 @4.2.6 +gcc45 compiling error - linking failure

MacPorts noreply at macports.org
Mon Nov 28 08:35:43 PST 2011


#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


More information about the macports-tickets mailing list