SOLVEDSolution:
sudo nano /usr/local/cuda/include/host_config.h
Just rename every number "4" into number "5" near line 115
+++
I try to compile ethminer on Ubuntu 15.10 (gcc 5.x) but I get this error:
Building NVCC (Device) object libethash-cuda/CMakeFiles/ethash-cuda.dir/ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o In file included from /usr/local/cuda/include/cuda_runtime.h:76:0, from :0: /usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! ^ CMake Error at ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o.cmake:207 (message): Error generating /home/user/cpp-ethereum/libethash-cuda/CMakeFiles/ethash-cuda.dir//./ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o
libethash-cuda/CMakeFiles/ethash-cuda.dir/build.make:63: recipe for target 'libethash-cuda/CMakeFiles/ethash-cuda.dir/ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o' failed make[2]: *** [libethash-cuda/CMakeFiles/ethash-cuda.dir/ethash-cuda_generated_ethash_cuda_miner_kernel.cu.o] Error 1 CMakeFiles/Makefile2:487: recipe for target 'libethash-cuda/CMakeFiles/ethash-cuda.dir/all' failed make[1]: *** [libethash-cuda/CMakeFiles/ethash-cuda.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
Even if I do:
sudo apt-get install gcc-4.9
sudo apt-get install gcc++-4.9
sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++
export CC=/usr/bin/gcc-4.9
export CXX=/usr/bin/g++-4.9
and/or edit:
/usr/local/cuda/include/host_config.h. Comment out lines 113-117.
113 /*#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)*/
114
115 /*#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!*/
116
117 /*#endif*/ /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9) */
or edit like this:
/usr/local/cuda/include/host_config.h. Comment line 115.
--- #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
+++ //#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
Nice tryhttp://askubuntu.com/questions/26498/choose-gcc-and-g-version/26502#26502gcc -v
g++ -v
So what we need to do is remove the GCC symlink and the G++ symlink and then recreate them linked to GCC 4.9 and G++ 4.9:
sudo rm /usr/bin/gcc
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++
Finally we can check our GCC -v again and make sure we are using the correct version:
gcc -v
g++ -v
BUT a new error at 100% [100%] Linking CXX executable ethminer ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::string const&, unsigned long long)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::string const&, unsigned long long)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'vtable for CryptoPP::StringSinkTemplate' /usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::ChannelCreatePutSpace(std::string const&, unsigned long&)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::ChannelPut2(std::string const&, unsigned char const, unsigned long, int, bool)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::ChannelPutModifiable2(std::string const&, unsigned char, unsigned long, int, bool)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::ChannelFlush(std::string const&, bool, int, bool)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::ChannelMessageSeriesEnd(std::string const&, int, bool)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'CryptoPP::BufferedTransformation::SetRetrievalChannel(std::string const&)' ../libdevcrypto/libdevcrypto.so: error: undefined reference to 'leveldb::Status::ToString() const' ../libstratum/libethstratum.so: error: undefined reference to 'Json::Reader::parse(std::string const&, Json::Value&, bool)' ../libstratum/libethstratum.so: error: undefined reference to 'Json::Reader::getFormattedErrorMessages() const' ../libdevcore/libdevcore.so: error: undefined reference to 'Json::Value::operator[](std::string const&)' ../libdevcore/libdevcore.so: error: undefined reference to 'Json::FastWriter::write(Json::Value const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function PhoneHome::report_benchmark(std::string const&, int): error: undefined reference to 'Json::Value::Value(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function PhoneHome::report_benchmark(std::string const&, int): error: undefined reference to 'jsonrpc::Client::CallMethod(std::string const&, Json::Value const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function PhoneHome::report_benchmark(std::string const&, int): error: undefined reference to 'Json::Value::toStyledString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function PhoneHome::report_benchmark(std::string const&, int): error: undefined reference to 'jsonrpc::JsonRpcException::JsonRpcException(int, std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_getWork(): error: undefined reference to 'jsonrpc::Client::CallMethod(std::string const&, Json::Value const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_getWork(): error: undefined reference to 'Json::Value::toStyledString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_getWork(): error: undefined reference to 'jsonrpc::JsonRpcException::JsonRpcException(int, std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'Json::Value::Value(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'Json::Value::Value(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'Json::Value::Value(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'jsonrpc::Client::CallMethod(std::string const&, Json::Value const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'Json::Value::toStyledString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitWork(std::string const&, std::string const&, std::string const&): error: undefined reference to 'jsonrpc::JsonRpcException::JsonRpcException(int, std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitHashrate(std::string const&, std::string const&): error: undefined reference to 'jsonrpc::Client::CallMethod(std::string const&, Json::Value const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitHashrate(std::string const&, std::string const&): error: undefined reference to 'Json::Value::toStyledString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function FarmClient::eth_submitHashrate(std::string const&, std::string const&): error: undefined reference to 'jsonrpc::JsonRpcException::JsonRpcException(int, std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function MinerCLI::doBenchmark(dev::eth::MinerType, bool, unsigned int, unsigned int, unsigned int): error: undefined reference to 'jsonrpc::HttpClient::HttpClient(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function MinerCLI::doFarm(dev::eth::MinerType, std::string const&, unsigned int): error: undefined reference to 'jsonrpc::HttpClient::HttpClient(std::string const&)' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function MinerCLI::doFarm(dev::eth::MinerType, std::string const&, unsigned int): error: undefined reference to 'Json::Value::asString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function MinerCLI::doFarm(dev::eth::MinerType, std::string const&, unsigned int): error: undefined reference to 'Json::Value::asString() const' CMakeFiles/ethminer.dir/main.cpp.o:main.cpp:function MinerCLI::doFarm(dev::eth::MinerType, std::string const&, unsigned int): error: undefined reference to 'Json::Value::asString() const' collect2: error: ld returned 1 exit status ethminer/CMakeFiles/ethminer.dir/build.make:123: recipe for target 'ethminer/ethminer' failed make[2]: *** [ethminer/ethminer] Error 1 CMakeFiles/Makefile2:667: recipe for target 'ethminer/CMakeFiles/ethminer.dir/all' failed make[1]: *** [ethminer/CMakeFiles/ethminer.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
Thank you very much for every tip!