Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytraj not compatible with osx-arm64 arch #143

Open
1 task done
xiki-tempula opened this issue May 28, 2024 · 1 comment
Open
1 task done

pytraj not compatible with osx-arm64 arch #143

xiki-tempula opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xiki-tempula
Copy link
Contributor

xiki-tempula commented May 28, 2024

Also posted in the pytraj issue Amber-MD/pytraj#1654

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

If I tried to install pytraj through the ambertools from conda-forge I will get the error

In [1]: import pytraj
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import pytraj

File ~/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/__init__.py:24
     22 from .utils import c_commands
     23 from .utils import tools
---> 24 from .utils.misc import info
     25 from .utils.cyutils import _fast_iterptr as iterframe_from_array
     26 from .core.c_options import info as compiled_info

File ~/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/utils/misc.py:7
      5 import os
      6 from glob import glob
----> 7 from pytraj.core.c_options import set_world_silent
      9 from .context import capture_stdout
     11 try:

File ~/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/core/__init__.py:2
      1 """"""
----> 2 from .topology_objects import Atom, Residue, Molecule
      3 from .box import Box
      4 from .elements import mass_atomic_number_dict, mass_element_dict

ImportError: dlopen(/Users/zwu/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/core/topology_objects.cpython-312-darwin.so, 0x0002): tried: '/Users/zwu/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/core/topology_objects.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/zwu/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/core/topology_objects.cpython-312-darwin.so' (no such file), '/Users/zwu/miniconda3/envs/ambertools/lib/python3.12/site-packages/pytraj/core/topology_objects.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

This is how I set up the env
conda create -n ambertools ambertools ipython

Installed packages

ambertools                23.6            nompi_py312hcf35e4f_102    conda-forge
amberutils                21.0                     pypi_0    pypi
arpack                    3.8.0           nompi_ha3438d0_101    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
blosc                     1.21.5               h9c252e8_1    conda-forge
brotli                    1.1.0                hb547adb_1    conda-forge
brotli-bin                1.1.0                hb547adb_1    conda-forge
bzip2                     1.0.8                h93a5062_5    conda-forge
c-ares                    1.28.1               h93a5062_0    conda-forge
ca-certificates           2024.2.2             hf0a4a13_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
contourpy                 1.2.1           py312h0fef576_0    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
edgembar                  0.2                      pypi_0    pypi
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
fftw                      3.3.10          nompi_h3046061_108    conda-forge
fonttools                 4.52.4          py312h7e5086c_0    conda-forge
freetype                  2.12.1               hadb7bae_2    conda-forge
hdf4                      4.2.15               h2ee6834_7    conda-forge
hdf5                      1.14.3          nompi_h751145d_101    conda-forge
icu                       73.2                 hc8870d7_0    conda-forge
ipython                   8.24.0             pyh707e725_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
joblib                    1.4.2              pyhd8ed1ab_0    conda-forge
kiwisolver                1.4.5           py312h389731b_1    conda-forge
krb5                      1.21.2               h92f50d5_0    conda-forge
lcms2                     2.16                 ha0e7c42_0    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libaec                    1.1.3                hebf3989_0    conda-forge
libblas                   3.9.0           22_osxarm64_openblas    conda-forge
libboost                  1.84.0               h17eb2be_3    conda-forge
libbrotlicommon           1.1.0                hb547adb_1    conda-forge
libbrotlidec              1.1.0                hb547adb_1    conda-forge
libbrotlienc              1.1.0                hb547adb_1    conda-forge
libcblas                  3.9.0           22_osxarm64_openblas    conda-forge
libcurl                   8.8.0                h7b6f9a7_0    conda-forge
libcxx                    17.0.6               h5f092b4_0    conda-forge
libdeflate                1.20                 h93a5062_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h93a5062_2    conda-forge
libexpat                  2.6.2                hebf3989_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
libiconv                  1.17                 h0d3ecfb_2    conda-forge
libjpeg-turbo             3.0.0                hb547adb_1    conda-forge
liblapack                 3.9.0           22_osxarm64_openblas    conda-forge
libnetcdf                 4.9.2           nompi_h291a7c2_113    conda-forge
libnghttp2                1.58.0               ha4dd798_1    conda-forge
libopenblas               0.3.27          openmp_h6c19121_0    conda-forge
libpng                    1.6.43               h091b4b1_0    conda-forge
libsqlite                 3.45.3               h091b4b1_0    conda-forge
libssh2                   1.11.0               h7a5bd25_0    conda-forge
libtiff                   4.6.0                h07db509_3    conda-forge
libwebp-base              1.4.0                h93a5062_0    conda-forge
libxcb                    1.15                 hf346824_0    conda-forge
libxml2                   2.12.7               ha661575_0    conda-forge
libzip                    1.10.1               ha0bc3c6_3    conda-forge
libzlib                   1.2.13               hfb2fe0b_6    conda-forge
llvm-openmp               18.1.6               hde57baf_0    conda-forge
lz4-c                     1.9.4                hb7217d7_0    conda-forge
matplotlib-base           3.8.4           py312h4479663_2    conda-forge
matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
ncurses                   6.5                  hb89a1cb_0    conda-forge
netcdf-fortran            4.6.1           nompi_he6a98ad_103    conda-forge
numpy                     1.26.4          py312h8442bc7_0    conda-forge
openjpeg                  2.5.2                h9f1df11_0    conda-forge
openssl                   3.3.0                hfb2fe0b_3    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
packmol-memgen            2024.2.9                 pypi_0    pypi
pandas                    2.2.2           py312h8ae5369_1    conda-forge
parmed                    4.2.2           py312h20a0b95_1    conda-forge
parso                     0.8.4              pyhd8ed1ab_0    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
perl                      5.32.1          7_h4614cfb_perl5    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.3.0          py312h8a801b1_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
pthread-stubs             0.4               h27ca646_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
pymsmt                    22.0                     pypi_0    pypi
pyparsing                 3.1.2              pyhd8ed1ab_0    conda-forge
python                    3.12.3          h4a7b5fc_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
sander                    22.0                     pypi_0    pypi
scipy                     1.13.1          py312h14ffa8f_0    conda-forge
setuptools                70.0.0             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.2.0                hd04f947_1    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
typing_extensions         4.11.0             pyha770c72_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
xorg-kbproto              1.0.7             h27ca646_1002    conda-forge
xorg-libice               1.1.1                hb547adb_0    conda-forge
xorg-libsm                1.2.4                hb547adb_0    conda-forge
xorg-libx11               1.8.9                h570a39f_0    conda-forge
xorg-libxau               1.0.11               hb547adb_0    conda-forge
xorg-libxdmcp             1.1.3                h27ca646_0    conda-forge
xorg-libxext              1.3.4                h1a8c8d9_2    conda-forge
xorg-libxt                1.3.0                hb547adb_1    conda-forge
xorg-xextproto            7.3.0             h1a8c8d9_1003    conda-forge
xorg-xproto               7.0.31            h27ca646_1007    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zlib                      1.2.13               hfb2fe0b_6    conda-forge
zstd                      1.5.6                hb46c0d2_0    conda-forge

Environment info

active environment : ambertools
    active env location : /Users/zwu/miniconda3/envs/ambertools
            shell level : 2
       user config file : /Users/zwu/.condarc
 populated config files : 
          conda version : 24.5.0
    conda-build version : 24.5.0
         python version : 3.12.2.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.5.0=0
                          __osx=14.4.1=0
                          __unix=0=0
       base environment : /Users/zwu/miniconda3  (writable)
      conda av data dir : /Users/zwu/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/zwu/miniconda3/pkgs
                          /Users/zwu/.conda/pkgs
       envs directories : /Users/zwu/miniconda3/envs
                          /Users/zwu/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.5.0 requests/2.31.0 CPython/3.12.2 Darwin/23.4.0 OSX/14.4.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8 aau/0.4.4 c/. s/. e/.
                UID:GID : 502:20
             netrc file : None
           offline mode : False
@xiki-tempula xiki-tempula added the bug Something isn't working label May 28, 2024
@xiki-tempula
Copy link
Contributor Author

There seems to be some warning in the build process. https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=926796&view=logs&jobId=266f534b-1ce7-58d0-3a65-1de47ed517a3&j=266f534b-1ce7-58d0-3a65-1de47ed517a3&t=f6d6a041-258d-5cb2-03c5-b120fb5fdeff

clang++ -bundle -undefined dynamic_lookup -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -Wl,-rpath,@loader_path/../../../.. -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -fPIE -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/ambertools-23.6 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -D_FORTIFY_SOURCE=2 -isystem $PREFIX/include -mmacosx-version-min=11.0 -mmacosx-version-min=11.0 $SRC_DIR/build_host_tools/build/AmberTools/src/pytraj/CMakeFiles/python-build/temp.macosx-11.0-arm64-cpython-310/pytraj/core/topology_objects.o -L$SRC_DIR/build_host_tools/build/AmberTools/src/cpptraj/src -lcpptraj -o $SRC_DIR/build_host_tools/build/AmberTools/src/pytraj/CMakeFiles/python-build/lib.macosx-11.0-arm64-cpython-310/pytraj/core/topology_objects.cpython-310-darwin.so -O0 -ggdb
2024-05-03T14:34:58.8935650Z ld: warning: -pie being ignored. It is only used when linking a main executable
2024-05-03T14:34:58.8937780Z ld: warning: ignoring file /Users/runner/miniforge3/conda-bld/ambertools_1714742026204/work/build_host_tools/build/AmberTools/src/pytraj/CMakeFiles/python-build/temp.macosx-11.0-arm64-cpython-310/pytraj/core/topology_objects.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
2024-05-03T14:34:58.8940380Z ld: warning: ignoring file /Users/runner/miniforge3/conda-bld/ambertools_1714742026204/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libc++.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
2024-05-03T14:34:58.8942390Z ld: warning: ignoring file /Users/runner/miniforge3/conda-bld/ambertools_1714742026204/work/build_host_tools/build/AmberTools/src/cpptraj/src/libcpptraj.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

This problem could be fixed by running https://github.com/conda-forge/ambertools-feedstock/blob/main/build-locally.py to build it nativly on a M1 mac then copy the build pytraj across. Like

cp -r /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1717574254335/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.10/site-packages/pytraj /Users/zwu/miniconda3/envs/ambertools/lib/python3.10/site-packages/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant