Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: command 'g++' failed with exit status 1 #2430

Closed
zyuh opened this issue Apr 11, 2020 · 4 comments
Closed

error: command 'g++' failed with exit status 1 #2430

zyuh opened this issue Apr 11, 2020 · 4 comments

Comments

@zyuh
Copy link

zyuh commented Apr 11, 2020

i install mmdetection in conda virtual environment with 'python setup.py develop'.
but it tells me, ''ImportError: ***/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/../../../libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /DB/rhome/yuhangzhou/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/lib/libtorch_python.so)'',

then i remove original libstdc++.so.6, and run ''ln -s libstdc++.so.6.0.26 libstdc++.so.6''
after that, i run '''python setup.py develop' again,

it prints:

running build_ext
building 'mmdet.ops.utils.compiling_info' extension
gcc -pthread -B //miniconda3/envs/open-mmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I//miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/include -I//miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I//miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/include/TH -I//miniconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I//miniconda3/envs/open-mmlab/include/python3.7m -c mmdet/ops/utils/src/compiling_info.cpp -o build/temp.linux-x86_64-3.7/mmdet/ops/utils/src/compiling_info.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=compiling_info -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/mmdet
creating build/lib.linux-x86_64-3.7/mmdet/ops
creating build/lib.linux-x86_64-3.7/mmdet/ops/utils
g++ -pthread -shared -B /miniconda3/envs/open-mmlab/compiler_compat -L//miniconda3/envs/open-mmlab/lib -Wl,-rpath=
/miniconda3/envs/open-mmlab/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/mmdet/ops/utils/src/compiling_info.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/mmdet/ops/utils/compiling_info.cpython-37m-x86_64-linux-gnu.so
/
/miniconda3/envs/open-mmlab/compiler_compat/ld: cannot find -lm
/*****/miniconda3/envs/open-mmlab/compiler_compat/ld: cannot find -lpthread
/
**/miniconda3/envs/open-mmlab/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

ps: in my conda virtual environmen, i used ''conda install -c psi4 gcc-5'', after that, when i run 'gcc -v' or 'g++ -v',
####it prints:
Reading specs from //miniconda3/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/
/miniconda3/gcc/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=//miniconda3/gcc --with-gxx-include-dir=//miniconda3/gcc/include/c++ --bindir=//miniconda3/bin --datarootdir=//miniconda3/share --libdir=//miniconda3/lib --with-gmp=//miniconda3 --with-mpfr=//miniconda3 --with-mpc=//miniconda3 --with-isl=/*****/miniconda3 --with-cloog=/***/miniconda3 --enable-checking=release --with-tune=generic --disable-multilib
Thread model: posix
gcc version 5.2.0 (GCC)

i am not a root member.
thank you!

@PEACEandSAFE
Copy link

I have the same problem.
/home/computer/anaconda3/compiler_compat/ld: cannot find -lm
/home/computer/anaconda3/compiler_compat/ld: cannot find -lpthread
/home/computer/anaconda3/compiler_compat/ld: cannot find -lc

Have you solved the probelm?

@zyuh
Copy link
Author

zyuh commented Apr 11, 2020 via email

@PEACEandSAFE
Copy link

Good news! I solved the problem! Try this method:
https://stackoverflow.com/questions/47512182/cannot-find-lfftw3-omp-error-when-compiling-a-third-party-package-how-to-lin

excute ld -lc --verbose and get path1 which shows 'scueeded'
and excute ln -s path1 path2
My path2 is '/home/computer/anaconda3/compiler_compat'

Now you can excute python setup.py develop
It will take a long time(maybe 10 mins) and maybe you will get lots of warnings.

I hope it will be helpful to you!
I guees you are Chinese.If so, we can communicate in Chinese.

@zyuh
Copy link
Author

zyuh commented Apr 11, 2020 via email

liuhuiCNN pushed a commit to liuhuiCNN/mmdetection that referenced this issue May 21, 2021
)

* fix paddle inference name problem, and update doc

* set default value

* fix inference lib name in static

* update deploy doc, fix build error of windows

* add annotation of PADDLE_LIB_NAME

* set min_subgraph_size=33 as default, fix bug of fcos_dcn_r50_fpn_1x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants