Dear all,
I’ve existing Eclipse project with already created SConstruct file. NSight is used, and I’m working on a Mac (10.8)
I need to make everything work with kernels I wrote.
What did I add in SCons file (Build call is “/usr/local/bin/scons -j4 UserCompiler=nvcc UserBuildMode=debug”):
cppFlags[“debugNVCC”] = [‘–verbose’, ‘-ccbin=/opt/local/bin/g++’, ‘–compiler-options=-Wall,-g3,-O0,-Wconversion,-ansi,-Wno-long-long,-pedantic,-Werror,-std=c++0x’]
//all compiler options have to be there - requirement of the project settings
[b]
linkFlags[“debugNVCC”] = [‘–compiler-bindir=/opt/local/bin/gcc’]
env = Environment()
if UserCompiler.lower() == “nvcc”:
env[‘CC’] = “/Developer/NVIDIA/CUDA-5.5/bin/nvcc”
env[‘CXX’] = “/Developer/NVIDIA/CUDA-5.5/bin/nvcc”
env[‘LINK’] = “/opt/local/bin/g++”
[/b]
But the build output shows a lot of errors of kind
error: ‘__syncthreads’ was not declared in this scope
error: ‘__ffs’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
(at the kernel call) error: expected primary-expression before ‘<’ token
etc.
So, mvcc actually makes nothing - and gcc, of course, cannot link all these libraries and functions.
There are no errors regarding blockIdx and threadIdx, because at the kernel files I’ve included:
#include </usr/local/cuda/include/cuda_runtime.h>
#include </usr/local/cuda/include/device_launch_parameters.h>
#include </usr/local/cuda/include/device_functions.h>
I found this scone tool: CudaTool · SCons/scons Wiki · GitHub but either I use it improperly, or it’s usage makes no effect.
Do anybody have ideas, how to set up CUDA in my SCons file properly?
Thanks in advance.