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

[QST] Building fails with gcc_impl_linux-64 7.3.0 unless additional link flags added #315

Closed
gmarkall opened this issue Feb 28, 2020 · 2 comments
Labels
? - Needs Triage Need team to review and classify question Further information is requested

Comments

@gmarkall
Copy link
Contributor

I tried building the latest revision of RMM (bee60d2) using the gcc_impl_linux-64 7.3.0 compiler on Ubuntu 16.04. Building failed with:

# Running cmake goes ok:
$ cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
# <output snipped>

# Building does not:
$ make
Scanning dependencies of target rmm 
[  5%] Building CXX object CMakeFiles/rmm.dir/src/rmm.cpp.o
[ 11%] Building CXX object CMakeFiles/rmm.dir/src/device_buffer.cpp.o
[ 17%] Building CXX object CMakeFiles/rmm.dir/src/memory_manager.cpp.o
[ 23%] Building CXX object CMakeFiles/rmm.dir/thirdparty/cnmem/src/cnmem.cpp.o
[ 29%] Building CXX object CMakeFiles/rmm.dir/src/mr/default_memory_resource.cpp.o
[ 35%] Linking CXX shared library librmm.so
[ 35%] Built target rmm 
Scanning dependencies of target RMM_TEST
[ 41%] Building CXX object tests/CMakeFiles/RMM_TEST.dir/memory_tests.cpp.o
[ 47%] Linking CXX executable ../gtests/RMM_TEST
/home/nfs/gmarkall/miniconda3/envs/numbaenv/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /home/nfs/gmarkall/miniconda3/envs/numbaenv/bin/../x86_64-conda_cos6-linux-gnu/sysroot/lib/librt.so.1: undefined reference to `__vdso_clock_gettime@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/RMM_TEST.dir/build.make:86: gtests/RMM_TEST] Error 1
make[1]: *** [CMakeFiles/Makefile2:943: tests/CMakeFiles/RMM_TEST.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

I found that adding some extra libraries as per a similar issue in another package (Quansight/pearu-sandbox#6) resolved the issue:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b895024..f68b3e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     endif(CMAKE_CXX11_ABI)
 endif(CMAKE_COMPILER_IS_GNUCXX)
 
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt -lpthread -lresolv")
+
 option(BUILD_TESTS "Configure CMake to build tests"
        ON)

After adding this, building proceeds fine and all C++ tests pass.

I'm not sure if there's something not quite right about my setup or whether those libraries should have been added to the link line in general for RMM. Any pointers on whether I should look for an issue in my system, or submit a PR with the change?

@gmarkall gmarkall added ? - Needs Triage Need team to review and classify question Further information is requested labels Feb 28, 2020
@harrism
Copy link
Member

harrism commented Aug 4, 2020

First time I noticed this issue, sorry. @gmarkall is this a problem with latest?

@gmarkall
Copy link
Contributor Author

gmarkall commented Aug 4, 2020

The issue appears to have disappeared in the latest branch-0.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants