Cuda compiler not working with GCC 4.5 +
Doing some research online shows several methods for accomplishing this task. I just tested the method found here: http://www.vectorfabrics.com/blog/item/cuda_4.0_on_ubuntu_11.04 and it worked like a charm for me. It steps you through installing gcc 4.4 and creating scripts to run that version with nvcc. If you prefer trying the method mentioned in your post I'd recommend following that first link to install gcc4.4 and then create symbolic links as mentioned in your post. Creating symbolic links in Linux is accomplished by using the 'ln' command.
For example:
ln -s [source file/folder path] [linkpath]
This link gives a few examples of creating symbolic links on both Ubuntu and Windows: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/. Hopefully that points you in the right direction.
CUDA incompatible with my gcc version
As already pointed out, nvcc depends on gcc 4.4. It is possible to configure nvcc to use the correct version of gcc without passing any compiler parameters by adding softlinks to the bin directory created with the nvcc install.
The default cuda binary directory (the installation default) is /usr/local/cuda/bin, adding a softlink to the correct version of gcc from this directory is sufficient:
sudo ln -s /usr/bin/gcc-4.4 /usr/local/cuda/bin/gcc
CUDA 5.0 on a Slackware64 current with gcc 4.7
The steps used to get this working were:
- Install gcc-4.4.7 to a different location
- Install CUDA 5.0 to it's default location
- Install Samples and SDK to your home directory
- Add gcc-4.4.7 to your path (overwrite gcc-4.7.1)
- Add LD_LIBRARY_PATH to your path
- Add nvcc (/usr/local/cuda-5.0/bin) to your path
- Compile (make) samples
Cuda Clang and OS X Mavericks
The issue with 10.9 is that gcc
is actually clang. Please try latest CUDA toolkit and explicitely point NVCC to use /usr/bin/clang (nvcc -ccbin /usr/bin/clang). This way NVCC will know it's dealing with clang.
CMAKE_CUDA_COMPILER flag is false despite cuda being found
Okay, I found the issue. Every CUDA version only supports a specific gcc version. Compatibility can be found here: https://stackoverflow.com/a/46380601/9299366
After installation of CUDA at some point I changed my default gcc version resulting in this odd behaviour of cmake not being able to detect cuda despite nvcc and nvidia-smi properly working. I purged CUDA and the Nvidia driver completely, set a valid gcc version and reinstalled CUDA + driver. It seems to be working fine now.
Related Topics
Elf Header or Installation Issue with Bcrypt in Docker Container
Using Bash Environment Variables from Within a Perl Script
How to Fix "Go Not Root Owned"
Execute Script as Another User Whilst Not Being Root
Linux, Where Are the Return Codes Stored of System Daemons and Other Processes
How to Get Sudo Access for a File Inside the Vi Text Editor
How to Check in Bash Whether a File Was Created More Than X Time Ago
Need Explanations for Linux Bash Builtin Exec Command Behavior
How to Pass a File Argument to My Bash Script Using a Terminal Command in Linux
Delete a Column from a Delimited File in Linux
Gcc: Putchar(Char) in Inline Assembly
Linux: Modpost Does Not Build Anything
Overwrite Input File Using Awk
Sed Returns "Sed: Command Garbled"
Unix - Count of Columns in File
Linux Shell to Restrict Sftp Users to Their Home Directories