FindCUDA.cmake

For more information about CMake and Cuda:
There are basically 3 versions of the script. See below for details.

NOTE: The source code is hosted at a new svn server (but the old code.sci.utah.edu server name should alias to the new one) :
https://gforge.sci.utah.edu/svn/findcuda/trunk

This web page contains information about an unofficial version of the FindCuda.cmake script developed to compile CUDA programs. Many individuals have adopted the script and suggested improvements, and tested the script on various platforms and configurations. We appreciate all of the feedback and bug fixes we have received since the initial release.

This webpage is updated infrequently- the svn log contains details about bug fixes and updates.

Please send any comments or questions by email. If you use the NVIDIA forums, we might not see you question for some time.

James Bigler
sorry spam bots
NVIDIA Research

Abe Stephens
Scientific Computing and Imaging Institute, University of Utah.

Features

Source Code:

Trunk

Again many changes have come been implemented. Some of the changes have been done in preparation of the code moving into the CMake distribution. The trunk is in a state of flux, but should work barring any unknown bugs.

It is necessary to make several changes to a project's CMakeLists.txt files in order to use the new version.

Get the code

svn co https://gforge.sci.utah.edu/svn/findcuda/trunk FindCUDA

Changes

2.0

We released a major revision to the script in December 2008 at approximately the same time as the CUDA 2.1 beta. There are many differences in the new version of the script and it has been tested extensively on Linux, Mac, and WinXP/Vista.

It is necessary to make several changes to a project's CMakeLists.txt files in order to use the new version.

The code is available in an svn repository:

svn co https://gforge.sci.utah.edu/svn/findcuda/tags/2.0 FindCUDA

List of partial changes

Major bug fixes

Notes:


1.0

You can get the original version of the script by doing
svn co https://code.sci.utah.edu/svn/findcuda/tags/1.0 FindCUDA

Usage:

The script will search for your cuda toolkit and SDK installation using several standard paths and the environment variables which are created by the installer.

The following example includes the script and shows how to add code in an executable. The CUDA_ADD_* commands have the same semantics as the standard ADD_* commands.

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/cuda" ${CMAKE_MODULE_PATH})
FIND_PACKAGE(CUDA)

CUDA_ADD_EXECUTABLE(test
  test_bin.cu
  main.cc
  )

See additional usage in the example project.

License

For more information, please see: http://software.sci.utah.edu

The MIT License

Copyright (c) 2008-2009
NVIDIA Corp.

Copyright (c) 2007-2009
Scientific Computing and Imaging Institute, University of Utah

License for the specific language governing rights and limitations under
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.