Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nc-config references libraries which do not exist #3039

Open
kevinushey opened this issue Oct 8, 2024 · 1 comment
Open

nc-config references libraries which do not exist #3039

kevinushey opened this issue Oct 8, 2024 · 1 comment

Comments

@kevinushey
Copy link

I tried building netcdf with:

cmake -B build -S .
cd build
cmake --build .

This produces a nc-config file that has:

libsprivate="-lHDF5::HDF5 -lhdf5::hdf5_hl -lm -lz -lzip -lzstd -lbz2 -lsz -lCURL::libcurl -lxml2"

I suspect those library paths, e.g. -lHDF5::HDF5, are just the raw CMake directives. Do those need to be expanded into "real" library paths before generating nc-config?

@kevinushey
Copy link
Author

I guess the presence of

netcdf-c/nc-config.cmake.in

Lines 361 to 374 in 95a6361

--libs-ac-syntax)
libs=$(echo $libs | sed 's/hdf5::hdf5_hl/hdf5_hl/g')
libs=$(echo $libs | sed 's/HDF5::HDF5/hdf5/g')
if [ "x$HAS_STATIC" = "xTRUE" ]; then
libsprivate=$(echo $libsprivate | sed 's/hdf5::hdf5_hl/hdf5_hl/g')
libsprivate=$(echo $libsprivate | sed 's/HDF5::HDF5/hdf5/g')
echo $libs $libsprivate
else
echo $libs
fi
;;
mean this is intentional, and I should instead be using --libs-ac-syntax? But then you get:

$ ./nc-config --static --libs-ac-syntax
-L/usr/local/lib -lnetcdf -lHDF5::HDF5 -lhdf5::hdf5_hl -lm -lz -lzip -lzstd -lbz2 -lsz -lCURL::libcurl -lxml2
-L/usr/local/lib -lnetcdf -lhdf5 -lhdf5_hl -lm -lz -lzip -lzstd -lbz2 -lsz -lCURL::libcurl -lxml2

Two lines are logged, and CURL::libcurl remains unreplaced in the second output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant