nicehash / nheqminer

Equihash miner for NiceHash
https://www.nicehash.com
MIT License
768 stars 584 forks source link

make: cuda_djezo.cpp:65:55: error: ‘to_string’ is not a member of ‘std’ #330

Open firepol opened 6 years ago

firepol commented 6 years ago

Hi, I'm trying to build the miner with ubuntu 17.10

First attempt: got an error

unsupported GNU version! gcc versions later than 5 are not supported

Then I installed gcc-4.8 (and later gcc-5) and retried, by configuring the gcc alternatives and got this error:

/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp: In member function ‘std::__cxx11::string cuda_djezo::getdevinfo()’:
/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp:43:30: error: ‘to_string’ is not a member of ‘std’
  return m_gpu_name + " (#" + std::to_string(device_id) + ") M=" + std::to_string(combo_mode);
                              ^
/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp:43:67: error: ‘to_string’ is not a member of ‘std’
  return m_gpu_name + " (#" + std::to_string(device_id) + ") M=" + std::to_string(combo_mode);
                                                                   ^
/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp: In static member function ‘static void cuda_djezo::getinfo(int, int, std::__cxx11::string&, int&, std::__cxx11::string&)’:
/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp:65:12: error: ‘to_string’ is not a member of ‘std’
  version = std::to_string(device_props.major) + "." + std::to_string(device_props.minor);
            ^
/home/firepol/nheqminer/cuda_djezo/cuda_djezo.cpp:65:55: error: ‘to_string’ is not a member of ‘std’
  version = std::to_string(device_props.major) + "." + std::to_string(device_props.minor);
                                                       ^
cuda_djezo/CMakeFiles/cuda_djezo.dir/build.make:335: recipe for target 'cuda_djezo/CMakeFiles/cuda_djezo.dir/cuda_djezo.cpp.o' failed
make[2]: *** [cuda_djezo/CMakeFiles/cuda_djezo.dir/cuda_djezo.cpp.o] Error 1
CMakeFiles/Makefile2:178: recipe for target 'cuda_djezo/CMakeFiles/cuda_djezo.dir/all' failed
make[1]: *** [cuda_djezo/CMakeFiles/cuda_djezo.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

I'm stuck, what can you suggest to compile this with ubuntu 17.10? Thanks for your advise

Amonomen commented 6 years ago

Are you certain cmake is using g++-4.8? Try g++ --version

firepol commented 6 years ago

I did, it's really 4.8, or 5.5 it I switch the alternative to gcc-5... same error.

I also tried alias g++="g++ --std=c++0x" before running make, or std=c++11 (I tried all variants, all same error) etc. as suggested here: https://stackoverflow.com/questions/17378969/how-to-change-gcc-compiler-to-c11-on-ubuntu or here: https://stackoverflow.com/questions/19122574/to-string-isnt-a-member-of-std

Same error. Somewhere I think I read I have to add "CFLAGS" in the Makefile, but I'm nor familiar with make, nor gcc, nor c++ so in the end I could not make it work.

If not asking too much, it would be really nice to have a .deb file for this, I mean there are so many ubuntu users out there, why not making life easier for them?

In the end I gave up and found a docker image: https://hub.docker.com/r/unsalted/nheqminer/

Still, if some idea comes up I'll be happy to try it and compile it myself on my machine and give you feedback... thank you.

Amonomen commented 6 years ago

I'll attempt to reproduce your issue to get a better understanding of the issue. In the mean time, can you list your steps to reproduce? Assume it's a fresh install. List what packages you installed prior to building.

PeterHindes commented 6 years ago

same problem, used symlinks to chose gcc and g++ versions to 5.5, no luck

toby5box commented 6 years ago

I'm having the same problem on 17.10, trying to build Caffe2.

d# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.5.0-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.1 20171010 (Ubuntu 5.5.0-1ubuntu2)
# make
[  0%] Performing build step for 'nccl_external'
Compiling src/core.cu                         > /root/caffe2/third_party/nccl/build/obj/core.o
Compiling src/all_gather.cu                   > /root/caffe2/third_party/nccl/build/obj/all_gather.o
Compiling src/all_reduce.cu                   > /root/caffe2/third_party/nccl/build/obj/all_reduce.o
Compiling src/broadcast.cu                    > /root/caffe2/third_party/nccl/build/obj/broadcast.o
Compiling src/reduce.cu                       > /root/caffe2/third_party/nccl/build/obj/reduce.o
Compiling src/reduce_scatter.cu               > /root/caffe2/third_party/nccl/build/obj/reduce_scatter.o
Linking   libnccl.so.1.3.5                    > /root/caffe2/third_party/nccl/build/lib/libnccl.so.1.3.5
Archiving libnccl_static.a                    > /root/caffe2/third_party/nccl/build/lib/libnccl_static.a
[  0%] No install step for 'nccl_external'
[  0%] Completed 'nccl_external'
[  1%] Built target nccl_external
Scanning dependencies of target gtest
[  1%] Building CXX object third_party/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[  1%] Linking CXX static library ../../../lib/libgtest.a
[  1%] Built target gtest
Scanning dependencies of target gtest_main
[  1%] Building CXX object third_party/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[  2%] Linking CXX static library ../../../lib/libgtest_main.a
[  2%] Built target gtest_main
Scanning dependencies of target benchmark
[  2%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/benchmark.cc.o
[  2%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o
[  2%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/colorprint.cc.o
[  2%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/commandlineflags.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/console_reporter.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/counter.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/csv_reporter.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/json_reporter.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/reporter.cc.o
[  3%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/sleep.cc.o
[  4%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/statistics.cc.o
[  4%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/string_util.cc.o
[  4%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/sysinfo.cc.o
[  4%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/timers.cc.o
[  4%] Linking CXX static library ../../../lib/libbenchmark.a
[  4%] Built target benchmark
Scanning dependencies of target gloo
[  4%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/algorithm.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/allreduce_local.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/context.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/common/linux.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/common/logging.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/rendezvous/context.cc.o
[  5%] Building CXX object third_party/gloo/gloo/CMakeFiles/gloo.dir/rendezvous/file_store.cc.o
/root/caffe2/third_party/gloo/gloo/rendezvous/file_store.cc: In function ‘std::__cxx11::string gloo::rendezvous::encodeName(const string&)’:
/root/caffe2/third_party/gloo/gloo/rendezvous/file_store.cc:50:10: error: ‘to_string’ is not a member of ‘std’
   return std::to_string(hashFn(name));
          ^
third_party/gloo/gloo/CMakeFiles/gloo.dir/build.make:206: recipe for target 'third_party/gloo/gloo/CMakeFiles/gloo.dir/rendezvous/file_store.cc.o' failed
make[2]: *** [third_party/gloo/gloo/CMakeFiles/gloo.dir/rendezvous/file_store.cc.o] Error 1
CMakeFiles/Makefile2:412: recipe for target 'third_party/gloo/gloo/CMakeFiles/gloo.dir/all' failed
make[1]: *** [third_party/gloo/gloo/CMakeFiles/gloo.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2