Pytorch-Correlation-extension
Pytorch-Correlation-extension copied to clipboard
python setup.py install failed
torch = 1.10 cuda = 11.3 gcc = 9.5.0
running install /home/anaconda3/envs/py38torch110/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /home/anaconda3/envs/py38torch110/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info writing Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO writing dependency_links to Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt writing requirements to Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt writing top-level names to Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt reading manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'spatial_correlation_sampler_backend' extension creating /home/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38 creating /home/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module Emitting ninja build file /home/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/3] c++ -MMD -MF /home/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_sampler.o.d -pthread -B /opt/anaconda1anaconda2anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/TH -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/THC -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8 -c -c /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation_sampler.cpp -o /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_sampler.o -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 FAILED: /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_sampler.o c++ -MMD -MF /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_sampler.o.d -pthread -B /opt/anaconda1anaconda2anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/TH -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/THC -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8 -c -c /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation_sampler.cpp -o /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_sampler.o -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ In file included from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/python_headers.h:10, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/Device.h:3, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/extension.h:6, from /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation_sampler.cpp:1: /home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8/Python.h:44:10: fatal error: crypt.h: No such file or directory 44 | #include <crypt.h> | ^~~~~~~~~ compilation terminated. [2/3] c++ -MMD -MF /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation.o.d -pthread -B /opt/anaconda1anaconda2anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/TH -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/THC -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8 -c -c /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation.cpp -o /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation.o -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 FAILED: /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation.o c++ -MMD -MF /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation.o.d -pthread -B /opt/anaconda1anaconda2anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_CUDA -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/TH -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/THC -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8 -c -c /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation.cpp -o /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation.o -std=c++17 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ In file included from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/python_headers.h:10, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/Device.h:3, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8, from /home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/extension.h:6, from /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation.cpp:1: /home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8/Python.h:44:10: fatal error: crypt.h: No such file or directory 44 | #include <crypt.h> | ^~~~~~~~~ compilation terminated. [3/3] /home/zhuwenjun/anaconda3/envs/py38torch110/bin/nvcc -DUSE_CUDA -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/TH -I/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/include/THC -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8 -c -c /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/Correlation_Module/correlation_cuda_kernel.cu -o /home/zhuwenjun/Project_313/Segment-and-Track-Anything-main/Pytorch-Correlation-extension/build/temp.linux-x86_64-cpython-38/Correlation_Module/correlation_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1717, in _run_ninja_build subprocess.run( File "/home/zhuwenjun/anaconda3/envs/py38torch110/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "setup.py", line 69, in
home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8/Python.h:44:10: fatal error: crypt.h: No such file or directory
Looks like crypt.h is not available on your computer. It's odd, it should be available, it's apparently a very basic file.
You can try to reinstall libcrypt if you are using ubuntu sudo apt install libcrypt-dev
Thank you for your prompt reply. In fact, I am using a server(ubuntu22.04, gcc=11.3) that is shared by multiple people. I installed gcc using the “conda install gcc=9.5.0” command in the anaconda environment, and do not have the permission to execute "sudo apt install libcrypt-dev". How should I solve this problem?
from the log I can see -I/home/zhuwenjun/anaconda3/envs/py38torch110/include -I/home/zhuwenjun/anaconda3/envs/py38torch110/include/python3.8
So you are definitely including headers from anaconda. You can try to install libcrypt directly with anaconda then
https://anaconda.org/conda-forge/libgcrypt
Thanks a lot :) I install libcrypt via conda, but the problem is not solved. I finally solve the problem by installing version 7.3 of gcc and g++.