[CMake] CUDA Build problems

James Bigler jamesbigler at gmail.com
Fri Mar 26 17:08:20 EDT 2010


Is this linux or mac?  I know with 10.6 Apple changed the default build from
32 to 64 bits, but the 3.0 CUDA runtime (which most of use) only supports 32
bit builds.  Start off with an empty build directory and set the following
environment variables:

      CFLAGS=-m32
      CXXFLAGS=-m32

Also try running 'make VERBOSE=1' to get the full command being used to
compile your code.

You should also try and see if this error has appeared on the NVIDIA
developer forum.

James

On Fri, Mar 26, 2010 at 12:57 PM, James C. Sutherland <
James.Sutherland at utah.edu> wrote:

> I am trying to use CMake to build a very simple CUDA program.  I am seeing
> the following errors when I try to build:
>
> > /usr/include/c++/4.2.1/new(95): error: first parameter of allocation
> function must be of type "size_t"
> > /usr/include/c++/4.2.1/new(96): error: first parameter of allocation
> function must be of type "size_t"
> > /usr/include/c++/4.2.1/new(99): error: first parameter of allocation
> function must be of type "size_t"
> > /usr/include/c++/4.2.1/new(100): error: first parameter of allocation
> function must be of type "size_t"
> > /usr/include/c++/4.2.1/new(105): error: first parameter of allocation
> function must be of type "size_t"
> > /usr/include/c++/4.2.1/new(106): error: first parameter of allocation
> function must be of type "size_t"
> >
> > 6 errors detected in the compilation of
> "/tmp/tmpxft_0000284b_00000000-4_device.cpp1.ii".
> > CMake Error at CMakeFiles/test_generated_device.cu.o.cmake:235 (message):
> >   Error generating file
> >
> /Users/u0033394/Downloads/examples/cpp_integration/build/./test_generated_device.cu.o
>
> Any ideas on what would be causing this?
>
> My CMakeLists.txt file looks like:
>
> > cmake_minimum_required(VERSION 2.6)
> > project( JCSCudaTest CXX )
> >
> > find_package(CUDA)
> >
> > cuda_add_executable(test
> >   device.cu
> >   host.cpp
> >   )
>
>
> James
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100326/0b7624b3/attachment.htm>


More information about the CMake mailing list