Re: [netcdfgroup] Compiling/linking issues with netCDF

Hi Jose:

They are so many possible issues here, none of which are netcdf related per se. 
 Can you pass along the following so that some sense can be made:

fink --version

which gfortran

gfortran --version

fink list netcdf

Also have you done a fink selfupdate recently and updated all files?

Thanks,

-Roy

On May 2, 2012, at 1:27 PM, Jose Borrero wrote:

> 
> Hi There,
> 
> I am at the end of my rope and i need help!
> 
> I am trying to compile a fortran program on my mac (MB Pro 10.6.8).  It uses 
> some netCDF stuff, fortran 90, etc...
> 
> (A copy of the makefile is pasted below.)
> 
> previous versions of this code have compiled here (using netCDF) and are 
> still working.
> 
> anyway, it builds the .o files fine:
> 
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c DataArrays.f90
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c Constants.f90
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c Deform.f90
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c InputOutput.f90
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c timestep.f
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c swlon.f
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c swlat.f
> gfortran -O2 -w -ff2c -fbounds-check -static 
> -I/sw/lib/netcdf-gfortran/include   -c most_db.f
> 
> then it does this:
> 
> gfortran -O2 -w -ff2c -fbounds-check -static InputOutput.o Deform.o 
> DataArrays.o Constants.o timestep.o swlon.o swlat.o most_db.o 
> -L/sw/lib/netcdf-gfortran/lib -lnetcdf -lnetcdff -o most_db
> /usr/bin/ld_classic: unknown flag: -no_compact_unwind
> collect2: ld returned 1 exit status
> make: *** [most_db] Error 1
> 
> 
> what are ld_classic and -no_compact_unwind?
> 
> Is this even a netCDF issue, or something else entirely?
> 
> my gfortran is GCC 4.6.2 and lives in /sw/bin/
> 
> i have netcdf libraries in /sw/lib AND in /sw/lib/netcdf-gfortran (i have no 
> idea how they ended up in two places, FINK??)
> i have netcdf.inc in /sw/include AND in /sw/lib/netcdf-gfortran/include
> 
> my netcdf version is 3.6.3 (i think...)
> 
> Any insights greatly appreciated!
> 
> -jose
> 
> 
> 
> 
> 
> 
> ======MAKEFILE===============
> # gnu fortran
> FC          =  gfortran
> FFLAGS            = -O2 -w -ff2c -fbounds-check -static
> #INC      = /sw/include
> INC         =/sw/lib/netcdf-gfortran/include  
> #LIB      = /sw/lib -lnetcdf
> #LIB      = /sw/lib/netcdf-gfortran/lib -lnetcdf -lnetcdff -L/sw/lib -lnetcdf 
> -lnetcdff
> LIB       = /sw/lib/netcdf-gfortran/lib -lnetcdf -lnetcdff
> 
> EXE       = most_db
> 
> OBJ         =  InputOutput.o Deform.o DataArrays.o Constants.o \
>               timestep.o swlon.o swlat.o
> 
> 
> .SUFFIXES : .mod .f90 .f
> 
> all: ${EXE} decimateBathy
> 
> InputOutput.o: DataArrays.o Constants.o Deform.o
> 
> .f90.o:
>       ${FC} ${FFLAGS} -I${INC} -c $<
> 
> .f.o:
>       ${FC} ${FFLAGS} -I${INC} -c $<
> 
> ${EXE}: ${OBJ} most_db.o
>       ${FC} ${FFLAGS} ${OBJ} most_db.o -L${LIB} -o ${EXE}
> 
> decimateBathy: ${OBJ} decimateBathy.o
>       ${FC} ${FFLAGS} ${OBJ} decimateBathy.o -L${LIB} -o decimateBathy
> 
> 
> .PHONY : clean
> 
> clean:
>       /bin/rm -f *.o *.oo *.ipo *.exe *.mod *.L
> 
> distclean: clean
>       /bin/rm -f ${EXE} decimateBathy
> =====END=MAKEFILE============
> 
> 
> 
> 
> 
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/ 

**********************
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



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