CUDA and gcc 4.4

It is a common issue when you are using gcc 4.4 to compile CUDA SDK. Since all CUDA SDK codes were built using the lower version of gcc, you’ll see following error message:

/usr/local/cuda/bin/../include/math_functions.h:442: error: inline function ‘int __signbitl(long double)’ cannot be declared weak make: *** [obj/release/] Error 255

To solve this, what you need to do is simply edit common/ file. In the line 126, it should be
NVCCFLAGS += --compiler-options -fno-strict-aliasing --compiler-options -fno-inline

You may also get the following error when compiling one of the examples in SDK (e.g BlackScholes):

error: ‘__builtin_stdarg_start’ was not declared in this scope

then you need to add another option to the NVCCFLAGS and it would look like this

NVCCFLAGS += --compiler-options -fno-strict-aliasing --compiler-options -fno-inline -Xcompiler -D__builtin_stdarg_start=__builtin_va_start

Below part is an optional. It’s just a suggestion to avoid leaked memory when you do make clean.

Add two more lines in C/Makefile :

clean: tidy $(addsuffix .ph_clean,$(PROJECTS))
@make -C common clean
@make -C common -f Makefile_paramgl clean
@make -C common -f Makefile_rendercheckgl clean


3 thoughts on “CUDA and gcc 4.4

  1. Pingback: 2010 in review « notes

  2. Pingback: CUDA and gcc 4.4 | is moving to

  3. Thank you, I’ve recently been looking for info about this topic for a long time and yours is the best I have found out till now. But, what concerning the conclusion? Are you positive in regards to the supply?|


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.