Author Topic: Linux compile error - Help  (Read 472 times)

KaptainBlaZzed

  • Newbie
  • *
  • Posts: 2
    • View Profile
Linux compile error - Help
« on: July 16, 2017, 10:44:43 pm »
i am receiving the error "/bin/bash: nvcc command not found" while trying to compile.
specifically in the "make" command.

but i know i have nvcc installed

i have compiled ccminer and nheqminer on this system already and both work.
in addition the command "which nvcc" responds "/usr/local/cuda/bin/nvcc" so the system knows where nvcc is.

system is Linux Mint Mate 18.2 x64
GTX 1080
NVIDIA toolkit 8.0
recommended nvidia driver 375.xx i think.

using these commands to install:
git clone https://github.com/tsiv/spreadminer
cd spreadminer
./autogen.sh
./configure "CFLAGS=-O3" "CXXFLAGS=-O3"
sudo make

thx,
KB

cryptopedia

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • CryptoPedia.tk : Proudly Running a Full Bitcoin Node
Re: Linux compile error - Help
« Reply #1 on: August 04, 2017, 07:13:11 am »
Does the output of:

$ echo $PATH

have /usr/local/cuda/bin in it?

Since $ which nvcc shows this path, I guess it should be but if not, try adding it to the path - might do the trick:

$ export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}

And for good measure, add this too:

$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

HTH.

Xeonus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Linux compile error - Help
« Reply #2 on: August 08, 2017, 11:11:53 am »
I am also trying to compile on ubuntu and I run into following error:
Code: [Select]
nvcc -O3 -I . -Xptxas "-abi=no -v" -gencode=arch=compute_50,code=\"sm_50,compute_50\" --maxrregcount=80 --ptxas-options=-v  -o cuda_util.o -c cuda_util.cu
ptxas warning : 'option -abi=no' might get deprecated in future
ptxas info    : 0 bytes gmem
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^

Also trying to modify string.h as suggested on google discussion forums does not resolve the issue

cryptopedia

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • CryptoPedia.tk : Proudly Running a Full Bitcoin Node
Re: Linux compile error - Help
« Reply #3 on: August 08, 2017, 12:55:46 pm »
I'm assuming you are cloning/downloading the source from here:

https://github.com/tsiv/spreadminer

I managed to compile it successfully after a good bit of struggle but the errors I was getting were different.

If you let me know the following, I'll try and see if I can help:

1) Ubuntu version you're using
2) The output of:
Code: [Select]
$ nvidia-settings -v3) The output of:
Code: [Select]
$ echo $PATH

Xeonus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Linux compile error - Help
« Reply #4 on: August 08, 2017, 01:47:49 pm »
Thanks a lot for your fast response.

1) I am using Ubuntu 16.04

2) Outputs:

Output for nvidia-settings -v
Code: [Select]
nvidia-settings:  version 375.51  (root@vm-ubuntu1604-x64-001)  Wed Mar 22
10:01:42 PDT 2017
  The NVIDIA X Server Settings tool.

  This program is used to configure the NVIDIA Linux graphics driver.
  For more detail, please see the nvidia-settings(1) man page.

Output for echo $PATH:
Code: [Select]
home/alex/bin:/home/alex/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda/bin

I also realized that "$ which nvcc" outputs following:
Code: [Select]
/usr/bin/nvcc
Shouldn't it point to /usr/local/cuda/bin? My nvcc is there.

I also tried following configure command (where I find nvcc):
Code: [Select]
./configure "CFLAGS=-O3" "CXXFLAGS=-O3" -with-cuda=usr/local/cuda
If I execute make after that I get the following errors:

Code: [Select]
make  all-recursive
make[1]: Entering directory '/home/alex/spreadminer'
Making all in compat
make[2]: Entering directory '/home/alex/spreadminer/compat'
make[3]: Entering directory '/home/alex/spreadminer/compat'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/alex/spreadminer/compat'
make[2]: Leaving directory '/home/alex/spreadminer/compat'
make[2]: Entering directory '/home/alex/spreadminer'
usr/local/cuda/bin/nvcc -O3 -I . -Xptxas "-abi=no -v" -gencode=arch=compute_50,code=\"sm_50,compute_50\" --maxrregcount=80 --ptxas-options=-v  -o cuda_util.o -c cuda_util.cu
/bin/bash: usr/local/cuda/bin/nvcc: No such file or directory
Makefile:1249: recipe for target 'cuda_util.o' failed
make[2]: *** [cuda_util.o] Error 127
make[2]: Leaving directory '/home/alex/spreadminer'
Makefile:823: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/alex/spreadminer'
Makefile:405: recipe for target 'all' failed
make: *** [all] Error 2

Therefore, I suspect something is fishy with properly calling nvcc to build cuda dependencies. What do you think?

Additional info: I have Cuda 8.0 installed and I can compile any ccminer distro successfully.

I also tried another fresh git clone and added your commands. Now I get this error:

Code: [Select]
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
Makefile:1249: recipe for target 'cuda_util.o' failed
make[2]: *** [cuda_util.o] Error 1
make[2]: Leaving directory '/home/alex/spreadminer'
Makefile:823: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/alex/spreadminer'
Makefile:405: recipe for target 'all' failed
make: *** [all] Error 2


Thanks for your help in advance :)

EDIT: added additional error output

cryptopedia

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • CryptoPedia.tk : Proudly Running a Full Bitcoin Node
Re: Linux compile error - Help
« Reply #5 on: August 08, 2017, 06:09:56 pm »
Just check if you have the nvcc binary available at /usr/local/cuda-8.0/bin/

If you do, try this:

Code: [Select]
$ export PATH=/home/alex/bin:/home/alex/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda-8.0/bin
and then try to compile. God Speed!!

Xeonus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Linux compile error - Help
« Reply #6 on: August 09, 2017, 09:36:29 am »
Thanks for your effort. Unfortunately, I still cannot compile, getting the same error as before (string.h error). I never had such issues with any other miner or coin. Really a bummer.  :(

KaptainBlaZzed

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Linux compile error - Help
« Reply #7 on: August 12, 2017, 07:56:42 pm »
still can't get it to work.

output of "nvidia-settings -v"
Code: [Select]
nvidia-settings:  version 361.42  (buildd@lgw01-18)  Tue Apr  5 14:33:28 UTC
2016
  The NVIDIA X Server Settings tool.

  This program is used to configure the NVIDIA Linux graphics driver.
  For more detail, please see the nvidia-settings(1) man page.

output of "$ echo $PATH"
Code: [Select]
/home/troy/bin:/home/troy/.local/bin:/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
i also tried "/usr/local/cuda" instead of "/usr/local/cuda-8.0" and got the same error