Compile error on conda environment torch 1.8.1v , gcc 9.3.1 , python 3.7
python setup.py install throws an error
Building torch-ccl-1.2.0+8786e24 running install running bdist_egg running egg_info writing torch_ccl.egg-info/PKG-INFO writing dependency_links to torch_ccl.egg-info/dependency_links.txt writing top-level names to torch_ccl.egg-info/top_level.txt reading manifest file 'torch_ccl.egg-info/SOURCES.txt' writing manifest file 'torch_ccl.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying torch_ccl/version.py -> build/lib.linux-x86_64-3.7/torch_ccl running build_ext error: patch failed: third_party/oneCCL/CMakeLists.txt:239 error: third_party/oneCCL/CMakeLists.txt: patch does not apply error: patch failed: third_party/oneCCL/src/CMakeLists.txt:253 error: third_party/oneCCL/src/CMakeLists.txt: patch does not apply CMake Error at CMakeLists.txt:10 (find_package): By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Torch", but CMake did not find one.
Could not find a package configuration file provided by "Torch" with any of the following names:
TorchConfig.cmake
torch-config.cmake
Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set "Torch_DIR" to a directory containing one of the above files. If "Torch" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
See also "/ec/pdx/disks/mlp_lab_home_pool_02/ashleeti/torch-ccl/build/temp.linux-x86_64-3.7.libtorch_ccl/CMakeFiles/CMakeOutput.log".
/nfs/site/home/ashleeti/anaconda3/envs/env/bin/cmake -DBUILD_CONFIG=OFF -DBUILD_EXAMPLES=OFF -DBUILD_FT=OFF -DBUILD_UT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/cc -DCMAKE_INSTALL_PREFIX=/ec/pdx/disks/mlp_lab_home_pool_02/ashleeti/torch-ccl/torch_ccl -DCMAKE_PREFIX_PATH=/nfs/site/home/ashleeti/anaconda3/envs/env -DPYTORCH_LIBRARY_DIRS=/nfs/site/home/ashleeti/anaconda3/envs/env/lib/python3.7/site-packages/torch/lib -DUSE_CUDA=0 /ec/pdx/disks/mlp_lab_home_pool_02/ashleeti/torch-ccl
Traceback (most recent call last):
File "setup.py", line 235, in
This is because the torch_ccl cannot locate the torch installation on your setup.
Can you try to install the torch explicitly and try again?
This seems to be a common error since last few days. Not sure if there is change in latest conda CMake package that is causing this. For now exporting this env should solve the problem.
export Torch_DIR=$(python -c "import torch; import os; print(os.path.dirname(torch.__file__) + '/share/cmake/Torch');")
@ddkalamk Thanks for the information. I will try to check the install issue with the latest conda package
Thanks @chengjunlu. To be more precise, these are the steps I used to setup conda env and install cmake. (most likely, other packages are irrelevant for this issue but I just kept those in case there is any dependency...)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ./miniconda3
miniconda3/bin/conda create -y -n pt python=3.8
source miniconda3/bin/activate pt
conda install -y numpy ninja pyyaml mkl mkl-include setuptools cmake cffi jemalloc tqdm future pydot scikit-learn
conda install -y -c intel numpy
conda install -y -c eumetsat expect
conda install -y -c conda-forge gperftools onnx tensorboardx libunwind