Subject: RPATH -R/usr/pkg/lib added when using f2c-f77 when configuring netcdf
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 12/17/2004 14:05:01
I am trying to configure devel/netcdf under Mac OS X:

checking if Fortran "byte" is C "signed char"... ld: unknown flag:
-R/usr/pkg/lib
configure: error: Could not link conftestf.o and conftest.o
*** Error code 1

the .work.log has:

<.> /usr/pkg/bin/f2c-f77 -o conftest -O conftestf.o conftest.o
-I/opt/pkgsrc/devel/netcdf/work.belgium/.buildlink/include
-L/opt/pkgsrc/devel/netcdf/work.belgium/.buildlink/lib

It appears to be a problem wuth /usr/pkg/bin/f2c-f77 itself, which
contains and uses:

FLIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lF77 -lI77 -lm"

I am not sure when this is used though:
S2DBLFLAG="-R"

My workaround was to manually edit /usr/pkg/bin/f2c-f77 and fix FLIBS:
FLIBS="-L/usr/pkg/lib -lF77 -lI77 -lm"


Maybe FLIBS could be defined in the lang/f2c/Makefile based on
_USE_RPATH (yes or no) and set in the
MAKE_ENV. And then the source code's Makefile can be fixed with your
patch-aa so the sed expression for the install target also replaces
@FLIBS@.

I will do this if okay?

I don't know yet, because netcdf next fails with:

g++ -o .libs/nctst -O2
-I/opt/pkgsrc/devel/netcdf/work.belgium/.buildlink/include -o .libs/nctst
-O2 nctst.o -Wl,-bind_at_load
-L/opt/pkgsrc/devel/netcdf/work.belgium/.buildlink/lib
./.libs/libnetcdf_c++.dylib ../libsrc/.libs/libnetcdf.dylibib

ld: -o: multiply specified

I am not sure where that extra "-o .libs/nctst" is from.


 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/