luanfujun / deep-painterly-harmonization

Code and data for paper "Deep Painterly Harmonization": https://arxiv.org/abs/1804.03189
6.08k stars 628 forks source link

Error during compilation of cuda_utils.cu #15

Open sherkwast opened 6 years ago

sherkwast commented 6 years ago

What I got from the command make clean && make is as follows,

In file included from /usr/local/cuda-9.1/bin/../targets/x86_64-linux/include/host_config.h:50:0, from /usr/local/cuda-9.1/bin/../targets/x86_64-linux/include/cuda_runtime.h:78, from :0: /usr/local/cuda-9.1/bin/../targets/x86_64-linux/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ makefile:10: recipe for target 'libcuda_utils.so' failed make: *** [libcuda_utils.so] Error 1

This is my makefile content,

PREFIX=/home/whu/apps/torch/install NVCC_PREFIX=/usr/local/cuda-9.1/bin CFLAGS=-I$(PREFIX)/include/THC -I$(PREFIX)/include/TH -I$(PREFIX)/include LDFLAGS_NVCC=-L$(PREFIX)/lib -Xlinker -rpath,$(PREFIX)/lib -lluaT -lTHC -lTH -lpng -lluajit -lgomp all: libcuda_utils.so libcuda_utils.so: cuda_utils.cu $(NVCC_PREFIX)/nvcc -arch sm_35 -O3 -DNDEBUG -Xcompiler -fopenmp --compiler-options '-fPIC' -o libcuda_utils.so --shared cuda_utils.cu $(CFLAGS) $(LDFLAGS_NVCC) clean: find . -type f | xargs -n 5 touch rm -f libcuda_utils.so

luanfujun commented 6 years ago

Based on the error message, it seems you need to downgrade the gcc version <= 6.