# Cuda and Gcc

**URL:** <https://forums.developer.nvidia.com/t/cuda-and-gcc/31607>\
**Category:** CUDA Programming and Performance\
**Created:** [December 3, 2013, 12:44am UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607 "2013-12-03T00:44:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FiReTITi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@FiReTITi](https://forums.developer.nvidia.com/u/FiReTITi)\
**Post date:** [December 3, 2013, 12:44am UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/1 "2013-12-03T00:44:45Z")

</div>

Hi all,

I am a beginner with Cuda, so I am trying to run an example.  
But when I try to compile the cuda file, I have this error:

```auto
nvcc -c *.cu -I. -I/Developer/NVIDIA/CUDA-5.0/include/

In file included from /Developer/NVIDIA/CUDA-5.0/include/cuda_runtime.h:59:0,
                 from <command-line>:0:
/Developer/NVIDIA/CUDA-5.0/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.7 and up are not supported!
kernel_code.cu:9:26: fatal error: cutil_inline.h: No such file or directory
compilation terminated.

```

It seems that gcc 4.7 and upper are not supported.  
Is that normal?  
If yes, what is the most recent version supported?

Regards,

---

<div class="post-metadata">

**Author:** ![seibert](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/seibert/32/520688_2.png) [@seibert](https://forums.developer.nvidia.com/u/seibert)\
**Post date:** [December 3, 2013, 2:35am UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/2 "2013-12-03T02:35:05Z")

</div>

The CUDA toolkit usually is designed to work with whatever the standard compiler is for each supported Linux distribution. What Linux distribution are you using?

---

<div class="post-metadata">

**Author:** ![njuffa](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@njuffa](https://forums.developer.nvidia.com/u/njuffa)\
**Post date:** [December 3, 2013, 10:04am UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/3 "2013-12-03T10:04:02Z")

</div>

The problem could also be the use of CUDA 5.0 instead of CUDA 5.5. The release notes for CUDA 5.5 show support for gcc 4.7 on several common Linux platforms:

[url][Release Notes :: CUDA Toolkit Documentation](http://docs.nvidia.com/cuda/cuda-toolkit-release-notes/#linux-5-5%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![FiReTITi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@FiReTITi](https://forums.developer.nvidia.com/u/FiReTITi)\
**Post date:** [December 3, 2013, 5:59pm UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/4 "2013-12-03T17:59:45Z")

</div>

Hi,  
thank you both for your answers.

- I work on Mac OS X 10.9, not linux :s

- I don’t understand why I still work on Cuda 5.0, because yesterday I downloaded and installed the last version, but I don’t see any trace of Cuda 5.5 in my laptop :s

---

<div class="post-metadata">

**Author:** ![FiReTITi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@FiReTITi](https://forums.developer.nvidia.com/u/FiReTITi)\
**Post date:** [December 3, 2013, 6:26pm UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/5 "2013-12-03T18:26:19Z")

</div>

I dont know why, but the Cuda 5.5 version was completely hidden and not found by the command line “locate”.  
So now it compiles correctly.  
Thank you.

---

<div class="post-metadata">

**Author:** ![eugeneo](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@eugeneo](https://forums.developer.nvidia.com/u/eugeneo)\
**Post date:** [December 4, 2013, 4:41pm UTC](https://forums.developer.nvidia.com/t/cuda-and-gcc/31607/6 "2013-12-04T16:41:00Z")

</div>

On Mac OS X 10.9, NVCC needs Clang that comes with Xcode. Only the latest CUDA Toolkit 5.5 works with Mac OS X 10.9.
