Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Building Fails on Ubuntu 18LTS-based systems #227

Open
awebeer256 opened this issue Mar 27, 2020 · 1 comment
Open

Building Fails on Ubuntu 18LTS-based systems #227

awebeer256 opened this issue Mar 27, 2020 · 1 comment

Comments

@awebeer256
Copy link

I'm running Linux Mint 19.3 (which is based on Ubuntu 18.04) with an Nvidia CUDA GPU, and when I ran make -j4 in the build instructions, I got this error message:
[ 17%] Generating modelHandler_CUDA.ptx30
ERROR: No supported gcc/g++ host compiler found, but clang-4.0 is available.
Use 'nvcc -ccbin clang-4.0' to use that instead.
CMakeFiles/gensrcs.dir/build.make:71: recipe for target 'modelHandler_CUDA.ptx30' failed
make[2]: *** [modelHandler_CUDA.ptx30] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/gensrcs.dir/all' failed
make[1]: *** [CMakeFiles/gensrcs.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Some searching later and I came across this, and concluded that my default version of gcc (7.4.0) was too new. My first thought was to downgrade to gcc 7.3.0 (which is officially supported), but that would've necessitated reinstalling all of my cuda-related packages, so I searched for a better way. Eventually I made it work by installing gcc-6 and g++-6, and building with those instead; to do that, I went to the place the error happened: line 71 (actually 72) of waifu2x-converter-cpp/out/CMakeFiles/gensrcs.dir/build.make, and added -ccbin /usr/bin/gcc-6 after /usr/bin/nvcc.

So to fix this issue, I suggest implementing code to detect which compilers are installed (presumably, clang 4.0 would've worked too, as the error message states), and tweaking the generated build.make file accordingly (or if no compatible compilers are installed, spitting out an error message asking the user to install one).

@Alex20129
Copy link

Alex20129 commented May 11, 2020

I confirm it. the g++7 compiler was installed in my system by default. Error solved after g++6 installation. i just 'apt install g++-6' without any troubles.
[upd]: no need to touch any files. all be built normally if g++-6 already installed
$ cmake ../
$ make
done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants