PnetCDF question?

Latham, Robert J. robl at mcs.anl.gov
Wed Mar 2 16:20:50 CST 2016


On Wed, 2016-03-02 at 22:04 +0000, Hu, Yao wrote:

> I understand the libpnetcdf.a is a static library and cannot be dynamically linked with. I thus tried to add the flag:
> 

Let me clarify slightly: the static library can be part of a shared
library build.  It's just that the pnetcdf parts will be statically
linked.  Look at the pnetcdf utilities:

% ldd ~/work/soft/pnetcdf/bin/ncmpigen 
	linux-vdso.so.1 =>  (0x00007ffc231ee000)
	libmpi.so.0 => /home/robl/work/soft/mpich-clang/lib/libmpi.so.0
(0x00007f4e581aa000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4e57de5000)
	libpmpi.so.0 => /home/robl/work/soft/mpich-clang/lib/libpmpi.so.0
(0x00007f4e577d9000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4e575d1000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f4e573b3000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4e5854c000)


They use both shared and static libraries. 

> export CXXFLAGS="$CXXFLAGS -fPIC"
> 
> before I configure parallel netcdf. Unfortunately, it still generates the static (.a) library. Could you please let me know how to generate the dynamically linked library (.os)? or other suggestions? Thanks in advance.
> 

Yep, you'll get a (slightly larger) libpnetcdf.a with the -fPIC flag.
But, with -fPIC you have now provided enough additional information for
your linker to hook everything together.

==rob

> Sincerely,
> Yao
> 
> Yao Hu, PhD
> Postdoctoral Researcher
> National Center for Supercomputing Applications
> 1205 W Clark St.
> Urbana, IL, USA 61801




More information about the parallel-netcdf mailing list