4

I have a CUDA project which I compile with cmake. It worked fine until I wanted to add a new class containing a device function described in new files (.cu and .cuh). This is the CMakeList file :

project(SINS)

cmake_minimum_required(VERSION 2.8)

# CUDA
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "./")

find_package(CUDA) # This command includes a lot of new stuff, see FindCUDA.cmake for details

include_directories(${CUDA_INCLUDE_DIRS}/include)

set(CUDA_LIBRARIES ${CUDA_LIBRARIES} "$ENV{CUDA_BIN_PATH}/lib64/libcurand.so")

[find ODEINT stuff]

include_directories(${PROJECT_SOURCE_DIR}/code/src)
include_directories(${PROJECT_SOURCE_DIR}/code/include)

set(SINS_SRC
    code/src/SINS_constants.cu
    code/src/SINS_IOManager.cu
    code/src/SINS_statistics.cu
    code/src/SINS_bufferGas.cu
)

set(SINS_HEADER
    code/include/SINS_constants.cuh
    code/include/SINS_IOManager.cuh
    code/include/SINS_statistics.cuh
    code/include/SINS_ODEINT.cuh
    code/include/SINS_bufferGas.cuh
)

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU")

# Compile application
CUDA_ADD_EXECUTABLE(SINS code/SINS_core.cu ${SINS_SRC} ${SINS_HEADER})

# Link it to CUDA
target_link_libraries(SINS ${CUDA_LIBRARIES})

In SINS_ODEINT.cuh :

#include "SINS_bufferGas.cuh"

struct motion_system
{   
    struct motion_functor
    {
        void operator()(T zippedStates) const
        {
            [...]
            SINS_bufferGas::doTheRobot(y);
            [...]
        }
    };
}

In SINS_bufferGas.cuh :

#ifndef SINS_bufferGas_H
#define SINS_bufferGas_H

#include "SINS_constants.cuh"

class SINS_bufferGas
{
    public:
        __host__ __device__ static void doTheRobot(value_type &x);
};

#endif

in SINS_bufferGas.cu :

#include "SINS_bufferGas.cuh"
__host__ __device__ void SINS_bufferGas::doTheRobot(value_type &x) {x = -666.666;}

The compilation yields :

ptxas fatal   : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'

I tried adding -dc in the CUDA_NVCC_FLAGS, setting on the variable CUDA_SEPARABLE_COMPILATION coming from FindCUDA.cmake, multiple combinations of what is suggested in this post, trying to understand what is here (no cmake) to no avail...

I am using CUDA 5.0, have access to 2.0 compute capability and cmake 2.8.7 - I would really appreciate an explanation of what is going on and how I can fix it nicely. Thank you for any advice.

EDIT : Added informations asked by David Kernin.

CMake output :

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done

~~~ CUDA ~~~
CUDA_BIN_PATH set to /usr/local/cuda-5.0.
-- Found CUDA: /usr/local/cuda-5.0 (found version "5.0")

~~~ ODEINT ~~~
ODEINT_PATH environment variable found and set to : /a/given/path/software/odeint

~~~ ROOT ~~~
-- Found ROOT 5.34/01 in /opt/cern/root/root_v5.34.01

~~~ Host or device ? ~~~
Simulation will be computed on GPUs.
-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU

~~~ Double or short precision ? ~~~
Double precision will be used.

~~~ Stepper ? ~~~
Fixed controlled step size will be used.

~~~ Electric field ? ~~~
Trapping field ON

~~~ Space charge ? ~~~
Space charge OFF

~~~ Buffer gas ? ~~~
Buffer gas cooling ON (EXPERIMENTAL)

-- Configuring done
-- Generating done
-- Build files have been written to: /a/path/workdir

And the full output of make :

/usr/bin/cmake -H/data/pieges/fabian/SINS -B/data/pieges/fabian/SINS/workdir --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /data/pieges/fabian/SINS/workdir/CMakeFiles /data/pieges/fabian/SINS/workdir/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »
make -f CMakeFiles/SINS.dir/build.make CMakeFiles/SINS.dir/depend
make[2]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 5
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 1
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 2
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 3
/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 4
[ 40%] [ 80%] [100%] [100%] [100%] Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
Building NVCC (Device) object CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/.
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.cmake
cd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.cmake
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_constants.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/SINS_core.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend
-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_constants.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend
/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend
-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/SINS_core.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\"-g\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o successfully.
Generated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o successfully.
/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable "collisionTable" is used before its value is set

/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable "dummy" was set but never used

/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma

/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma

/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable "collisionTable" is used before its value is set

/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable "dummy" was set but never used

ptxas fatal   : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'
-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o
CMake Error at SINS_generated_SINS_core.cu.o.cmake:256 (message):
  Error generating file
  /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o


make[2]: *** [CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o] Erreur 1
make[2]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »
make[1]: *** [CMakeFiles/SINS.dir/all] Erreur 2
make[1]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »
make: *** [all] Erreur 2
Community
  • 1
  • 1
Mortuis
  • 51
  • 5
  • add the cmake and makefile verbose flag (http://www.cmake.org/Wiki/CMake_FAQ#Is_there_an_option_to_produce_more_.27verbose.27_compiling.3F) and post the log – Marco A. Feb 18 '14 at 16:51
  • Can you also post the content of SINS_core.cu ? The function it's in there and might be declared differently – Marco A. Feb 18 '14 at 21:03
  • Sure, though I'm not sure this will help out (and it's too big :S) - because a lot of calls are hidden in the ODEINT/THRUST libraries. In essence, this gets declared : motion_system bunch(SINS_constants::NB_IONS); and then a call to the integrator is made : Nb_steps += integrate_adaptive(theStepper()), bunch, globalState,TIME_INIT,TIME_MAX,DT_OBS,streaming_observer()); – Mortuis Feb 19 '14 at 08:39
  • if that's too big you can use services like nopaste (http://nopaste.info/) – Marco A. Feb 19 '14 at 09:39
  • Nice, I didn't knew this site ! Here is the link : http://nopaste.info/7675765612.html – Mortuis Feb 19 '14 at 09:46
  • Okay for the relocatable option, but did you also try adding (http://stackoverflow.com/a/13890572/1938163) the library `-lcudadevrt` to the linking flags? – Marco A. Feb 19 '14 at 09:52
  • I am quite new to cmake and make compilation issues, so I am not sure of what you mean by adding -lcudadevrt to the linking flags. I tried two modifications : `set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-lcudadevrt;-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU")` and/or `set(CUDA_LIBRARIES ${CUDA_LIBRARIES} -lcudadevrt)`, knowing ${CUDA_LIBRARIES} is in the `target_link_libraries` command - still the same error. – Mortuis Feb 19 '14 at 10:16
  • so you tried with both "--relocatable-device-code true" for the compilation pass and "-lcudaevrt" for the linking pass? – Marco A. Feb 19 '14 at 10:26
  • Thanks ! Looks like I haven't tried this combination ! The compilation seems to reach the link point, but now the following error appears `/usr/bin/ld: cannot find -lcudadevrt`. There is only `libcudadevrt.a` in /usr/local/cuda-5.0/lib64/ ; I tried to do exactly as it is done with curand, but it doesn't work out, maybe because `libcurand.so` exists and there is no `libcudadevrt.so`... EDIT : I don't know if it changes anything, but `/usr/local/cuda-5.0/lib64` is in my `LD_LIBRARY_PATH`. – Mortuis Feb 19 '14 at 12:06
  • Ok, with the line `set(CUDA_LIBRARIES ${CUDA_LIBRARIES} -L/usr/local/cuda-5.0/lib64/ -lcudadevrt)`, one more step is done. Now I have errors `CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o: In function `__sti____cudaRegisterAll_44_tmpxft_00007ef2_00000000_6_SINS_core_cpp1_ii_08a00a9b': /tmp/tmpxft_00007ef2_00000000-3_SINS_core.cudafe1.stub.c:143: undefined reference to `__cudaRegisterLinkedBinary_44_tmpxft_00007ef2_00000000_6_SINS_core_cpp1_ii_08a00a9b'`... – Mortuis Feb 19 '14 at 12:41
  • I just realized the command `nm /usr/local/cuda-5.0/lib64/libcudadevrt.a` return contains ` U __cudaRegisterLinkedBinary_54_tmpxft_0000486c_00000000_6_cuda_device_runtime_cpp1_ii_53946984` - could my CUDA install be corrupted ? – Mortuis Feb 19 '14 at 13:43
  • perhaps a version mismatch (32 bit vs linking against 64 bit libraries) ? Is your project 64 too? – Marco A. Feb 19 '14 at 16:03
  • Everything should be 64 bits, I haven't worked with 32 bits for a while. How can I be sure of this ? – Mortuis Feb 19 '14 at 16:15
  • it seems everything is x64, that stuff must be related to something else.. can you try with CUDA5.5 perhaps? – Marco A. Feb 19 '14 at 18:04
  • Done, I thought that several code-separation bugs could be fixed in 5.5 since this feature seems to be new from 5.0 - still the same error. – Mortuis Feb 20 '14 at 09:09
  • I think it could be this: http://stackoverflow.com/a/11428570/1938163 i.e. the order in which CMake links stuff – Marco A. Feb 20 '14 at 09:29
  • I tried several combination of flag order, without success, even tried 32 bits stuff - still the same error. – Mortuis Feb 20 '14 at 13:38

0 Answers0