Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9261661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:11:15+00:00 2026-06-18T13:11:15+00:00

I was getting this error /usr/local/cuda-5.0/bin/../include/host_config.h:82:2: error: #error — unsupported GNU version! gcc 4.7

  • 0

I was getting this error

/usr/local/cuda-5.0/bin/../include/host_config.h:82:2: error: #error
— unsupported GNU version! gcc 4.7 and up are not supported! make: * [src/Throughput.o] Error 1

In the host_config.h they assure compatibility up to the 4.6

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

#error -- unsupported GNU version! gcc 4.7 and up are not supported!

I have both 4.6 and 4.7

elect@elect-desktop:/usr/local/cuda-5.0/bin$ gcc gcc
gcc-4.7 gcc-nm-4.7 gcc-4.6 gcc-ar-4.7
gcc-ranlib-4.7

Looking on internet they suggest to add a link to the gcc-4.6 in the cuda bin directory.

So I did

elect@elect-desktop:/usr/local/cuda-5.0/bin$ sudo ln -s /usr/bin/gcc-4.6 gcc

And I get another error

**** Build of configuration Debug for project Throughput ****

make all 
Building file: ../src/Throughput.cu
Invoking: NVCC Compiler
nvcc -G -g -O0 -gencode arch=compute_20,code=sm_20 -odir "src" -M -o "src/Throughput.d"     "../src/Throughput.cu"
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
make: *** [src/Throughput.o] Error 1

**** Build Finished ****

Googling again didn’t bring me on some clear situations (gcc downgrading, etc)

So I am asking here what is now the problem since CUDA is supposed to be compatible with gcc-4.6 …

My system:

  • Ubuntu 12.10 64b
  • cuda_5.0.35_linux_64_ubuntu11.10-1

This is the tutorial code I am trying to compile at the moment

/**
 * Copyright 1993-2012 NVIDIA Corporation.  All rights reserved.
 *
 * Please refer to the NVIDIA end user license agreement (EULA) associated
 * with this source code for terms and conditions that govern your use of
 * this software. Any use, reproduction, disclosure, or distribution of
 * this software and related documentation outside the terms of the EULA
 * is strictly prohibited.
 */
#include <stdio.h>
#include <stdlib.h>

static const int WORK_SIZE = 256;

/**
 * This macro checks return value of the CUDA runtime call and exits
 * the application if the call failed.
 */
#define CUDA_CHECK_RETURN(value) {                                          \
    cudaError_t _m_cudaStat = value;                                        \
    if (_m_cudaStat != cudaSuccess) {                                       \
        fprintf(stderr, "Error %s at line %d in file %s\n",                 \
                cudaGetErrorString(_m_cudaStat), __LINE__, __FILE__);       \
        exit(1);                                                            \
    } }

__device__ unsigned int bitreverse(unsigned int number) {
    number = ((0xf0f0f0f0 & number) >> 4) | ((0x0f0f0f0f & number) << 4);
    number = ((0xcccccccc & number) >> 2) | ((0x33333333 & number) << 2);
    number = ((0xaaaaaaaa & number) >> 1) | ((0x55555555 & number) << 1);
    return number;
}

/**
 * CUDA kernel function that reverses the order of bits in each element of the array.
 */
__global__ void bitreverse(void *data) {
    unsigned int *idata = (unsigned int*) data;
    idata[threadIdx.x] = bitreverse(idata[threadIdx.x]);
}

/**
 * Host function that prepares data array and passes it to the CUDA kernel.
 */
int main(void) {
    void *d = NULL;
    int i;
    unsigned int idata[WORK_SIZE], odata[WORK_SIZE];

    for (i = 0; i < WORK_SIZE; i++)
        idata[i] = (unsigned int) i;

    CUDA_CHECK_RETURN(cudaMalloc((void**) &d, sizeof(int) * WORK_SIZE));

    CUDA_CHECK_RETURN(cudaMemcpy(d, idata, sizeof(int) * WORK_SIZE, cudaMemcpyHostToDevice));

    bitreverse<<<1, WORK_SIZE, WORK_SIZE * sizeof(int)>>>(d);

    CUDA_CHECK_RETURN(cudaThreadSynchronize());
    // Wait for the GPU launched work to complete
    CUDA_CHECK_RETURN(cudaGetLastError());
    CUDA_CHECK_RETURN(cudaMemcpy(odata, d, sizeof(int) * WORK_SIZE, cudaMemcpyDeviceToHost));

    for (i = 0; i < WORK_SIZE; i++)
        printf("Input value: %u, device output: %u\n", idata[i], odata[i]);

    CUDA_CHECK_RETURN(cudaFree((void*) d));
    CUDA_CHECK_RETURN(cudaDeviceReset());

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T13:11:16+00:00Added an answer on June 18, 2026 at 1:11 pm

    The problem stems from the CUDA toolchain not being able to find a valid C++ compiler. nvcc is only a compiler driver, it requires a working C++ compiler to compile any code.

    The most correct way to do this [note you are using an unsupported Linux version, so use this advice at your own risk], is to set up a local directory holding links to a supported compiler suite (this mean matching, supported verions of gcc and g++) and pass the --compiler-bindir argument to nvcc when you compile. For example:

    $ ls -l $HOME/cuda/bin
    total 16
    lrwxr-xr-x  1 talonmies  koti  16 Feb  9 12:41 g++ -> /usr/bin/g++-4.2
    lrwxr-xr-x  1 talonmies  koti  16 Feb  9 12:41 gcc -> /usr/bin/gcc-4.2
    

    Here I have a set of links to a supported compiler. I then can compile like this:

    $ nvcc --compiler-bindir=$HOME/cuda/bin -c -arch=sm_12 -Xptxas="-v" nanobench.cu 
    ptxas info    : 0 bytes gmem
    ptxas info    : Compiling entry function '_Z5benchIfLi128000EEvPjPT_i' for 'sm_12'
    ptxas info    : Used 5 registers, 28 bytes smem, 12 bytes cmem[1]
    

    This is probably the safest and least invasive way to use alternative compilers where the system compiler is not supported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error when I run the following code: #!/usr/bin/env ruby -rubygems
I am suddenly getting an sqlite3 error: ActionView::Template::Error (dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib Referenced
I am not sure why I'm getting this error: $ brew install mongodb ==>
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Getting this error when try to add an item to my repositories/context: Collection has
Am getting this error message and matched my brackets and couldn't find anything wrong.
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
Keep getting this error after inserting a subdatasheet into a query and trying to
am getting this error when i open my site in internet explorer......... plz help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.