Bug 200590

Summary: science/hdf5: with FORTRAN option failed to build
Product: Ports & Packages Reporter: fmysh
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (sunpoet)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for Makefile none

Description fmysh 2015-06-02 10:05:39 UTC
Created attachment 157369 [details]
patch for Makefile

science/hdf5 with FORTRAN option depends on lang/gcc48 for gfortran.
Build process fails trying to link with not /usr/local/lib/gcc48/libgcc_s.so.1 but /usr/lib/libgcc_s.so.1.

# make
(snip)
Making all in fortran
Making all in src
  FC       H5test_kind_STORAGE_SIZE.o
  FCLD     H5test_kind
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__getf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__floatunditf@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__subtf3@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__multf3@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__unordtf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__lttf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__addtf3@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__gttf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__divtf3@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__letf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__netf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__floatditf@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__trunctfdf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__eqtf2@GCC_4.6.0'
/usr/local/lib/gcc48/libgfortran.so: undefined reference to `__floatsitf@GCC_4.6.0'
collect2: error: ld returned 1 exit status
*** [H5test_kind] Error code 1

Stop in /usr//ports/science/hdf5/work/hdf5-1.8.15/fortran/src.
*** [all-recursive] Error code 1

Stop in /usr/ports/science/hdf5/work/hdf5-1.8.15/fortran.
*** [all-recursive] Error code 1

Stop in /usr/ports/science/hdf5/work/hdf5-1.8.15.
*** [do-build] Error code 1

Stop in /usr/ports/science/hdf5.
*** [stage] Error code 1

Stop in /usr/ports/science/hdf5.


Generated Makefiles by configure have -L/usr/lib explicitly before -L/usr/local/lib/gcc48. They come from CONFIGURE_ARGS=--with-zlib=/usr.
As zlib is enabled by default, This is unnecessary.
Removing the argument cleared the problem.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-06-07 15:39:27 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Jun  7 15:39:08 UTC 2015
New revision: 388724
URL: https://svnweb.freebsd.org/changeset/ports/388724

Log:
  - Fix build with FORTRAN enabled

  Build failure with FORTRAN enabled was caused by configure-generated LDFLAGS
  where -L/usr/lib appeared before -L${LOCALBASE}/lib/gcc48. It is the simplest
  way to solve this problem by removing --with-zlib from CONFIGURE_ARGS.

  PR:		200590
  Submitted by:	Taoka Fumiyoshi <fmysh@iijmio-mail.jp>

Changes:
  head/science/hdf5/Makefile
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2015-06-07 15:42:06 UTC
Committed. Thanks!