Closed rcasero closed 12 years ago
Ramon,
The changes I've made in master should fix the duplicate declarations.
One thing I did differently from what you did was instead of having
SET(CUDA_NVCC_FLAGS --compiler-bindir ${path/to/old/gcc/dir})
I set the directory of my path/to/old/gcc/dir within ccmake directly. To get it to work properly, I had to quote the space between the "--compiler-bindir" and the path, so that it read
--compiler-bindir" "/path/to/old/gcc/dir
If you don't quote the middle space, CMake will quote the entire string, and nvcc apparently does not like that. This might be a bug in the FindCUDA.cmake module in CMake. I'm going to look into it a little further, and if it is, I'll report it on the CMake bug tracker.
Cory
Hi Cory,
In my case, I have all my gcc versions in the same directory, /usr/bin, which is the default in Ubuntu, if I remember well, Debian, and probably other linux distributions. So the --compiler-bindir solution is actually a bit messy. I have a better way now, which is to say in the root CMakeLists.txt of Gerardus
http://code.google.com/p/gerardus/source/browse/trunk/CMakeLists.txt
IF(BUILD_WITH_CUDA) SET(CMAKE_C_COMPILER gcc-4.4) SET(CMAKE_CXX_COMPILER g++-4.4) ENDIF(BUILD_WITH_CUDA)
Then, in the CMakleLists.txt of Clarity you can have
IF(BUILD_WITH_CUDA)
FIND_PACKAGE(CUDA) IF(CMAKE_COMPILER_IS_GNUCC)
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
IF(GCC_VERSION VERSION_LESS 4.5)
# ramc: CUDA v4.0 RC2 is incompatible with gcc >= 4.5. Gcc
# 4.4. is selected in the root gerardus CMakeLists.txt, but this
# flag needs to be set by hand, because otherwise nvcc will read
# the version of the default gcc in the system, that is v4.5
SET(CUDA_NVCC_FLAGS "-D__GNUC_MINOR__=4")
ENDIF(GCC_VERSION VERSION_LESS 4.5)
ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(BUILD_WITH_CUDA)
Cheers,
Ramon.
Hi,
I have tried to compile Clarity v1.0.0 in Ubuntu 11.10 using CUDA. The first problem was with CUDA requiring gcc v4.4 or older, while Ubuntu 11.10 ships gcc v4.6.1.
This problem can be solved by stating in the CMakeLists.txt that nvcc should look in another directory for the compilers
and adding soft links in the directory, e.g.
The build fails for me at linking time. I get errors of duplicated symbols. I think that the problem is e.g. with
WienerDeconvolveGPU.cu
, andWienerDeconvolve.cxx
, that includeComplex.h
andComplexCUDA.h
, and these declare functions with the same identifier.Best regards,
Ramon.