CMake weirdness LinuxPPC64 + NVCC
Created by: jjellio
I am running into some configuration weirdness on a Linux PPC64 system.
Calling cmake succeeds with no errors, but the link lines are 'bad'. For example (notice the long line of colons in the linker's rpath line):
[ 1%] Linking CXX shared library libkokkoscontainers.so cd /tmp/trilinos-build/packages/kokkos/containers/src && /home/projects/rhel/cmake/3.4.3/bin/cmake -E cmake_link_script CMakeFiles/kokkoscontainers.dir/link.txt --verbose=1 /home/projects/rhel/openmpi/1.10.2/gcc/4.9.2/cuda/7.5.7/bin/mpicxx -fPIC -pedantic -Wall -Wno-long-long -Wwrite-strings -lineinfo -Xcudafe --diag_suppress=conversion_function_not_usable -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=code_is_unreachable -std=c++11 -O3 -DNDEBUG -shared -Wl,-soname,libkokkoscontainers.so.12 -o libkokkoscontainers.so.12.9 CMakeFiles/kokkoscontainers.dir/impl/Kokkos_UnorderedMap_impl.cpp.o ../../core/src/libkokkoscore.so.12.9 /usr/lib64/libdl.so -Wl,-rpath,/tmp/trilinos-build/packages/kokkos/core/src::::::::::::::::::::::::::::::::::::::::::::::: nvcc fatal : Don't know what to do with '../../core/src/libkokkoscore.so.12.9'
Some searching leads to: https://cmake.org/pipermail/cmake/2011-June/044806.html
Configuring with CMAKE_NO_BUILTIN_CHRPATH=TRUE, eliminates the bad rpath line, but unveils another problem.
[ 1%] Linking CXX shared library libkokkoscontainers.so cd /tmp/trilinos-build/packages/kokkos/containers/src && /home/projects/rhel/cmake/3.4.3/bin/cmake -E cmake_link_script CMakeFiles/kokkoscontainers.dir/link.txt --verbose=1 /home/projects/rhel/openmpi/1.10.2/gcc/4.9.2/cuda/7.5.7/bin/mpicxx -fPIC -pedantic -Wall -Wno-long-long -Wwrite-strings -lineinfo -Xcudafe --diag_suppress=conversion_function_not_usable -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=code_is_unreachable -std=c++11 -O3 -DNDEBUG -shared -Wl,-soname,libkokkoscontainers.so.12 -o libkokkoscontainers.so.12.9 CMakeFiles/kokkoscontainers.dir/impl/Kokkos_UnorderedMap_impl.cpp.o ../../core/src/libkokkoscore.so.12.9 /usr/lib64/libdl.so -Wl,-rpath,/tmp/trilinos-build/packages/kokkos/core/src nvcc fatal : Don't know what to do with '../../core/src/libkokkoscore.so.12.9'
In this case, the shared object ../../core/src/libkokkoscore.so.12.9 is not being prepended with -Wl,-soname,
If I manually edit the linker line and add the linker option "-Wl,-soname," /tmp/trilinos-build/packages/kokkos/containers/src/CMakeFiles/kokkoscontainers.dir/link.txt
Then the compiler is able to link. This is not isolated to a single file though.
OS: jjellio@:/tmp/trilinos-build$ uname -a Linux 3.10.0-327.el7.ppc64le #1 SMP Thu Oct 29 17:31:13 EDT 2015 ppc64le ppc64le ppc64le GNU/Linux
My configuration out is attached.
@bartlettroscoe linux-ppc64-nvcc-cmake-badness.txt