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

undefined reference due to --no-allow-shlib-undefined: H5get_libversion #538

Open
yurivict opened this issue Oct 31, 2024 · 1 comment
Open
Assignees
Labels
dependencies Pull requests that update a dependency file exodus ioss

Comments

@yurivict
Copy link

yurivict commented Oct 31, 2024

When cmake is called with:

-DCMAKE_C_COMPILER:STRING="cc"  
-DCMAKE_CXX_COMPILER:STRING="c++"  
-DCMAKE_C_FLAGS:STRING="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing "  
-DCMAKE_C_FLAGS_DEBUG:STRING="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing "  
-DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  
-DNDEBUG"  
-DCMAKE_CXX_FLAGS:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include "  
-DCMAKE_CXX_FLAGS_DEBUG:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include "  
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  
-DNDEBUG"  
-DCMAKE_EXE_LINKER_FLAGS:STRING=" -Wl,-rpath=/usr/local/lib/gcc13  -L/usr/local/lib/gcc13 -fstack-protector-strong -L/usr/local/lib " 
 -DCMAKE_MODULE_LINKER_FLAGS:STRING=" -Wl,-rpath=/usr/local/lib/gcc13  -L/usr/local/lib/gcc13 -fstack-protector-strong -L/usr/local/lib "  
-DCMAKE_SHARED_LINKER_FLAGS:STRING=" -Wl,-rpath=/usr/local/lib/gcc13  -L/usr/local/lib/gcc13 -fstack-protector-strong -L/usr/local/lib "  
-DCMAKE_INSTALL_PREFIX:PATH="/usr/local"  
-DCMAKE_AUTOGEN_PARALLEL:STRING="7"  
-DCMAKE_BUILD_TYPE:STRING="Release"  
-DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES  
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES  
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON  
-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON 
-DSeacas_ENABLE_ALL_PACKAGES:BOOL=ON 
-DSeacas_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON 
-DSeacas_ENABLE_SECONDARY_TESTED_CODE:BOOL=ON 
-DBUILD_SHARED_LIBS:BOOL=ON 
-DPython_ADDITIONAL_VERSIONS=3.11 
-DPython_EXECUTABLE:FILEPATH="/usr/local/bin/python3.11" 
-DPython3_EXECUTABLE:FILEPATH="/usr/local/bin/python3.11" 
-DBOOST_PYTHON_SUFFIX:STRING=311

the build fails due to missing -lhdf5:

cd /usr/ports/science/seacas/work/.build/packages/seacas/applications/epu && /usr/local/libexec/ccache/c++ -DFMT_SHARED -I/usr/ports/science/seacas/work/.build -I/usr/ports/science/seacas/work/seacas-2024-08-15/packages/seacas/applications/epu -I/usr/ports/science/seacas/work/seacas-2024-08-15/packages/seacas/libraries/exodus/include -I/usr/ports/science/seacas/work/.build/packages/seacas/libraries/exodus -I/usr/ports/science/seacas/work/seacas-2024-08-15/packages/seacas/libraries/suplib_c -I/usr/ports/science/seacas/work/seacas-2024-08-15/packages/seacas/libraries/suplib_cpp -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -std=c++17 -MD -MT packages/seacas/applications/epu/CMakeFiles/epu.dir/EP_ParallelDisks.C.o -MF CMakeFiles/epu.dir/EP_ParallelDisks.C.o.d -o CMakeFiles/epu.dir/EP_ParallelDisks.C.o -c /usr/ports/science/seacas/work/seacas-2024-08-15/packages/seacas/applications/epu/EP_ParallelDisks.C
--- packages/seacas/applications/conjoin/CMakeFiles/conjoin.dir/all ---
ld: error: undefined reference due to --no-allow-shlib-undefined: H5get_libversion

Adding -lhdf5 solves this problem.

Version: 2024-08-15
clang-18
FreeBSD 14.1

@gsjaardema
Copy link
Member

gsjaardema commented Nov 18, 2024

The -lhdf5 should already be being added by the netCDF shared library dependency. Not sure why that is somehow getting lost...

During the cmake configuration, it should show that it has found the netCDF library and show whether it depends on hdf5 and it then adds the dependency at that point.

If that is not what is happening, then you can send the output from the CMake configuration and we can see what it shows related to hdf5.

@gsjaardema gsjaardema self-assigned this Nov 18, 2024
@gsjaardema gsjaardema added exodus ioss dependencies Pull requests that update a dependency file labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file exodus ioss
Projects
None yet
Development

No branches or pull requests

2 participants