I have been trying to install momi on my MAC without success. I followed the commands as suggested on the website, and got the following error that I don't quite understand.
I noticed issue #50 about building failures on MAC, but I guess my problem is a different one, since it doesn't seem to be related to the library issue? I wonder if this seems solvable. Thank you very much in advance.
FYI, my MAC is MBP (13-inch, M1, 2020), macOS Big Sur 11.5.2. My python version is 3.10.9, my numpy version is 1.23.5, my gcc version is 13.1.0.
(base) caoqi@Caoqis-MacBook-Pro ~ % brew install llvm libomp
==> Downloading https://formulae.brew.sh/api/formula.jws.json
############################################################################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
############################################################################################################################## 100.0%
Warning: llvm 16.0.3 is already installed and up-to-date.
To reinstall 16.0.3, run:
brew reinstall llvm
libomp is already installed but outdated (so it will be upgraded).
==> Fetching libomp
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/manifests/16.0.4
############################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:4101459fe3ba90c87db103f68973377226b9be6f780fe720d05c0e9d9feb0ed2
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:4101459fe3ba90c87db103f68973377226b9be6f780fe720
############################################################################################################################## 100.0%
==> Pouring libomp--16.0.4.arm64_big_sur.bottle.tar.gz
==> Caveats
libomp is keg-only, which means it was not symlinked into /opt/homebrew,
because it can override GCC headers and result in broken builds.
For compilers to find libomp you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
==> Summary
🍺 /opt/homebrew/Cellar/libomp/16.0.4: 7 files, 1.7MB
==> Running `brew cleanup libomp`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /opt/homebrew/Cellar/libomp/16.0.2... (7 files, 1.7MB)
Removing: /Users/caoqi/Library/Caches/Homebrew/libomp--16.0.2... (567.2KB)
(base) caoqi@Caoqis-MacBook-Pro ~ % CC=$(brew --prefix llvm)/bin/clang pip install momi
Collecting momi
Using cached momi-2.1.20.tar.gz (301 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: cached_property>=1.3 in ./anaconda3/lib/python3.10/site-packages (from momi) (1.5.2)
Requirement already satisfied: autograd>=1.2.0 in ./anaconda3/lib/python3.10/site-packages (from momi) (1.5)
Requirement already satisfied: numpy>=1.9.0 in ./anaconda3/lib/python3.10/site-packages (from momi) (1.23.5)
Requirement already satisfied: networkx in ./anaconda3/lib/python3.10/site-packages (from momi) (2.8.4)
Requirement already satisfied: scipy in ./anaconda3/lib/python3.10/site-packages (from momi) (1.10.0)
Requirement already satisfied: pandas in ./anaconda3/lib/python3.10/site-packages (from momi) (1.5.3)
Requirement already satisfied: msprime in ./anaconda3/lib/python3.10/site-packages (from momi) (1.2.0)
Requirement already satisfied: matplotlib>=3.3 in ./anaconda3/lib/python3.10/site-packages (from momi) (3.7.0)
Requirement already satisfied: seaborn in ./anaconda3/lib/python3.10/site-packages (from momi) (0.12.2)
Requirement already satisfied: pysam in ./anaconda3/lib/python3.10/site-packages (from momi) (0.21.0)
Requirement already satisfied: future>=0.15.2 in ./anaconda3/lib/python3.10/site-packages (from autograd>=1.2.0->momi) (0.18.3)
Requirement already satisfied: packaging>=20.0 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (22.0)
Requirement already satisfied: cycler>=0.10 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (4.25.0)
Requirement already satisfied: pyparsing>=2.3.1 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (3.0.9)
Requirement already satisfied: pillow>=6.2.0 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (9.4.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (1.4.4)
Requirement already satisfied: contourpy>=1.0.1 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (1.0.5)
Requirement already satisfied: python-dateutil>=2.7 in ./anaconda3/lib/python3.10/site-packages (from matplotlib>=3.3->momi) (2.8.2)
Requirement already satisfied: demes>=0.2 in ./anaconda3/lib/python3.10/site-packages (from msprime->momi) (0.2.3)
Requirement already satisfied: newick>=1.3.0 in ./anaconda3/lib/python3.10/site-packages (from msprime->momi) (1.9.0)
Requirement already satisfied: tskit>=0.4.0 in ./anaconda3/lib/python3.10/site-packages (from msprime->momi) (0.5.5)
Requirement already satisfied: pytz>=2020.1 in ./anaconda3/lib/python3.10/site-packages (from pandas->momi) (2022.7)
Requirement already satisfied: cython in ./anaconda3/lib/python3.10/site-packages (from pysam->momi) (0.29.34)
Requirement already satisfied: ruamel.yaml>=0.15.78 in ./anaconda3/lib/python3.10/site-packages (from demes>=0.2->msprime->momi) (0.17.21)
Requirement already satisfied: attrs>=20.3.0 in ./anaconda3/lib/python3.10/site-packages (from demes>=0.2->msprime->momi) (22.1.0)
Requirement already satisfied: six>=1.5 in ./anaconda3/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=3.3->momi) (1.16.0)
Requirement already satisfied: jsonschema>=3.0.0 in ./anaconda3/lib/python3.10/site-packages (from tskit>=0.4.0->msprime->momi) (4.17.3)
Requirement already satisfied: svgwrite>=1.1.10 in ./anaconda3/lib/python3.10/site-packages (from tskit>=0.4.0->msprime->momi) (1.4.3)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in ./anaconda3/lib/python3.10/site-packages (from jsonschema>=3.0.0->tskit>=0.4.0->msprime->momi) (0.18.0)
Requirement already satisfied: ruamel.yaml.clib>=0.2.6 in ./anaconda3/lib/python3.10/site-packages (from ruamel.yaml>=0.15.78->demes>=0.2->msprime->momi) (0.2.6)
Building wheels for collected packages: momi
Building wheel for momi (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [93 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.1-arm64-cpython-310
creating build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/moran_model.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/compute_sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/concatenate_datasets.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/sfs_stats.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/util.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/confidence_region.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/events.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demo_model.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/read_vcf.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/optimizers.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/math_functions.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demo_plotter.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/likelihood.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/extract_sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/size_history.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demography.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
creating build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
copying momi/einsum2/einsum2.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
copying momi/einsum2/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
creating build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/configurations.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/convert.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/compressed_counts.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/tensor.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/snps.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
running build_ext
building 'momi.convolution' extension
creating build/temp.macosx-11.1-arm64-cpython-310
creating build/temp.macosx-11.1-arm64-cpython-310/momi
/opt/homebrew/opt/llvm/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/caoqi/anaconda3/include -arch arm64 -fPIC -O2 -isystem /Users/caoqi/anaconda3/include -arch arm64 -I/Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include -I/Users/caoqi/anaconda3/include/python3.10 -c momi/convolution.c -o build/temp.macosx-11.1-arm64-cpython-310/momi/convolution.o -fopenmp
In file included from momi/convolution.c:709:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948:
/Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
momi/convolution.c:2069:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:2069:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:2491:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:2491:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3010:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3010:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3534:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3534:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3939:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3939:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:4294:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:4294:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
7 warnings generated.
/opt/homebrew/opt/llvm/bin/clang -bundle -undefined dynamic_lookup -Wl,-rpath,/Users/caoqi/anaconda3/lib -L/Users/caoqi/anaconda3/lib -Wl,-rpath,/Users/caoqi/anaconda3/lib -L/Users/caoqi/anaconda3/lib build/temp.macosx-11.1-arm64-cpython-310/momi/convolution.o -o build/lib.macosx-11.1-arm64-cpython-310/momi/convolution.cpython-310-darwin.so -fopenmp
ld: can't re-map file, errno=22 file '/opt/homebrew/Cellar/llvm/16.0.3/lib/clang/16/lib/darwin/libclang_rt.osx.a' for architecture arm64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/opt/homebrew/opt/llvm/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for momi
Running setup.py clean for momi
Failed to build momi
Installing collected packages: momi
Running setup.py install for momi ... error
error: subprocess-exited-with-error
× Running setup.py install for momi did not run successfully.
│ exit code: 1
╰─> [95 lines of output]
running install
/Users/caoqi/anaconda3/lib/python3.10/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.macosx-11.1-arm64-cpython-310
creating build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/moran_model.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/compute_sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/concatenate_datasets.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/sfs_stats.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/util.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/confidence_region.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/events.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demo_model.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/read_vcf.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/optimizers.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/math_functions.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demo_plotter.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/likelihood.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/extract_sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/size_history.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
copying momi/demography.py -> build/lib.macosx-11.1-arm64-cpython-310/momi
creating build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
copying momi/einsum2/einsum2.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
copying momi/einsum2/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/einsum2
creating build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/configurations.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/sfs.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/convert.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/__init__.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/compressed_counts.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/tensor.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
copying momi/data/snps.py -> build/lib.macosx-11.1-arm64-cpython-310/momi/data
running build_ext
building 'momi.convolution' extension
creating build/temp.macosx-11.1-arm64-cpython-310
creating build/temp.macosx-11.1-arm64-cpython-310/momi
/opt/homebrew/opt/llvm/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/caoqi/anaconda3/include -arch arm64 -fPIC -O2 -isystem /Users/caoqi/anaconda3/include -arch arm64 -I/Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include -I/Users/caoqi/anaconda3/include/python3.10 -c momi/convolution.c -o build/temp.macosx-11.1-arm64-cpython-310/momi/convolution.o -fopenmp
In file included from momi/convolution.c:709:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948:
/Users/caoqi/anaconda3/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
momi/convolution.c:2069:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:2069:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:2491:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:2491:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3010:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3010:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3534:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3534:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:3939:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:3939:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
momi/convolution.c:4294:23: warning: code will never be executed [-Wunreachable-code]
if ((1 == 0)) abort();
^~~~~
momi/convolution.c:4294:14: note: silence by adding parentheses to mark code as explicitly dead
if ((1 == 0)) abort();
^
/* DISABLES CODE */ ( )
7 warnings generated.
/opt/homebrew/opt/llvm/bin/clang -bundle -undefined dynamic_lookup -Wl,-rpath,/Users/caoqi/anaconda3/lib -L/Users/caoqi/anaconda3/lib -Wl,-rpath,/Users/caoqi/anaconda3/lib -L/Users/caoqi/anaconda3/lib build/temp.macosx-11.1-arm64-cpython-310/momi/convolution.o -o build/lib.macosx-11.1-arm64-cpython-310/momi/convolution.cpython-310-darwin.so -fopenmp
ld: can't re-map file, errno=22 file '/opt/homebrew/Cellar/llvm/16.0.3/lib/clang/16/lib/darwin/libclang_rt.osx.a' for architecture arm64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/opt/homebrew/opt/llvm/bin/clang' failed with exit code 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.
╰─> momi
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Dear all,
I have been trying to install momi on my MAC without success. I followed the commands as suggested on the website, and got the following error that I don't quite understand.
I noticed issue #50 about building failures on MAC, but I guess my problem is a different one, since it doesn't seem to be related to the library issue? I wonder if this seems solvable. Thank you very much in advance.
FYI, my MAC is MBP (13-inch, M1, 2020), macOS Big Sur 11.5.2. My python version is 3.10.9, my numpy version is 1.23.5, my gcc version is 13.1.0.
Best regards, Caoqi