I used brew to install relevant components, and used conda to create a virtual environment named seamless_m4t, in which I installed relevant python packages.
brew install ninja
brew install libsndfile
brew install libiconv
conda create -n seamless_m4t python=3.9
conda activate seamless_m4t
conda install -c conda-forge pre_commit
conda install -c conda-forge datasets
conda install -c pytorch torchaudio
conda install -c conda-forge pysoundfile
conda install -c conda-forge librosa
After that, I installed a Python package named fairseq2 from source in the virtual environment, with the following steps:
git clone --recurse-submodules https://github.com/facebookresearch/fairseq2.git
export CONDA_BUILD_SYSROOT=$(xcrun --show-sdk-path)
pip3 install torch -r fairseq2/fairseq2n/python/requirements-build.txt
cd fairseq2/fairseq2n
cmake -GNinja -B build
The error occurred during the CMake configuration for fairseq2n,Could NOT find Torch.
CMake Error at /Users/chong/miniconda3/envs/seamless_m4t/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Torch (missing: TORCH_LIBRARY TORCH_CPU_LIBRARY C10_LIBRARY
TORCH_INCLUDE_DIR TORCH_API_INCLUDE_DIR) (Required is at least version
"1.12")
Call Stack (most recent call first):
/Users/chong/miniconda3/envs/seamless_m4t/lib/python3.9/site-packages/cmake/data/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindTorch.cmake:114 (find_package_handle_standard_args)
CMakeLists.txt:167 (find_package)
In a constructed Conda environment, when executing pip3 list,torch is already installed with version 2.0.1. Why is it unable to locate the Torch path?
My system is macOS Ventura 13.4.1
This is the issue I created on GitHub: https://github.com/chipcode-nl/mac-fairseq2/issues/1#issue-1884649037