We have an in-house C++-code which partly uses CUDA. The CUDA-code is spread between the files "cuda_kernel.hpp" and "cuda_kernel.cu".
All was good and the code compiled both on my local machine and our cluster.
Now I had to update my Linux from impish to jammy, which I did on Friday. When trying to compile said project today I received the following error message:
Making all in dergeraet
make[1]: Entering directory '/home/paul/Projekte/DerGeraet/dergeraet'
make all-am
make[2]: Entering directory '/home/paul/Projekte/DerGeraet/dergeraet'
CXX poisson.o
make[2]: *** No rule to make target '/usr/include/c++/10/new', needed by 'cuda_kernel.o'. Stop.
make[2]: Leaving directory '/home/paul/Projekte/DerGeraet/dergeraet'
make[1]: *** [makefile:306: all] Error 2
make[1]: Leaving directory '/home/paul/Projekte/DerGeraet/dergeraet'
make: *** [Makefile:374: all-recursive] Error 1
So I checked whether nvcc was installed. nvcc --version returned nothing so I followed the instructions on https://developer.nvidia.com/cuda-downloads to install cuda and then ran sudo apt install nvidia-cuda-toolkit. Now when calling nvcc --version Linux returns
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
Ok, me thinks, let's compile again but the error-message still remains the same.
I checked '/usr/include/c++/10/new' and there is only
'/usr/include/c++/11/new', i.e., no '/usr/include/c++/10' folder.
I am really out of clues here. Tried reinstalling cuda twice with different version numbers (11.6 and 11.7) but the error persisted. Is this some weird incompatibility issues between gcc and nvcc?
Other in-house code (without CUDA) compiles fine, thus I think it must be a cuda-related problem.
Thanks for any help in advance!
This error was caused by an incomplete host g++ installation. In this case the libstdc++-10-dev package was either missing or incorrectly installed.
Related
hi I try to build pjsip in centos 7 and has an error.
I has limited experience in Linux, in my new project i have to use pjsip in Centos 7 I download the pjsip library version 2.9 unpacked and try to compile.
I test this two configuration.
$ ./configure
....
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
aconfigure: error: C++ compiler does not work
I think this is not correct.
I try this
$ ./configure-legacy
CROSS_COMPILE =
LINUX_POLL = select
The configuration for current host has been written to 'build.mak'.
Customizations can be put in:
- 'user.mak'
- 'pjlib/include/pj/config_site.h'
Next, run 'make dep && make clean && make'
could be right but the make fails
$ make
....
../src/pj/sock_bsd.c:147:35: error: ‘TCP_NODELAY’ undeclared here (not in
a function)
const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY;
^
make[2]: *** [output/pjlib-x86_64-linux-gcc/sock_bsd.o] Error 1
make[2]: Leaving directory `/mnt/hgfs/sharedfolder/pjproject-
2.9/pjlib/build'
make[1]: *** [libpj-x86_64-linux-gcc.a] Error 2
make[1]: Leaving directory `/mnt/hgfs/sharedfolder/pjproject-
2.9/pjlib/build'
make: *** [all] Error
I need some help with this problem thank a lot.
C compiler missing.
Is gcc available on your system??
sudo yum groupinstall 'Development Tools'
I am trying to use a c++ ARM 32-bit library on a Jetson Tx2, which is an ARM 64-bit linux machine. When I try to compile some of the sample code provided with the library I get the following compilation error:
/usr/bin/ld: skipping incompatible /home/nvidia/libroyale/bin/libroyale.so
when searching for -lroyale
/usr/bin/ld: cannot find -lroyale
collect2: error: ld returned 1 exit status
CMakeFiles/sampleCameraInfo.dir/build.make:94: recipe for target
'sampleCameraInfo' failed
make[2]: *** [sampleCameraInfo] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I assume that this error is because the 32-bit library is somehow incompatible with a 64-bit machine.
I have been browsing other StackOverflow forums on similar issues, and in accordance with those forum recommendations added the -m32 flag to CXXFLAGS and LDFLAGS when I compile. However, I then get the following error:
g++: error: unrecognized command line option ‘-m32’
CMakeFiles/sampleCameraInfo.dir/build.make:62: recipe for target
'CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o' failed
make[2]: *** [CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Some other StackOverflow threads said that in order to use the -m32 flag, one has to run the command:
sudo apt-get install g++-multilib
I don't think that the installation is working correctly, as I'm getting the following errors:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
g++-multilib:armhf : Depends: cpp:armhf (>= 4:5.3.1-1ubuntu1) but it is
not going to be installed
Depends: gcc-multilib:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++-5-multilib:armhf (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Any suggestions would be very much appreciated. Thanks!
UPDATE: I realized that the -m32 flag is only supported on x86 linux machines. Does anyone know if there is some equivalent for ARM machines?
I had a look at the GCC documentation, especially on the following pages:
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/x86-Options.html
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/AArch64-Options.html
Looks like for the GNU compilers x86 is one type of CPU; you can create 16-, 32- or 64-bit code for this CPU type.
However it also looks like for the GNU compilers 32-bit ARM CPUs and 64-bit ARM CPUs are two completely different CPU types.
Therefore compiling for 32-bit ARM with a 64-bit ARM compiler is the same as compiling for x86 with an ARM compiler: It won't work.
Of course the 32-bit library will not be accepted; an ARM compiler would not accept a x86 library, either.
I was trying to compile darknet(YOLO) with Cuda and Opencv. I compiled them and there is no error but there is warning like this :
/usr/bin/ld: warning: libcudart.so.7.5, needed by /usr/local/lib/libopencv_core.so, not found (try using -rpath or -rpath-link)
When I try with the example from https://pjreddie.com/darknet/yolo/, an error come out.
./darknet: error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory
I don't know how to solve this.
Below is my system
OS = Ubuntu 16.04 LTS
CUDA = 8.0
OPENCV = 2.4
Typing nvcc -V on terminal result with this
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
I installed opencv using this command like shown from http://milq.github.io/install-opencv-ubuntu-debian/
sudo apt-get install libopencv-dev python-opencv
I did use option two from the page but during make process, it return the following error
modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/build.make:2982: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o' failed
make[2]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o] Error 1
CMakeFiles/Makefile2:16054: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all' failed
make[1]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 59%] Linking CXX shared library ../../lib/libopencv_photo.so
[ 59%] Built target opencv_photo
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I already put the path for cuda inside .bashrc and reload it but the same error appears.
Below is the path for cuda inside my .bashrc
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
Thank you for your help.
Your error message indicates that version 7.5 of the CUDA runtime is needed by OpenCV (i.e. it was compiled against that version of CUDA.
Your installed version of CUDA is 8.0. Adding it's library path will not help finding a suitable version for OpenCV.
Build OpenCV against CUDA 8.0, or install CUDA 7.5 and add the library directory to LD_LIBRARY_PATH.
Technically you could also try a mixed build (i.e. just adding the CUDA 7.5 library directory to LD_LIBRARY_PATH, preferably after the CUDA 8.0 path). However carrying two versions of the CUDA runtime will likely lead to problems (I've never tried), and I'd recommend against it.
This is the solution for others who got same problem as me. I use the suggestion from daveselinger here https://github.com/opencv/opencv/issues/6677
git clone the repository and git checkout 3.1.0 with cuda 8 (refer to the link). After that just cmake and make
It worked for me.
$ cd /usr/local/cuda/lib64
$ $ln -s libcudart.so libcudart.so.7.5
There is no difference between libcudart.so.7.5 and libcudart.so.8.0.
So I have an AWS instance (the free tier one) running with Ubuntu 16.04. There I have installed nacl_sdk (which is working and has allowed me to access their sample sites with success) and naclports which I used to port opencv with which I had trouble with at first due to errors with zlib but got it working after I added i386 architecture and did sudo apt-get update on the system and installed necessary i386 programs.
Note I have depot_tools installed as well.
Now I am trying to install the eigen3 library for pnacl as well but I am getting an error and I am not sure how to understand it nor how exactly it gets built to fix it.
The command that I ported opencv with was
$ NACL_ARCH=pnacl make opencv
And I tried these two commands for building eigen3 with the same results (shown below)
$ NACL_ARCH=pnacl make eigen3
$ bin/webports install eigen3
This is the very end of terminal output (the entire message is very long):
######################################################################
Building eigen3
######################################################################
chdir /home/ubuntu/Work/ExternCode/naclports/src/out/build/eigen3/build_pnacl
make -j1 basicstuff cholesky determinant geo_transformations inverse
Scanning dependencies of target basicstuff
Building CXX object test/CMakeFiles/basicstuff.dir/basicstuff.cpp.o
Linking CXX executable basicstuff
Built target basicstuff
Scanning dependencies of target cholesky
[100%] Building CXX object test/CMakeFiles/cholesky.dir/cholesky.cpp.o
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.7.0 (https://chromium.googlesource.com/a/native_client/pnacl-clang.git cf0dc7f6e6123dfa9b8834b56743315300b34e6c) (https://chromium.googlesource.com/a/native_client/pnacl-llvm.git baa63524b6b493ec2a6aa2c5193d9f25c0c33191)
Target: le32-unknown-nacl
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
test/CMakeFiles/cholesky.dir/build.make:62: recipe for target 'test/CMakeFiles/cholesky.dir/cholesky.cpp.o' failed
make[3]: *** [test/CMakeFiles/cholesky.dir/cholesky.cpp.o] Error 254
CMakeFiles/Makefile2:14386: recipe for target 'test/CMakeFiles/cholesky.dir/all' failed
make[2]: *** [test/CMakeFiles/cholesky.dir/all] Error 2
CMakeFiles/Makefile2:14393: recipe for target 'test/CMakeFiles/cholesky.dir/rule' failed
make[1]: *** [test/CMakeFiles/cholesky.dir/rule] Error 2
Makefile:5128: recipe for target 'cholesky' failed
make: *** [cholesky] Error 2
webports: Build failed: 'eigen3' [pnacl/release]
clang: error: unable to execute command: Killed
It looks like your AWS instance killed clang, so perhaps it ran out of memory. The free tier gives 1 MiB of RAM and that might not be enough for what you're trying to do.
I was trying to get llvm 3.0 on my machine, but I get the following errors when I give make -k.
chethan#ubuntu:~/llvm-3.0$ make
make[1]: Entering directory `/home/chethan/llvm-3.0/lib/Support'
llvm[1]: Compiling APFloat.cpp for Release build
In file included from APFloat.cpp:15:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APFloat.h:104:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APInt.h:18:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/ArrayRef.h:13:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/SmallVector.h:17:
/home/chethan/llvm-3.0/include/llvm/Support/type_traits.h:20:10: fatal error: 'utility' file not found
#include <utility>
^
1 error generated.
make[1]: *** [/home/chethan/llvm-3.0/lib/Support/Release/APFloat.o] Error 1
make[1]: Leaving directory `/home/chethan/llvm-3.0/lib/Support'
make: *** [all] Error 1
I follow these steps to build llvm on my machine.
Get the llvm source zip file from llvm download page and unzipped to folder llvm-3.0
cd /home/chethan/llvm-3.0
./configure
make -k
Although in this case, I just gave 'make' so that it stops on first error. I have llvm-gcc 4.2 installed on my machine.
I followed the same steps today morning in my home machine, and llvm-3.0 built successfully! Any idea what might be missing here?
configure with CC=gcc CXX=g++. It looks like the configure script is finding a version of clang that isn't actually set up correctly to compile C++ code.