Re: [netcdfgroup] Building NetCDF Error: mangled library path

I dont believe so. Just in case starting again with a clean
environment. I use two files to hold environment variables for
building:
gcc-source.sh:
export 
PATH=/share/apps/gcc/4.6.1/bin:/share/apps/openmpi/1.4.3-gcc-4.6.1/bin:$PATH
export 
LD_LIBRARY_PATH=/share/apps/gcc/4.6.1/lib64:/share/apps/gmp/5.0.2/lib:/share/apps/mpfr/3.0.1/lib:/share/apps/mpc/0.9/lib:/share/apps/openmpi/1.4.3-gcc-4.6.1/lib:$LD_LIBRARY_PATH

netcdf-source.sh:
export CPPFLAGS=-I/share/apps/hdf5/1.8.7-gcc-4.6.1/include
export CXXFLAGS=-I/share/apps/hdf5/1.8.7-gcc-4.6.1/include
export FFFLAGS=-I/share/apps/hdf5/1.8.7-gcc-4.6.1/include
export FCFLAGS=-I/share/apps/hdf5/1.8.7-gcc-4.6.1/include
export LDFLAGS=-L/share/apps/hdf5/1.8.7-gcc-4.6.1/lib
export FC=mpif90
export CXX=mpicxx
export CC=mpicc

Again I still get the error. So besides the above, I haven't set
CPPFLAGS to be anything else but that.

On Tue, Sep 6, 2011 at 2:58 PM, Ed Hartnett <ed@xxxxxxxxxxxxxxxx> wrote:
> David Noriega <tsk133@xxxxxxxxxxx> writes:
>
>> I'm trying to build netcdf with a newer version of gcc then the system
>> version. So I have the new gcc in my path as well as in the
>> LD_LIBRARY_PATH. I get a ld: cannot find error, yet its not that the
>> path is incorrect, its been mangled by the addition of a '-l'
>>
>> /bin/sh ../libtool --tag=FC   --mode=link mpif90  -g -O2
>> -version-number 5:1:0  -L/share/apps/hdf5/1.8.7-gcc-4.6.1/lib -o
>> libnetcdff.la -rpath /share/apps/netcdf/4.1.3-gcc-4.6.1/lib
>> fort-attio.lo fort-control.lo fort-dim.lo fort-genatt.lo
>> fort-geninq.lo fort-genvar.lo fort-lib.lo fort-misc.lo
>> fort-v2compat.lo fort-vario.lo fort-var1io.lo fort-varaio.lo
>> fort-varmio.lo fort-varsio.lo fort-nc4.lo ../liblib/libnetcdf.la
>> ../f90/libnetcdff90.la -lhdf5_hl -lhdf5 -lm -lcurl
>> libtool: link: mpif90 -shared  -fPIC  .libs/fort-attio.o
>> .libs/fort-control.o .libs/fort-dim.o .libs/fort-genatt.o
>> .libs/fort-geninq.o .libs/fort-genvar.o .libs/fort-lib.o
>> .libs/fort-misc.o .libs/fort-v2compat.o .libs/fort-vario.o
>> .libs/fort-var1io.o .libs/fort-varaio.o .libs/fort-varmio.o
>> .libs/fort-varsio.o .libs/fort-nc4.o  -Wl,--whole-archive
>> ../f90/.libs/libnetcdff90.a -Wl,--no-whole-archive  -Wl,-rpath
>> -Wl,/root/workspace/gnu/netcdf-4.1.3/liblib/.libs -Wl,-rpath
>> -Wl,/share/apps/openmpi/1.4.3-gcc-4.6.1/lib -Wl,-rpath
>> -Wl,/share/apps/gcc/4.6.1/lib/../lib64 -Wl,-rpath
>> -Wl,/share/apps/netcdf/4.1.3-gcc-4.6.1/lib -Wl,-rpath
>> -Wl,/share/apps/openmpi/1.4.3-gcc-4.6.1/lib -Wl,-rpath
>> -Wl,/share/apps/gcc/4.6.1/lib/../lib64
>> -L/share/apps/hdf5/1.8.7-gcc-4.6.1/lib ../liblib/.libs/libnetcdf.so
>> /share/apps/hdf5/1.8.7-gcc-4.6.1/lib/libhdf5_hl.a
>> /share/apps/hdf5/1.8.7-gcc-4.6.1/lib/libhdf5.a -lz -lcurl
>> -L/share/apps/openmpi/1.4.3-gcc-4.6.1/lib -l
>> -L/share/apps/gcc/4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1
>> -L/share/apps/gcc/4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64
>> -L/lib/../lib64 -L/usr/lib/../lib64
>> -L/share/apps/gcc/4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../..
>> /share/apps/openmpi/1.4.3-gcc-4.6.1/lib/libmpi_f90.so
>> /share/apps/openmpi/1.4.3-gcc-4.6.1/lib/libmpi_f77.so
>> /share/apps/openmpi/1.4.3-gcc-4.6.1/lib/libmpi.so
>> /share/apps/openmpi/1.4.3-gcc-4.6.1/lib/libopen-rte.so
>> /share/apps/openmpi/1.4.3-gcc-4.6.1/lib/libopen-pal.so -lnsl -lutil
>> -ldl /share/apps/gcc/4.6.1/lib/../lib64/libgfortran.so
>> -L/share/apps/gcc/4.6.1/lib/../lib64
>> /share/apps/gcc/4.6.1/lib/../lib64/libquadmath.so -lm -lpthread -lc
>> -lgcc_s  -O2   -pthread -Wl,-soname -Wl,libnetcdff.so.5 -o
>> .libs/libnetcdff.so.5.1.0
>> /usr/bin/ld: cannot find
>> -l-L/share/apps/gcc/4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1
>> collect2: ld returned 1 exit status
>>
>> Its adding '-l' and thus the next entry gets joined with that and ld
>> is unable to understand it. My gut feeling is the libtool script is
>> doing something. It may have ment to have something attached to '-l'
>> but is blank and thus this mess. Any ideas?
>>
>> David
>
> Howdy David,
>
> Are you sure you (or openmpi) did not set that in the CPPFLAGS?
>
> It comes after the netcdf libraries, and after a -L argument for the
> openmpi library...
>
> Thanks,
>
> Ed
> --
> Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx
>



-- 
Personally, I liked the university. They gave us money and facilities,
we didn't have to produce anything! You've never been out of college!
You don't know what it's like out there! I've worked in the private
sector. They expect results. -Ray Ghostbusters



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: