I’ve written and run a cuda 6.5 program which runs fine through visual studio on windows but I’m having grief trying to compile it on a remote Linux system (using nvcc).
I’ve gotten simple cuda programs to compile and execute on the remote linux server - as well as simple c++ programs. That said, I’ve been unable to compile my actual cuda program which uses several classes I defined in seperate .cpp files.
My program consists of a kernel.cu file and 3 .cpp files. The kernel.cu file contains the main function and all the program’s gpu run functions. The 3 .cpp files (each with an accompanying .h file) contain classes with strictly cpu functions which are used in kernel.cu’s main function.
My current attempt at compiling on linux has been to try compile the .cpp dependancies beforehand then link the comiled objects while compiling my cuda file:
#PBS -N NVCCCOMPILERESULTS
#PBS -l nodes=1:ppn=1
#PBS -q medium
#PBS -l walltime=00:10:00,host=n16.core.wits.ac.za
g++ -c -o ESBTL_Invoker.o ESBTL_Invoker.cpp ESBTL_Invoker.h -I /home/jselvan/ESBTL-1.0-beta01/include/
g++ -c -o cpuArrayManipulationFunctions.o cpuArrayManipulationFunctions.cpp cpuArrayManipulationFunctions.h
g++ -c -o kdTreeFunctions.o kdTreeFunctions.cpp kdTreeFunctions.h
module load nvidia
nvcc -o GPUExecutable.out kernel.cu kdTreeFuntions.o cpuArrayManipulationFunctions.o ESBTL_Invoker.o
To which I get the error message :
nvlink fatal : Could not open input file ‘kdTreeFuntions.o’
removing kdTreeFunctions.o from the nvcc compile line results in the error:
nvlink fatal : Could not open input file ‘cpuArrayManipulationFunctions.o’
I haven’t really used linux for anything major before this so any input or links on how to compile this thing on linux would be greatly appreciated.