Closed ArchangeGabriel closed 5 years ago
Similar errors were also discovered yesterday. A fix has been created in a branch
name nc4_build_bug
. Could you please give it a try to see if it solves the problem for you.
FYI. Commands to download and build.
git clone https://github.com/Parallel-NetCDF/PnetCDF.git
cd PnetCDF
git checkout nc4_build_bug
autoreconf
./configure --enable-shared ...
Note adding -fPIC
to CPPFLAGS
is not necessary. If you would like to build
shared libraries, adding --enable-shared
to the configure command line is sufficient.
I am not sure other flags you used are necessary. In my case, I only use -g
or -O2
.
This branch indeed solves the issue. Regarding -fPIC
, IIRC it was necessary to get suitable static libs (we ship both shared and static libs). All flags are distro (Arch Linux) defaults by the way.
Thanks for testing. I am glad it works for Arch Linux and will soon make another release, 1.11.2.
From your configure output on screen, iI can see option --enable-shared
was used.
Because PnetCDF configure script makes use of GNU libtool, this option automatically adds
-fPIC -DPIC
. To show the compile and link command lines during make, use below.
make LIBTOOLFLAGS=--verbose
But there is no harm either to add -fPIC
to CPPFLAGS .
Oh, you’re right. I guess this is a leftover from when PnetCDF could not be built shared at all. Thanks for the remark. I’ll wait for the 1.11.2 release to push then.
Hi @ArchangeGabriel I am trying to find the real cause of the problem you encountered. My current understanding is this problem happens only when NetCDF4 is built with static libraries only. But in my test, this case always fails at the configure time, not make time like your case. Could you check if your NetCDF4 library under /usr/lib is built with static libraries only? In addition, could you provide config.log from your earlier build of 1.11.1? thanks
Hi @wkliao, I’ll do this but when I find a bit of time for it, which unfortunately might not be before this week-end.
Sorry for the delay, as discussed over email I’ve uploaded the config.log here: https://paste.xinu.at/muAKho/
Also, I always have static+shared libs for NetCDF4.
Build log: