Skip to content

Commit

Permalink
Readd tweaked hack to remove GLIBC_PRIVATE symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jan 7, 2025
1 parent 8bf7c5e commit 7e2732c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 6 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,18 @@ jobs:
export CC=gcc-10 ; export CXX=g++-10; export CUDAHOSTCXX=$CXX; export CUDACXX=/usr/local/cuda/bin/nvcc;
LIBGOMP=/usr/lib/gcc/x86_64-linux-gnu/10;
/usr/local/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DHAVE_TESTS=1 -DENABLE_WERROR=1 -DHAVE_AVX2=1 \
-DOpenMP_C_FLAGS="-fopenmp -I${LIBGOMP}" -DOpenMP_C_LIB_NAMES=gomp -DOpenMP_CXX_FLAGS="-fopenmp -I${LIBGOMP}" -DOpenMP_CXX_LIB_NAMES=gomp -DOpenMP_gomp_LIBRARY=${LIBGOMP}/libgomp.a \
-DFORCE_STATIC_DEPS=1 -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" ..
cmake --build . -j$(nproc --all)
cmake --build . -j$(nproc --all) -v
# fail if GLIBC_PRIVATE or too new GLIBC is present
readelf -Ws src/mmseqs
readelf -V src/mmseqs
if readelf -Ws src/mmseqs | grep -q GLIBC_PRIVATE; then
readelf -Ws src/mmseqs
readelf -V src/mmseqs
# exit 1
exit 1
fi
LIBC_V=$(readelf -V src/mmseqs | awk '$3 ~ /^GLIBC_/ { print $3 }' | sort -V | tail -n1)
if [[ "$LIBC_V" > "GLIBC_2.29" ]]; then
readelf -Ws src/mmseqs
readelf -V src/mmseqs
# exit 1
exit 1
fi
displayName: Build MMseqs2
- task: PublishPipelineArtifact@0
Expand Down
16 changes: 15 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,21 @@ endif ()
if (ENABLE_CUDA)
find_package(CUDAToolkit REQUIRED)
target_compile_definitions(mmseqs-framework PUBLIC -DHAVE_CUDA=1)
target_link_libraries(mmseqs-framework marv CUDA::cudart_static)
target_link_libraries(mmseqs-framework marv)
if (FORCE_STATIC_DEPS)
# link to rt explicitly so it doesn't get statically compiled and adds GLIBC_PRIVATE symbols
target_link_libraries(mmseqs-framework rt)
# remove librt.a which introduces GLIBC_PRIVATE symbols
get_property(linked_libraries TARGET CUDA::cudart_static_deps PROPERTY INTERFACE_LINK_LIBRARIES)
set(FILTERED_LIBRARIES "")
foreach (LIB ${linked_libraries})
if (NOT LIB MATCHES ".*librt\\.a$")
list(APPEND FILTERED_LIBRARIES ${LIB})
endif ()
endforeach ()
set_target_properties(CUDA::cudart_static_deps PROPERTIES INTERFACE_LINK_LIBRARIES "${FILTERED_LIBRARIES}")
endif ()
target_link_libraries(mmseqs-framework CUDA::cudart_static)
endif ()

if (NOT FRAMEWORK_ONLY)
Expand Down

0 comments on commit 7e2732c

Please sign in to comment.