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

Re: 20050715: NetCDF libraries generated but unable to link to them



Unidata Support <address@hidden> writes:

> ------- Forwarded Message
>
>>To: address@hidden
>>From: address@hidden
>>Subject: NetCDF libraries generated but unable to link to them
>>Organization: Fisheries and Oceans Canada
>>Keywords: 200507151308.j6FD8Sjo000481 netCDF link
>
> Dear NetCDF team,
>
>
> I have been struggling trying to compile the NetCDF libraries and link them
> to my
> data reading codes. I have managed to compile it (the compilation went very
> fast though)
> but am not able to link my codes with them.
>
> Our system is a SUN Fire V40z server, model i86pc with Solaris OS 5.10 on a
> 4-CPU
> (opteron processor 850) with 16 Gb of RAM.
> The compilers are: GCC and g95.
> My setting is:
>
> export CC='gcc'
> export CXX='g++'
> export CPPFLAGS='-DNDEBUG -DpgiFortran'
> export CFLAGS='-O -g'
> export FC='g95'
> export F90='g95'
> export FFLAGS='-O -g -fno-second-underscore'
> export F90FLAGS='-O -g -fno-second-underscore'
>
> Everything compiles fine, I did the test and the extra_test.
>
> Now I am compiling a simple Fortran 90 and get the following errors:
>
> ================================== Begin error
> ===================================
> g95 -c netcdf_test.f90 -L/home/andry/Software/netcdf-3.6.0/lib -lnetcdf
> -I/home/andry/Software/netcdf-3.6.0/include
> g95: -lnetcdf: linker input file unused because linking not done
> g95 -o netcdf_test.e netcdf_test.o -L/home/andry/Software/netcdf-3.6.0/lib
> -lnetcdf -I/home/andry/Software/netcdf-3.6.0/include
> Undefined                       first referenced
>  symbol                             in file
> netcdf_MP_nf90_def_dim__            netcdf_test.o
> netcdf_MP_nf90_put_att_one_fourbytereal__ netcdf_test.o
> netcdf_MP_nf90_def_var_manydims__   netcdf_test.o
> netcdf_MP_nf90_put_var_2d_fourbytereal__ netcdf_test.o
> netcdf_MP_nf90_put_var_1d_fourbytereal__ netcdf_test.o
> netcdf_MP_nf90_put_att_text__       netcdf_test.o
> netcdf_MP_nf90_put_var_text__       netcdf_test.o
> netcdf_MP_nf90_close__              netcdf_test.o
> netcdf_MP_nf90_def_var_onedim__     netcdf_test.o
> netcdf_MP_nf90_create__             netcdf_test.o
> netcdf_MP_nf90_strerror__           netcdf_test.o
> netcdf_MP_nf90_put_var_1d_fourbyteint__ netcdf_test.o
> netcdf_MP_nf90_put_var_fourbyteint__ netcdf_test.o
> netcdf_MP_nf90_enddef__             netcdf_test.o
> netcdf_MP_nf90_def_var_scalar__     netcdf_test.o
> netcdf_MP_nf90_put_att_fourbytereal__ netcdf_test.o
> ld: fatal: Symbol referencing errors. No output written to netcdf_test.e
> gmake: *** [netcdf_test] Error 1
> ===================================== End error
> ===================================
>
> I would appreciate any suggestion on how to solve this problem.
>
> Thank you very much for your help,
>
> Regards,
>
> Andry William Ratsimandresy
> NSERC Visiting Scientist, Biol. and Phys. Oceanography Section
> Fisheries and Oceans Canada
> NAFC, East White Hills Rd.
> P.O. Box 5667 St. John's, NL A1C 5X1
> CANADA
>
>
> Tel: +1-709-772-5880           Fax: +1-709-772-4105
>
> --
> NOTE: All email exchanges with Unidata User Support are recorded in the
> Unidata inquiry tracking system and then made publicly available
> through the web.  If you do not want to have your interactions made
> available in this way, you must let us know in each email you send to us.
>
> ------- End of Forwarded Message
>
>
If make test worked in the f90 directory, then the f90 functions are
there and can be linked to, because that's what the f90 test is. Are
you sure that f90 built? Go to the f90 directory and do:

make clean test 

In any case, I can't debug without the full picture. Please send me
the *full* output of the following:

make distclean && ./configure && make test

Of course, see whatever environment vars you need.


-- 
Ed Hartnett  -- address@hidden