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

Re: A question of compiling netcdf library (fwd)



Hi Chanh,

>    I am a beginner of NETCDF format. Currently, I am trying to use NETCDF
> format to archive my data, but somehow I could not compile the fortran
> code. No matter how much I tried, I always get the error:
>  ld:
>  Can't locate file for:
>  -l/data/storm8/kieucq/netcdf/netcdf-3.5.1/lib/libnetcdf
> 
> I checked the lib dir and do see file libnetcdf.a there. I am very
> grateful if you help me out.

I think what you really want  to use on your compile line is the two
flags "-L" (to specify the directory) and "-l" to specify the library,
as in:

  f77 foo.f -L /data/storm8/kieucq/netcdf/netcdf-3.5.1/lib -lnetcdf -o foo

Or you could use the library without either "-L" or "-l", as in:

  f77 foo.f /data/storm8/kieucq/netcdf/netcdf-3.5.1/lib/libnetcdf.a -o foo

--Russ