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

-lcurl included in libraries, even when remote access disabled #3016

Closed
edwardhartnett opened this issue Sep 11, 2024 · 4 comments · Fixed by #3018
Closed

-lcurl included in libraries, even when remote access disabled #3016

edwardhartnett opened this issue Sep 11, 2024 · 4 comments · Fixed by #3018
Assignees

Comments

@edwardhartnett
Copy link
Contributor

I got this email from a NOAA programmer:

I am trying to run the model on a new system and I compiled all libraries on login node, but when I run the regression tests on compute nodes, where we also run the build steps, compilation fails with the error about missing libcurl library.

ld: cannot find -lcurl

Compute nodes are probably configured slightly differently than login nodes.

I found that the -lcurl linker flag comes from the netcdf library, specifically:

[Dusan.Jovic@nfe04 install]$ grep -r lcurl netcdf
netcdf/lib/libnetcdf.settings:Extra libraries: -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm
netcdf/lib/libnetcdf.la:dependency_libs=' -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/hdf5/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zstd/lib
-L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zlib/lib -lstdc++ -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm'
netcdf/lib/pkgconfig/netcdf.pc:Libs: -L${libdir} -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/hdf5/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/z
std/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zlib/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm
netcdf/lib/pkgconfig/netcdf.pc:Libs.private: -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm
netcdf/lib/libnetcdff.la:dependency_libs=' -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/hdf5/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/netcdf/
lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zstd/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zlib/lib /collab1/data/Dusan.Jovic/sufs/simple
-ufs/libs/ufslibs/install/netcdf/lib/libnetcdf.la -lstdc++ -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm'
netcdf/bin/nc-config:libs="-L${libdir} -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/hdf5/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zstd/lib -L
/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zlib/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm"
netcdf/bin/nc-config:libsprivate="-lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm"

I do not see '-ldisable-curl' or '-disable-libcurl' option. I am using '-disable-dap' among other options, like '-enable-netcdf-4' etc and i thought that disabling dap will disable libcurl. Is there any other option I need to specify to remove dependency on libcurl.

So we need a way to build without lcurl, even if curl is present.

@akrherz
Copy link

akrherz commented Sep 11, 2024

Is this fixed by #2907 ?

@WardF
Copy link
Member

WardF commented Sep 11, 2024

It should be; if you check v4.9.3-rc1 and see it is still happening, let me know, otherwise this should be fixed. I'll also go take another look just to make sure.

@WardF WardF self-assigned this Sep 11, 2024
@edwardhartnett
Copy link
Contributor Author

edwardhartnett commented Sep 11, 2024

Ok, I compiled 4.9.3.-rc1, and I still see -lcurl in netcdf.pc

[Dusan.Jovic@nfe04 netcdf]$ cat lib/pkgconfig/netcdf.pc
prefix=/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/netcdf
exec_prefix=${prefix}
libdir=/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/netcdf/lib
includedir=${prefix}/include
ccompiler=/apps/spack-2024-08-26/linux-rocky9-x86_64/oneapi-2024.2.0/intel-oneapi-mpi-2021.13.1-xlclnymo5yndi44r7a7ekefsiym72jyl/mpi/2021.13/bin/mpiicx

Name: netcdf-c
Description: NetCDF Client Library for C
URL: https://www.unidata.ucar.edu/netcdf
Version: 4.9.3-rc1
Libs: -L${libdir} -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/hdf5/lib -L/collab1/data/Dusan.Jovic/sufs/simple-ufs/libs/ufslibs/install/zstd/lib -L/collab1/data/Dusan.J
ovic/sufs/simple-ufs/libs/ufslibs/install/zlib/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm
Libs.private: -lm -lcurl -lhdf5_hl -lhdf5 -lzstd -lz -lm
Cflags: -I${includedir}

In the PR mentioned in your issue (#2907) I see they fixed only cmake not configure.

@WardF
Copy link
Member

WardF commented Sep 11, 2024

Thanks, taking a look at this in autoconf-based builds now.

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

Successfully merging a pull request may close this issue.

3 participants