qsimcirq build wheel fails with legacy-install-failure error
MarzioVallero opened this issue · 0 comments
I have been trying lots of options for installing qsimcirq with custatevec support. Currently, I'm trying to build the latest version of cuquantum alongside the latest version of qsim.
The machine I am using runs Ubuntu 20.04 and is equipped with an NVIDIA A2.
CUDA version: 11.7
Driver Version: 515.43.04
Follow the steps for reproduction.
Build the conda environment:
conda create -n env-cuquantum python=3.8 pybind11
conda activate env-cuquantum
Download packages:
wget https://developer.download.nvidia.com/compute/cuquantum/redist/cuquantum/linux-x86_64/cuquantum-linux-x86_64-22.11.0.13-archive.tar.xz
tar -xf cuquantum-linux-x86_64-0.1.0.30-archive.tar.xz
git submodule add https://github.com/quantumlib/qsim.git
Build the packages:
export CUQUANTUM_DIR=/home/mars/cuquantum-linux-x86_64-22.11.0.13-archive
export CUQUANTUM_ROOT=/home/mars/cuquantum-linux-x86_64-22.11.0.13-archive
export LD_LIBRARY_PATH=${CUQUANTUM_ROOT}/lib:${LD_LIBRARY_PATH}
cd /home/mars/qsim
make
pip install .
pip install .
fails with the following output:
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [108 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Found PythonLibs: /home/mars/miniconda3/envs/sevastopol/lib/libpython3.8.so (found suitable version "3.8.16", minimum required is "3.7")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-11.7 (found version "11.7")
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- The C compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
-- Configuring done
CMake Warning (dev) in pybind_interface/cuda/CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
CUDA_ARCHITECTURES is empty for target "qsim_cuda".
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in pybind_interface/custatevec/CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
CUDA_ARCHITECTURES is empty for target "qsim_custatevec".
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in pybind_interface/decide/CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
CUDA_ARCHITECTURES is empty for target "qsim_decide".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/mars/quirion-explorer/qsim/build/temp.linux-x86_64-cpython-38
[ 7%] Building CUDA object pybind_interface/cuda/CMakeFiles/qsim_cuda.dir/pybind_main_cuda.cpp.o
[ 14%] Building CUDA object pybind_interface/custatevec/CMakeFiles/qsim_custatevec.dir/pybind_main_custatevec.cpp.o
In file included from /home/mars/quirion-explorer/qsim/pybind_interface/cuda/pybind_main_cuda.h:15,
from /home/mars/quirion-explorer/qsim/pybind_interface/cuda/pybind_main_cuda.cpp:15:
/home/mars/quirion-explorer/qsim/pybind_interface/cuda/../pybind_main.h:18:10: fatal error: pybind11/complex.h: No such file or directory
18 | #include <pybind11/complex.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [pybind_interface/cuda/CMakeFiles/qsim_cuda.dir/build.make:76: pybind_interface/cuda/CMakeFiles/qsim_cuda.dir/pybind_main_cuda.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:206: pybind_interface/cuda/CMakeFiles/qsim_cuda.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 21%] Linking CXX shared module ../../../lib.linux-x86_64-cpython-38/qsimcirq/qsim_custatevec.cpython-38-x86_64-linux-gnu.so
[ 21%] Built target qsim_custatevec
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/mars/quirion-explorer/qsim/setup.py", line 91, in <module>
setup(
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
self.run_command("build")
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/quirion-explorer/qsim/setup.py", line 36, in run
self.build_extension(ext)
File "/home/mars/quirion-explorer/qsim/setup.py", line 75, in build_extension
subprocess.check_call(
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for qsimcirq
Running setup.py clean for qsimcirq
Failed to build qsimcirq
Installing collected packages: qsimcirq
Running setup.py install for qsimcirq ... error
error: subprocess-exited-with-error
× Running setup.py install for qsimcirq did not run successfully.
│ exit code: 1
╰─> [85 lines of output]
running install
/home/mars/miniconda3/envs/sevastopol/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(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/_version.py -> build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/init.py -> build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/qsim_circuit.py -> build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/qsimh_simulator.py -> build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/qsim_simulator.py -> build/lib.linux-x86_64-cpython-38/qsimcirq
copying qsimcirq/py.typed -> build/lib.linux-x86_64-cpython-38/qsimcirq
running build_ext
-- The CXX compiler identification is GNU 11.3.0
-- The CUDA compiler identification is NVIDIA 11.7.64
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-11.7/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found PythonInterp: /home/mars/miniconda3/envs/sevastopol/bin/python (found suitable version "3.8.16", minimum required is "3.6")
-- Found PythonLibs: /home/mars/miniconda3/envs/sevastopol/lib/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /home/mars/miniconda3/envs/sevastopol/include (found version "2.10.1")
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at
least version "3.7")
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
pybind_interface/cuda/CMakeLists.txt:18 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/mars/quirion-explorer/qsim/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/mars/quirion-explorer/qsim/setup.py", line 91, in <module>
setup(
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/command/install.py", line 698, in run
self.run_command('build')
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/mars/quirion-explorer/qsim/setup.py", line 36, in run
self.build_extension(ext)
File "/home/mars/quirion-explorer/qsim/setup.py", line 72, in build_extension
subprocess.check_call(
File "/home/mars/miniconda3/envs/sevastopol/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/mars/quirion-explorer/qsim', '-DCMAKE_CUDA_COMPILER=nvcc', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/mars/quirion-explorer/qsim/build/lib.linux-x86_64-cpython-38/qsimcirq', '-DPYTHON_EXECUTABLE=/home/mars/miniconda3/envs/sevastopol/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> qsimcirq
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.`
conda list
output:
Moreover, I want to point out that I've not been able to find working/updated guides for installing cuquantum, so if there were to be any, please let me know.