[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #FVK-122895]: Problem with installing netCDF.



Yanshi,

Here's the problem:

  http://lists.gnu.org/archive/html/libtool/2011-01/msg00011.html

and here's what I recommended last year:

  http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11369.html

with this correction of a typo:

  http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11371.html

--Russ

> Hi Russ,
> 
> I an trying to reinstall netcdf to my Mac OS X 10.8.2, and
> 
> $gcc --version
> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) 
> (LLVM build 2336.11.00)
> 
> $gfortran --version
> GNU Fortran (GCC) 4.2.3
> 
> And I did
> cd netcdf-4.2.1.1
> export FC="gfortran -m64"
> ./configure --prefix=/usr/local --disable-netcdf-4
> make
> make check
> sudo make install
> 
> These ran without error.
> Then
> 
> cd ../netcdf-fortran-4.2
> CPPFLAGS=-I$/usr/local/include
> DYLD_LIBRARY_PATH=/usr/local/lib
> LDFLAGS=-L/usr/local/lib
> ./configure --prefix=/usr/local
> 
> which ran OK, then
> make gives
> 
> ……..
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DDLL_EXPORT -g -O2 -MT 
> fort-varsio.lo -MD -MP -MF .deps/fort-varsio.Tpo -c fort-varsio.c  
> -fno-common -DPIC -o .libs/fort-varsio.o
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DDLL_EXPORT -g -O2 -MT 
> fort-varsio.lo -MD -MP -MF .deps/fort-varsio.Tpo -c fort-varsio.c -o 
> fort-varsio.o >/dev/null 2>&1
> /bin/sh ../libtool --tag=FC   --mode=link gfortran -m64  -g -O2  
> -version-number 5:3:1   -o libnetcdff.la -rpath /usr/local/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  ../f90/libnetcdff90.la -lnetcdf
> libtool: link: gfortran -m64 -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o 
> .libs/libnetcdff.5.dylib  .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   -Wl,-force_load,../f90/.libs/libnetcdff90.a  
> /usr/local/lib/libnetcdf.dylib -lm -lz -lcurl  -m64   -install_name  
> /usr/local/lib/libnetcdff.5.dylib -compatibility_version 9 -current_version 
> 9.1 -Wl,-single_module
> /usr/bin/libtool: unknown option character `f' in: -force_load
> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] 
> [-arch_only arch] [-sacLT]
> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist 
> listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] 
> [-compatibility_version #] [-current_version #] [-seg1addr 0x#] 
> [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table 
> <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] 
> [-noall_load]
> make[3]: *** [libnetcdff.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> 
> 
> Any idea how to fix this? The config.log file for Fortran library is attached.
> Thank you so much!
> Yanshi.
> 
> 
> 
> OK, here are the relevant lines from config.log:
> 
> configure:17833: gfortran -g -O2 -c conftestf.f
> configure:17836: $? = 0
> configure:17839: gfortran -o conftest -g -O2  conftestf.o conftest.o
> ld: warning: ignoring file conftest.o, file was built for unsupported file 
> format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 1 0x 
> 0 0x 0 0x 0 )  which is not the architecture being linked (i386): conftest.o
> Undefined symbols for architecture i386:
> "_sub_", referenced from:
> _MAIN__ in conftestf.o
> ld: symbol(s) not found for architecture i386
> 
> Your gfortran is compiling for i386, a 32-bit architecture, but your gcc is
> apparently compiling for a different architecture, probably 64-bit x86_64.
> You have to use the same architecture if you want to link the software 
> together.
> You could do this by either using the right flags for gcc, for example -m32 or
> maybe -arch i386, or use a flag for gfortran, maybe -m64 or -arch x86_64.  If
> you installed netcdf-fortran from MacPorts, you may have a gfortran that 
> produces
> 64-bit objects with a long name something like
> /opt/local/bin/x86_64-apple-darwin-gfortran-mp-4.7
> but it might be easier to just use the gfortran you have and make gcc produce
> 32-bit objects.
> 
> --Russ
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FVK-122895
Department: Support netCDF
Priority: Normal
Status: Closed