cuda/nvcc using specific gcc version

894 views
Skip to first unread message

Chris Knorowski

unread,
Mar 21, 2012, 1:00:20 PM3/21/12
to hoomd...@googlegroups.com
I just came across a problem when compiling that i haven't come across so I wanted to add the solution to the listserv.

cuda toolkit doesn't support gcc >4.4,  but many OS ship with 4.5 and greater now. To set the compiler to work properly follow these steps (assuming you have already installed gcc-4.4):

Look for CUDA_NVCC_FLAGS in ccmake or cmake-gui. 
Then add -ccbin;gcc-4.4 

Notes: The semi-colon is the argument separator.  
The -ccbin argument tells NVCC that you are going to specify the host compiler it should use. 
See the help output from NVCC (nvcc --help). 


Chris

Joshua A. Anderson

unread,
Apr 5, 2012, 10:07:49 AM4/5/12
to hoomd...@googlegroups.com
Is this really necessary? The CUDA 4.1 release notes explicitly lists gcc 4.5 support for Fedora 14 and Ubuntu 11.04.
--------
Joshua A. Anderson, Ph.D.
Chemical Engineering Department, University of Michigan

> --
> You received this message because you are subscribed to the Google Groups "hoomd-users" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/hoomd-users/-/4UtbT7fLEOEJ.
> To post to this group, send email to hoomd...@googlegroups.com.
> To unsubscribe from this group, send email to hoomd-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hoomd-users?hl=en.

Rastko Sknepnek

unread,
Apr 5, 2012, 10:31:38 AM4/5/12
to hoomd...@googlegroups.com
I have successfully compiled HOOMD with CUDA 4.1 and gcc 4.6.3 on Fedora
16. All I needed to do was to change line 80 in file "host_config.h" in
CUDA's include directory to read

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)

I know this is not the cleanest way to do it, but it works, and I had no
problem compiling and running HOOMD.

Rastko

Chris Knorowski

unread,
Apr 5, 2012, 12:30:46 PM4/5/12
to hoomd...@googlegroups.com
I had cuda 4.0 installed, sorry I should have been more explicit.

Chris

To unsubscribe from this group, send email to hoomd-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/hoomd-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To post to this group, send email to hoomd...@googlegroups.com.
To unsubscribe from this group, send email to hoomd-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/hoomd-users?hl=en.




--
Christopher Knorowski

Iowa State Physics Department
Reply all
Reply to author
Forward
0 new messages