Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Build failure #365

Closed
tanmaybinaykiya opened this issue Jan 21, 2019 · 3 comments
Closed

Build failure #365

tanmaybinaykiya opened this issue Jan 21, 2019 · 3 comments

Comments

@tanmaybinaykiya
Copy link

I am trying to build following the steps mentioned in INSTALL.md.

Environment: MacOS 10.14.2
Gcc Version:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix 

Error Log:

$ python setup.py build develop
running build
running build_py
running build_ext
/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/cpp_extension.py:166: UserWarning:

                               !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                              !! WARNING !!

  platform=sys.platform))
building 'maskrcnn_benchmark._C' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/Users
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc
creating build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cpu
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/include -arch x86_64 -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/include -arch x86_64 -I/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/TH -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/THC -I/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/include/python3.7m -c /Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/vision.cpp -o build/temp.macosx-10.7-x86_64-3.7/Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from /Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/vision.cpp:2:
In file included from /Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/nms.h:3:
In file included from /Users/tanmaybinaykiya/Projects/background-removal/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cpu/vision.h:3:
In file included from /Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/torch/extension.h:4:
In file included from /Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include/torch/all.h:3:
/Users/tanmaybinaykiya/miniconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include/torch/cuda.h:5:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
@fmassa
Copy link
Contributor

fmassa commented Jan 21, 2019

Hi,

looks like your GCC version is 4.2? You might need to update it to use a newer GCC.

Check the warning that you got

                               !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Also, check https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/TROUBLESHOOTING.md#compilation-errors-when-compiling-the-library , this might have the information there that you are looking for in order to fix your compilation issue

@Ghustwb
Copy link

Ghustwb commented Mar 24, 2019

@tanmaybinaykiya Hi,I met the same ,you sloved it?

@fmassa
Copy link
Contributor

fmassa commented Mar 24, 2019

This error is due to a wrong gcc version, as mentioned in the previous issue.
Closing this as the solution has already been posted.

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

No branches or pull requests

3 participants