Here is my Quickstart for the plugin
Assumptions:
- A fully functional C/C++ working environment (within the Eclipse IDE and on the command line)
- A fully functional CUDA environment (including the CUDA Driver, Toolkit, and SDK
- This assumes you are using OS X (Linux should be quite similar)
- Help --> Install New Software -->
- Name =
( for me) - Location = http://www.ai3.inf.uni-bayreuth.de/software/eclipsecudaqt/updates
- Click on Uncategorized --> Toolchains for CUDA and QT Development
- Accept the License Agreement
- Restart Eclipse
- Go to Eclipse --> Preferences
- Click on C/C++ --> Environment
- Under Environment variables to set --> click Add
- Name = PATH (Note: Make sure PATH are all upper case)
- Value = /usr/local/cuda/bin
- Apply and OK
- Ctrl + mouse click --> New --> C++ project
- Under Project type box --> Executable --> select Empty Project
- Name your project
- Uncheck the following: Show project types and toolchains only if they are supported on the platform
- Under Toolchains --> select CUDA Toolchain
- Click Next
- Click on Advanced Settings
- Under C/C++ Build -->Environment --> Confirm PATH is set from previous step (should be USER: PREFS under Origin Column)
- Under C/C++ Build --> Settings --> Tool Settings Tab --> CUDA NVCC Compiler --> Includes --> add /usr/local/cuda/include
- Under C/C++ Build --> C++ Linker --> change Command from g++ to nvcc
- Under C/C++ Build --> C++ Linker --> Libraries --> add cudart to Libraries (-l) and add /usr/local/cuda/lib to Library search path (-L)
- Apply and OK
*** UPDATE ***
When attempting to build my project, I was getting the following error message during the build phase:
make all
Building target: CUDAToolchainProject
ld: unknown option: -oCUDAToolchainProject
I tracked the problem down to not having "whitespaces" in between the following:
- ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT}
- This is located at -->
--> Properties --> C/C++ Build --> Settings --> C++ Linker - Under Expert Settings --> Command line pattern
- ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}
Invoking: C++ Linker
g++ -L/usr/local/cuda/lib -o "CUDAToolchainProject" ./src/cu_mandelbrotCUDA_D.o ./src/cu_mandelbrotCUDA_H.o -lcudart
ld: warning: in ./src/cu_mandelbrotCUDA_D.o, file is not of required architecture
ld: warning: in ./src/cu_mandelbrotCUDA_H.o, file is not of required architecture
ld: warning: in /usr/local/cuda/lib/libcudart.dylib, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [CUDAToolchainProject] Error 1
To mitigate this problem ... I changed the C++ Linker from g++ to nvcc
- Properties --> C/C++ Build --> Settings --> C++ Linker
- Command --> change from g++ to nvcc
The build phase completed successfully and an executable was generated!
The next steps are optional (If you want to follow Eclipse's general project structure, follow the next steps
4. Create Source Folders (Trivial)
- Ctrl + mouse click --> New --> Source Folder
- Name your folder
Resources
1. Bayreuth University Website
- http://www.ai3.inf.uni-bayreuth.de/software/eclipsecudaqt/updates
- http://forums.nvidia.com/index.php?showtopic=160564
- http://lifeofaprogrammergeek.blogspot.com/2008/07/using-eclipse-for-cuda-development.html
