Building CCminer on Ubuntu 17.04
Solution 1
Quick fix : open the makefile, search for nvcc (with nano it's CTRL+W, enter "nvcc") and replace it with "nvcc -ccbin clang-3.8", save the makefile and make again.
Solution 2
Using clang-3.8 still left me with linking errors. However, I managed to get ccminer to compile on Ubuntu 17 by doing the following:
sudo apt-get install gcc-4.9
./configure.sh
Edit the following lines in the Makefile:
CXX = g++-4.9
NVCC = /usr/local/cuda/bin/nvcc -ccbin gcc-4.9
ac_ct_CC = gcc-4.9
ac_ct_CXX = g++-4.9
Then finally:
make
Good luck!
Solution 3
The best way to choose your compiler is by passing the appropriate variables to ./configure:
sudo apt-get install g++-4.9
CC=gcc-4.9 CPP=cpp-4.9 CXX=g++-4.9 ./configure
Currently, nvcc doesn't seem to like GCC versions newer than 5.
Related videos on Youtube
itssme
Updated on September 18, 2022Comments
-
itssme over 1 year
I recently started to mine some cryptconcurrencys again and I wanted to try Monero (XMR). The CPU miner xmrig works perfectly however I am having problems install a GPU miner.
What I already did
I already installed the graphic drivers for my GTX 1070 (I am using 375.66)
itssme@muhbuntu:~$ nvidia-smi Wed Jul 26 20:48:30 2017 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 375.66 Driver Version: 375.66 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 1070 Off | 0000:01:00.0 On | N/A | | 27% 32C P8 7W / 151W | 653MiB / 8112MiB | 0% Default | +-------------------------------+----------------------+----------------------+
I already installed cuda (apt-get install nvidia-cuda-dev nvidia-cuda-toolkit)
itssme@muhbuntu:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Sun_Sep__4_22:14:01_CDT_2016 Cuda compilation tools, release 8.0, V8.0.44
Cloning ccminer from github
https://github.com/tpruvot/ccminer.git
Running "./autogen.sh" and "./configure"
itssme@muhbuntu:~$ ./autogen.sh configure.ac:4: installing './config.sub' configure.ac:6: installing './missing' Makefile.am: installing './depcomp' itssme@muhbuntu:~$ ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for gcc option to accept ISO C99... none needed checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking whether gcc needs -traditional... no checking dependency style of gcc... gcc3 checking for ranlib... ranlib checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking for gcc option to support OpenMP... -fopenmp checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking sys/endian.h usability... no checking sys/endian.h presence... no checking for sys/endian.h... no checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for sys/sysctl.h... yes checking whether be32dec is declared... no checking whether le32dec is declared... no checking whether be32enc is declared... no checking whether le32enc is declared... no checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for getopt_long... yes checking whether we can compile AVX code... yes checking whether we can compile XOP code... yes checking whether we can compile AVX2 code... yes checking for json_loads in -ljansson... yes checking for pthread_create in -lpthread... yes checking for SSL_library_init in -lssl... yes checking for EVP_DigestFinal_ex in -lcrypto... yes checking for gawk... (cached) gawk checking for curl-config... /usr/bin/curl-config checking for the version of libcurl... 7.52.1 checking for libcurl >= version 7.15.2... yes checking whether libcurl is usable... yes checking for curl_free... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating compat/Makefile config.status: creating compat/jansson/Makefile config.status: creating cpuminer-config.h config.status: executing depfiles commands
Where I fail
Running the make command
itssme@muhbuntu:~/Documents/ccminer$ make make all-recursive make[1]: Entering directory '/home/itssme/Documents/ccminer' Making all in compat make[2]: Entering directory '/home/itssme/Documents/ccminer/compat' make[3]: Entering directory '/home/itssme/Documents/ccminer/compat' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/home/itssme/Documents/ccminer/compat' make[2]: Leaving directory '/home/itssme/Documents/ccminer/compat' make[2]: Entering directory '/home/itssme/Documents/ccminer' gcc -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-crc32.o -MD -MP -MF .deps/ccminer-crc32.Tpo -c -o ccminer-crc32.o `test -f 'crc32.c' || echo './'`crc32.c mv -f .deps/ccminer-crc32.Tpo .deps/ccminer-crc32.Po gcc -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-hefty1.o -MD -MP -MF .deps/ccminer-hefty1.Tpo -c -o ccminer-hefty1.o `test -f 'hefty1.c' || echo './'`hefty1.c mv -f .deps/ccminer-hefty1.Tpo .deps/ccminer-hefty1.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-ccminer.o -MD -MP -MF .deps/ccminer-ccminer.Tpo -c -o ccminer-ccminer.o `test -f 'ccminer.cpp' || echo './'`ccminer.cpp mv -f .deps/ccminer-ccminer.Tpo .deps/ccminer-ccminer.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-util.o -MD -MP -MF .deps/ccminer-util.Tpo -c -o ccminer-util.o `test -f 'util.cpp' || echo './'`util.cpp mv -f .deps/ccminer-util.Tpo .deps/ccminer-util.Po gcc -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-log.o -MD -MP -MF .deps/ccminer-log.Tpo -c -o ccminer-log.o `test -f 'log.c' || echo './'`log.c mv -f .deps/ccminer-log.Tpo .deps/ccminer-log.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-api.o -MD -MP -MF .deps/ccminer-api.Tpo -c -o ccminer-api.o `test -f 'api.cpp' || echo './'`api.cpp mv -f .deps/ccminer-api.Tpo .deps/ccminer-api.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-hashlog.o -MD -MP -MF .deps/ccminer-hashlog.Tpo -c -o ccminer-hashlog.o `test -f 'hashlog.cpp' || echo './'`hashlog.cpp mv -f .deps/ccminer-hashlog.Tpo .deps/ccminer-hashlog.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-nvml.o -MD -MP -MF .deps/ccminer-nvml.Tpo -c -o ccminer-nvml.o `test -f 'nvml.cpp' || echo './'`nvml.cpp mv -f .deps/ccminer-nvml.Tpo .deps/ccminer-nvml.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-stats.o -MD -MP -MF .deps/ccminer-stats.Tpo -c -o ccminer-stats.o `test -f 'stats.cpp' || echo './'`stats.cpp mv -f .deps/ccminer-stats.Tpo .deps/ccminer-stats.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-sysinfos.o -MD -MP -MF .deps/ccminer-sysinfos.Tpo -c -o ccminer-sysinfos.o `test -f 'sysinfos.cpp' || echo './'`sysinfos.cpp mv -f .deps/ccminer-sysinfos.Tpo .deps/ccminer-sysinfos.Po g++ -DHAVE_CONFIG_H -I. -fopenmp -pthread -fno-strict-aliasing -I/usr/local/cuda/include -DSCRYPT_KECCAK512 -DSCRYPT_CHACHA -DSCRYPT_CHOOSE_COMPILETIME -g -O2 -MT ccminer-cuda.o -MD -MP -MF .deps/ccminer-cuda.Tpo -c -o ccminer-cuda.o `test -f 'cuda.cpp' || echo './'`cuda.cpp mv -f .deps/ccminer-cuda.Tpo .deps/ccminer-cuda.Po nvcc -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -I/usr/local/cuda/include -I. --ptxas-options="-v" --maxrregcount=128 -o heavy/heavy.o -c heavy/heavy.cu ERROR: No supported gcc/g++ host compiler found, but clang-3.8 is available. Use 'nvcc -ccbin clang-3.8' to use that instead. Makefile:2073: recipe for target 'heavy/heavy.o' failed make[2]: *** [heavy/heavy.o] Error 1 make[2]: Leaving directory '/home/itssme/Documents/ccminer' Makefile:1621: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/itssme/Documents/ccminer' Makefile:564: recipe for target 'all' failed make: *** [all] Error 2
The problem
ERROR: No supported gcc/g++ host compiler found, but clang-3.8 is available. Use 'nvcc -ccbin clang-3.8' to use that instead.
The problem seems to be that CUDA 8.0 doens't support gcc 6. So how can I use clang instead? (I already installed it via apt)
-
Peyto almost 7 yearsDid you run the command "nvcc -ccbin clang-3.8"? Also what command did you use to install clang?
-
itssme almost 7 yearsI used
apt install clang-3.8
and yes I did runnvcc -ccbin clang-3.8
but it had no effect
-