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

Segmentation Fault on ARM MacOS #186

Closed
SeyedMohamadMoosavi opened this issue Nov 26, 2022 · 34 comments
Closed

Segmentation Fault on ARM MacOS #186

SeyedMohamadMoosavi opened this issue Nov 26, 2022 · 34 comments

Comments

@SeyedMohamadMoosavi
Copy link

Installed the package using conda in a clean conda environment on MacOS Ventura M1 Pro Chip.

conda install -c conda-forge control slycot

However, I get segmentation fault after importing control:
import control
output is:

[1] 11822 segmentation fault python

@murrayrm
Copy link
Member

Can you post the results of conda info. I'd like to see what architecture is being used.

@murrayrm murrayrm changed the title Segmentation Fault on MacOS - Python 3.9 Segmentation Fault on MacOS Ventura - Python 3.9 Nov 26, 2022
@SeyedMohamadMoosavi
Copy link
Author

SeyedMohamadMoosavi commented Nov 26, 2022

Here is log:

           shell level : 2
       user config file : /Users/USER/.condarc
 populated config files : /Users/USER/.condarc
          conda version : 22.9.0
    conda-build version : not installed
         python version : 3.8.15.final.0
       virtual packages : __osx=13.0.1=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/USER/miniconda3  (writable)
      conda av data dir : /Users/USER/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
                          https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/USER/miniconda3/pkgs
                          /Users/USER/.conda/pkgs
       envs directories : /Users/USER/miniconda3/envs
                          /Users/USER/.conda/envs
               platform : osx-arm64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.8.15 Darwin/22.1.0 OSX/13.0.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False

@murrayrm
Copy link
Member

That all looks OK. Can you run conda list -c and post. That will show which versions of various packages are installed and where they came from.

@SeyedMohamadMoosavi
Copy link
Author

conda-forge/noarch::anyio-3.6.2-pyhd8ed1ab_0
conda-forge/noarch::appnope-0.1.3-pyhd8ed1ab_0
conda-forge/osx-arm64::argon2-cffi-21.1.0-py39h5161555_0
conda-forge/noarch::asttokens-2.1.0-pyhd8ed1ab_0
defaults/osx-arm64::attrs-22.1.0-py39hca03da5_0
conda-forge/noarch::babel-2.11.0-pyhd8ed1ab_0
conda-forge/noarch::backcall-0.2.0-pyh9f0ad1d_0
conda-forge/noarch::backports-1.0-pyhd8ed1ab_3
conda-forge/noarch::backports.functools_lru_cache-1.6.4-pyhd8ed1ab_0
conda-forge/noarch::beautifulsoup4-4.11.1-pyha770c72_0
conda-forge/osx-arm64::blas-2.116-openblas
conda-forge/osx-arm64::blas-devel-3.9.0-16_osxarm64_openblas
conda-forge/noarch::bleach-5.0.1-pyhd8ed1ab_0
defaults/osx-arm64::bottleneck-1.3.5-py39heec5a64_0
defaults/osx-arm64::brotli-1.0.9-h1a28f6b_7
defaults/osx-arm64::brotli-bin-1.0.9-h1a28f6b_7
conda-forge/osx-arm64::brotlipy-0.7.0-py39h5161555_1001
defaults/osx-arm64::bzip2-1.0.8-h620ffc9_4
conda-forge/osx-arm64::ca-certificates-2022.9.24-h4653dfc_0
conda-forge/noarch::certifi-2022.9.24-pyhd8ed1ab_0
defaults/osx-arm64::cffi-1.15.1-py39h80987f9_2
conda-forge/noarch::charset-normalizer-2.1.1-pyhd8ed1ab_0
conda-forge/noarch::control-0.9.2-pyhd8ed1ab_0
defaults/osx-arm64::cryptography-38.0.1-py39h834c97f_0
defaults/noarch::cycler-0.11.0-pyhd3eb1b0_0
conda-forge/noarch::decorator-5.1.1-pyhd8ed1ab_0
conda-forge/noarch::defusedxml-0.7.1-pyhd8ed1ab_0
conda-forge/noarch::entrypoints-0.4-pyhd8ed1ab_0
conda-forge/noarch::executing-1.2.0-pyhd8ed1ab_0
conda-forge/osx-arm64::fftw-3.3.10-nompi_h3046061_4
defaults/noarch::fonttools-4.25.0-pyhd3eb1b0_0
defaults/osx-arm64::freetype-2.12.1-h1192e45_0
defaults/osx-arm64::giflib-5.2.1-h1a28f6b_0
defaults/osx-arm64::gmp-6.2.1-hc377ac9_3
defaults/osx-arm64::gmpy2-2.1.2-py39h8c48613_0
conda-forge/noarch::idna-3.4-pyhd8ed1ab_0
conda-forge/noarch::importlib-metadata-5.1.0-pyha770c72_0
conda-forge/noarch::importlib_resources-5.10.0-pyhd8ed1ab_0
defaults/noarch::iniconfig-1.1.1-pyhd3eb1b0_0
conda-forge/osx-arm64::ipykernel-5.5.5-py39h32adebf_0
defaults/osx-arm64::ipython-8.6.0-py39hca03da5_0
conda-forge/noarch::ipython_genutils-0.2.0-py_1
conda-forge/noarch::jedi-0.18.2-pyhd8ed1ab_0
conda-forge/noarch::jinja2-3.1.2-pyhd8ed1ab_1
defaults/osx-arm64::jpeg-9e-h1a28f6b_0
conda-forge/noarch::json5-0.9.5-pyh9f0ad1d_0
conda-forge/noarch::jsonschema-4.17.1-pyhd8ed1ab_0
conda-forge/noarch::jupyter_client-7.4.7-pyhd8ed1ab_0
defaults/osx-arm64::jupyter_core-4.11.2-py39hca03da5_0
conda-forge/noarch::jupyter_server-1.23.3-pyhd8ed1ab_0
conda-forge/noarch::jupyterlab-3.5.0-pyhd8ed1ab_0
conda-forge/noarch::jupyterlab_pygments-0.2.2-pyhd8ed1ab_0
conda-forge/noarch::jupyterlab_server-2.16.3-pyhd8ed1ab_0
defaults/osx-arm64::kiwisolver-1.4.2-py39hc377ac9_0
defaults/osx-arm64::lcms2-2.12-hba8e193_0
defaults/osx-arm64::lerc-3.0-hc377ac9_0
conda-forge/osx-arm64::libblas-3.9.0-16_osxarm64_openblas
defaults/osx-arm64::libbrotlicommon-1.0.9-h1a28f6b_7
defaults/osx-arm64::libbrotlidec-1.0.9-h1a28f6b_7
defaults/osx-arm64::libbrotlienc-1.0.9-h1a28f6b_7
conda-forge/osx-arm64::libcblas-3.9.0-16_osxarm64_openblas
defaults/osx-arm64::libcxx-14.0.6-h848a8c0_0
defaults/osx-arm64::libdeflate-1.8-h1a28f6b_5
defaults/osx-arm64::libffi-3.4.2-hca03da5_6
conda-forge/osx-arm64::libgfortran-5.0.0-11_3_0_hd922786_26
conda-forge/osx-arm64::libgfortran5-11.3.0-hdaf2cc0_26
conda-forge/osx-arm64::liblapack-3.9.0-16_osxarm64_openblas
conda-forge/osx-arm64::liblapacke-3.9.0-16_osxarm64_openblas
conda-forge/osx-arm64::libopenblas-0.3.21-openmp_hc731615_3
defaults/osx-arm64::libpng-1.6.37-hb8d0fd4_0
conda-forge/osx-arm64::libsodium-1.0.18-h27ca646_1
conda-forge/osx-arm64::libsqlite-3.40.0-h76d750c_0
defaults/osx-arm64::libtiff-4.4.0-h2fd578a_2
defaults/osx-arm64::libwebp-1.2.4-h68602c7_0
defaults/osx-arm64::libwebp-base-1.2.4-h1a28f6b_0
conda-forge/osx-arm64::libzlib-1.2.13-h03a7124_4
conda-forge/osx-arm64::llvm-openmp-15.0.5-h7cfbb63_0
defaults/osx-arm64::lz4-c-1.9.3-hc377ac9_0
defaults/osx-arm64::markupsafe-2.1.1-py39h1a28f6b_0
defaults/osx-arm64::matplotlib-3.5.3-py39hca03da5_0
defaults/osx-arm64::matplotlib-base-3.5.3-py39hc377ac9_0
conda-forge/noarch::matplotlib-inline-0.1.6-pyhd8ed1ab_0
conda-forge/noarch::mistune-2.0.4-pyhd8ed1ab_0
defaults/osx-arm64::mpc-1.1.0-h8c48613_1
defaults/osx-arm64::mpfr-4.0.2-h695f6f0_1
defaults/osx-arm64::mpmath-1.2.1-py39hca03da5_0
defaults/noarch::munkres-1.1.4-py_0
conda-forge/noarch::nbclassic-0.4.8-pyhd8ed1ab_0
conda-forge/noarch::nbclient-0.7.0-pyhd8ed1ab_0
conda-forge/noarch::nbconvert-7.2.5-pyhd8ed1ab_0
conda-forge/noarch::nbconvert-core-7.2.5-pyhd8ed1ab_0
conda-forge/noarch::nbconvert-pandoc-7.2.5-pyhd8ed1ab_0
conda-forge/noarch::nbformat-5.7.0-pyhd8ed1ab_0
defaults/osx-arm64::ncurses-6.3-h1a28f6b_3
conda-forge/noarch::nest-asyncio-1.5.6-pyhd8ed1ab_0
conda-forge/noarch::notebook-6.5.2-pyha770c72_1
conda-forge/noarch::notebook-shim-0.2.2-pyhd8ed1ab_0
defaults/osx-arm64::numexpr-2.8.4-py39h79ee842_0
conda-forge/osx-arm64::numpy-1.23.5-py39hefdcf20_0
conda-forge/osx-arm64::openblas-0.3.21-openmp_hf78f355_3
conda-forge/osx-arm64::openssl-1.1.1s-h03a7124_0
defaults/noarch::packaging-21.3-pyhd3eb1b0_0
defaults/osx-arm64::pandas-1.5.1-py39h78102c4_0
conda-forge/osx-arm64::pandoc-2.19.2-hce30654_1
conda-forge/noarch::pandocfilters-1.5.0-pyhd8ed1ab_0
conda-forge/noarch::parso-0.8.3-pyhd8ed1ab_0
defaults/osx-arm64::patsy-0.5.2-py39hca03da5_1
conda-forge/noarch::pexpect-4.8.0-pyh1a96a4e_2
conda-forge/noarch::pickleshare-0.7.5-py_1003
defaults/osx-arm64::pillow-9.2.0-py39h4d1bdd5_1
defaults/osx-arm64::pip-22.2.2-py39hca03da5_0
conda-forge/noarch::pkgutil-resolve-name-1.3.10-pyhd8ed1ab_0
defaults/osx-arm64::pluggy-1.0.0-py39hca03da5_1
conda-forge/noarch::prometheus_client-0.15.0-pyhd8ed1ab_0
conda-forge/noarch::prompt-toolkit-3.0.33-pyha770c72_0
conda-forge/noarch::ptyprocess-0.7.0-pyhd3deb0d_0
conda-forge/noarch::pure_eval-0.2.2-pyhd8ed1ab_0
defaults/noarch::py-1.11.0-pyhd3eb1b0_0
conda-forge/noarch::pycparser-2.21-pyhd8ed1ab_0
conda-forge/noarch::pygments-2.13.0-pyhd8ed1ab_0
conda-forge/noarch::pyopenssl-22.1.0-pyhd8ed1ab_0
defaults/osx-arm64::pyparsing-3.0.9-py39hca03da5_0
defaults/osx-arm64::pyrsistent-0.18.0-py39h1a28f6b_0
conda-forge/noarch::pysocks-1.7.1-pyha2e5f31_6
defaults/osx-arm64::pytest-7.1.2-py39hca03da5_0
conda-forge/osx-arm64::python-3.9.15-h2d96c93_0_cpython
defaults/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0
conda-forge/noarch::python-fastjsonschema-2.16.2-pyhd8ed1ab_0
conda-forge/osx-arm64::python_abi-3.9-2_cp39
defaults/osx-arm64::pytz-2022.1-py39hca03da5_0
defaults/osx-arm64::pyzmq-23.2.0-py39hc377ac9_0
defaults/osx-arm64::readline-8.2-h1a28f6b_0
conda-forge/noarch::requests-2.28.1-pyhd8ed1ab_1
defaults/osx-arm64::scipy-1.9.3-py39h9d039d2_0
conda-forge/noarch::send2trash-1.8.0-pyhd8ed1ab_0
defaults/osx-arm64::setuptools-65.5.0-py39hca03da5_0
defaults/noarch::six-1.16.0-pyhd3eb1b0_1
conda-forge/osx-arm64::slycot-0.5.2-py39hb3be402_0
conda-forge/noarch::sniffio-1.3.0-pyhd8ed1ab_0
conda-forge/noarch::soupsieve-2.3.2.post1-pyhd8ed1ab_0
defaults/osx-arm64::sqlite-3.40.0-h7a7dc30_0
conda-forge/noarch::stack_data-0.6.1-pyhd8ed1ab_0
defaults/osx-arm64::sympy-1.11.1-py39hca03da5_0
pypi/pypi::tbcontrol-0.2.1-pypi_0
conda-forge/noarch::terminado-0.17.0-pyhd1c38e8_0
conda-forge/noarch::tinycss2-1.2.1-pyhd8ed1ab_0
defaults/osx-arm64::tk-8.6.12-hb8d0fd4_0
defaults/osx-arm64::tomli-2.0.1-py39hca03da5_0
defaults/osx-arm64::tornado-6.2-py39h1a28f6b_0
pypi/pypi::tqdm-4.64.1-pypi_0
conda-forge/noarch::traitlets-5.5.0-pyhd8ed1ab_0
conda-forge/noarch::typing_extensions-4.4.0-pyha770c72_0
defaults/noarch::tzdata-2022f-h04d1e81_0
conda-forge/noarch::urllib3-1.26.13-pyhd8ed1ab_0
conda-forge/noarch::wcwidth-0.2.5-pyh9f0ad1d_2
conda-forge/noarch::webencodings-0.5.1-py_1
conda-forge/noarch::websocket-client-1.4.2-pyhd8ed1ab_0
defaults/noarch::wheel-0.37.1-pyhd3eb1b0_0
defaults/osx-arm64::xz-5.2.6-h1a28f6b_0
conda-forge/osx-arm64::zeromq-4.3.4-hbdafb3b_1
conda-forge/noarch::zipp-3.10.0-pyhd8ed1ab_0
conda-forge/osx-arm64::zlib-1.2.13-h03a7124_4
defaults/osx-arm64::zstd-1.5.2-h8574219_0

@murrayrm
Copy link
Member

I'm guessing that the problem may be with slycot, since the control package itself is just pure python. Can you try running conda remove --force slycot (should remove slycot but nothing else) and then see if you can import control?

Note: this may screw up your conda environment, so if you are using this environment for other things, you might want to create a new one first.

@murrayrm
Copy link
Member

Actually, another thing to try first: see if import slycot causes a segmentation fault.

@SeyedMohamadMoosavi
Copy link
Author

Yes! import slycot causes segmentation fault.

@murrayrm
Copy link
Member

OK, we should move this issue over to the slycot issues list so the group there can have a look. I'll do that and post the info from here.

@murrayrm murrayrm closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2022
@murrayrm murrayrm transferred this issue from python-control/python-control Nov 26, 2022
@murrayrm murrayrm reopened this Nov 26, 2022
@murrayrm
Copy link
Member

@SeyedMohamadMoosavi FYI, I have moved this to slycot.

@bnavigator @roryyorke Any ideas about what might be happening on MacOS Ventura?

@bnavigator
Copy link
Collaborator

Probably another problem with the cross-compilation for macOS arm on the conda-forge/slycot-feedstock. Maybe @isuruf or someone else from @conda-forge/help-osx-arm64 has an idea how to debug this.

@bnavigator
Copy link
Collaborator

conda-forge/simpleitk-feedstock#27 mentions our struggle with the slycot-feedstock and has yet another fix.

@bnavigator
Copy link
Collaborator

@SeyedMohamadMoosavi do you get a similar segmentation fault when you install an older slycot version with conda install slycot=0.5.0.0 (osx-arm64/slycot-0.5.0.0-py39hb3be402_2.tar.bz2)?

@SeyedMohamadMoosavi
Copy link
Author

yes, I get the same error.

@bnavigator
Copy link
Collaborator

Can you please try the new slycot 0.5.3 to be published on conda-forge shortly?

Also, please make sure to install everything from conda-forge. No mixins of packages from "normal" anaconda.

@SeyedMohamadMoosavi
Copy link
Author

I get the same error.
What I did:
conda create -n pycontrol python=3.9
conda activate pycontrol
conda install -c conda-forge slycot=0.5.3
conda install -c conda-forge control

@bnavigator bnavigator changed the title Segmentation Fault on MacOS Ventura - Python 3.9 Segmentation Fault on ARM MacOS Feb 1, 2023
@bnavigator
Copy link
Collaborator

Without an M1 or M2 at hand, it is hard to debug these errors.

Do we have reports of functioning Mac on Arm installs? @murrayrm, @sawyerbfuller, you have Macs right?

@SeyedMohamadMoosavi, @bdube-jpl

If you are able to collect a crash-report with debugger symbols that would be highly appreciated.

Also, one might try to compile Slycot locally on the Mac and see if that is different. See https://github.com/python-control/Slycot#using-the-conda-recipe for instructions.

@bnavigator
Copy link
Collaborator

This would be a command to create a conda environent with strictly conda-forge packages, no packages from main:

conda create \
     --name control-env \
     --channel conda-forge \
     --strict-channel-priority \
     control slycot

@murrayrm
Copy link
Member

murrayrm commented Feb 1, 2023

I was able to install slycot from conda-forge on an M1 mac, but running MacOS 12.6.2 (Monterey). So it might be something in Ventura.

@bnavigator
Copy link
Collaborator

There is also still a possible difference between Conda/Python for native Arm and with Rosetta, if I am not mistaken?

@bdube-jpl
Copy link

Here's some, hopefully, complete info

Create a minimum environment with conda,

conda create -n controlcrash python=3.10 control slycot

if it matters, I have CONDA_SUBDIR=osx-arm64 set.

At the moment, that grabs

control conda-forge/noarch::control-0.9.3.post2-pyhd8ed1ab_0
slycot  conda-forge/osx-arm64::slycot-0.5.3-py310h6accbbb_0

I can post the transitive dependency versions too, if that is interesting. All of them come from conda-forge, none from the main channel, or any others.

There is also still a possible difference between Conda/Python for native Arm and with Rosetta, if I am not mistaken?

The conda installer is available in native form, and with the CONDA_SUBDIR env var above, you can instruct it to only install either native packages, or noarch packages.

If anyone else wishes to reproduce, I had to follow this page to enable core dumps. This will reproduce, as long as your username is bdube and you use controlcrash as the environment name:

/usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" /Users/bdube/miniconda3/envs/controlcrash/bin/python.entitlements
codesign -s - -f --entitlements /Users/bdube/miniconda3/envs/controlcrash/bin/python.entitlements /Users/bdube/miniconda3/envs/controlcrash/bin/python

apparently /bin can't make core dumps, so I used the full path to python:

/Users/bdube/miniconda3/envs/controlcrash/bin/python -c "import slycot"
[1]    99299 segmentation fault (core dumped)  /Users/bdube/miniconda3/envs/controlcrash/bin/python -c "import slycot"

The core file is here -- I don't think I can attach a 3.6GB file to github. If there is an issue, please let me know and I'll upload it elsewhere. Please share it within an intranet, if developers share a network -- I'll have to pay for egress if the file gets downloaded too many times (too many ~=50/mo).


Self building, I cloned slycot, which gets master:773c893a79abd10c2ada7c138ad7d3f3bac6480c. I created an environment a bit differently to the README -- the asterisk syntax for libblas, etc, is no longer compatible with the current conda (I have 23.1.0)

conda create -n controlcrashselfbuild -c conda-forge python=3.10 numpy scipy scikit-build libblas liblapack gfortran pytest

I'm not sure if the setup/pyproject/etc files are broken, but pip goes rogue (as it is wont to do, sigh):

python -m pip install -v .
Using pip 23.0 from /Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/pip (python 3.10)
Processing /Users/bdube/src/Slycot
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=45
    Using cached setuptools-67.1.0-py3-none-any.whl (1.1 MB)
  Collecting setuptools_scm>=7
    Using cached setuptools_scm-7.1.0-py3-none-any.whl (43 kB)
  Collecting wheel
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Collecting scikit-build>=0.15
    Using cached scikit_build-0.16.6-py3-none-any.whl (79 kB)
  Collecting cmake>=3.14
    Using cached cmake-3.25.0-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (45.1 MB)
  Collecting numpy!=1.23.0
    Using cached numpy-1.24.1-cp310-cp310-macosx_11_0_arm64.whl (13.9 MB)
  Collecting packaging>=20.0
    Using cached packaging-23.0-py3-none-any.whl (42 kB)
  Collecting tomli>=1.0.0
    Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
  Collecting typing-extensions
    Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB)
  Collecting distro
    Using cached distro-1.8.0-py3-none-any.whl (20 kB)
  Installing collected packages: cmake, wheel, typing-extensions, tomli, setuptools, packaging, numpy, distro, setuptools_scm, scikit-build
  Successfully installed cmake-3.25.0 distro-1.8.0 numpy-1.24.1 packaging-23.0 scikit-build-0.16.6 setuptools-67.1.0 setuptools_scm-7.1.0 tomli-2.0.1 typing-extensions-4.4.0 wheel-0.38.4
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing slycot.egg-info/PKG-INFO
  writing dependency_links to slycot.egg-info/dependency_links.txt
  writing requirements to slycot.egg-info/requires.txt
  writing top-level names to slycot.egg-info/top_level.txt
  reading manifest template 'MANIFEST.in'
  warning: no directories found matching 'slycot/src/SLICOT-Reference'
  adding license file 'AUTHORS'
  writing manifest file 'slycot.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info
  writing /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/dependency_links.txt
  writing requirements to /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/requires.txt
  writing top-level names to /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/top_level.txt
  writing manifest file '/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no directories found matching 'slycot/src/SLICOT-Reference'
  adding license file 'AUTHORS'
  writing manifest file '/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot.egg-info/SOURCES.txt'
  creating '/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-modern-metadata-7rpbbze3/slycot-0.5.4.dev4+g773c893.dist-info'
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages (from slycot==0.5.4.dev4+g773c893) (1.24.1)
Building wheels for collected packages: slycot
  Running command Building wheel for slycot (pyproject.toml)


  --------------------------------------------------------------------------------
  -- Trying 'Ninja' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "/Users/bdube/src/Slycot/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Unix Makefiles' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The Fortran compiler identification is GNU 11.3.0
  -- Checking whether Fortran compiler has -isysroot
  -- Checking whether Fortran compiler has -isysroot - yes
  -- Checking whether Fortran compiler supports OSX deployment target flag
  -- Checking whether Fortran compiler supports OSX deployment target flag - yes
  -- Detecting Fortran compiler ABI info
  -- Detecting Fortran compiler ABI info - done
  -- Check for working Fortran compiler: /Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-gfortran - skipped
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/bdube/src/Slycot/_cmake_test_compile/build
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Unix Makefiles' generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      /Users/bdube/src/Slycot/_skbuild/macosx--arm64-3.10/cmake-build
    Command:
      /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake /Users/bdube/src/Slycot -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/Users/bdube/src/Slycot/_skbuild/macosx--arm64-3.10/cmake-install -DPYTHON_VERSION_STRING:STRING=3.10.8 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPYTHON_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPYTHON_LIBRARY:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/libpython3.10.dylib -DPython_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPython_ROOT_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild -DPython_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPython3_ROOT_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild -DPython3_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/numpy/core/include -DCMAKE_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING= -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

  -- Found Python: /Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python (found version "3.10.8") found components: Interpreter Development NumPy Development.Module Development.Embed
  -- Python headers included from: /Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10
  -- NumPy headers included from: /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/numpy/core/include
  -- F2PY headers included from: /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9etqzf_4/overlay/lib/python3.10/site-packages/numpy/f2py/src;/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9etqzf_4/overlay/lib/python3.10/site-packages/numpy/core/include
  -- LAPACK: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework;-lm;-ldl
  -- BLAS: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework
  _modinit_prefix:PyInit_
  -- Configuring done
  CMake Error at slycot/CMakeLists.txt:654 (add_library):
    Cannot find source file:

      /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9etqzf_4/overlay/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c

    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
    .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


  CMake Error at /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/skbuild/resources/cmake/FindF2PY.cmake:92 (add_library):
    No SOURCES given to target: _f2py_runtime_library
  Call Stack (most recent call first):
    CMakeLists.txt:15 (find_package)


  CMake Error at slycot/CMakeLists.txt:654 (add_library):
    No SOURCES given to target: _wrapper


  CMake Generate step failed.  Build files cannot be regenerated correctly.
  Traceback (most recent call last):
    File "/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 641, in setup
      env = cmkr.configure(
    File "/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 337, in configure
      raise SKBuildError(

  An error occurred while configuring with CMake.
    Command:
      /private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake /Users/bdube/src/Slycot -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/Users/bdube/src/Slycot/_skbuild/macosx--arm64-3.10/cmake-install -DPYTHON_VERSION_STRING:STRING=3.10.8 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPYTHON_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPYTHON_LIBRARY:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/libpython3.10.dylib -DPython_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPython_ROOT_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild -DPython_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python -DPython3_ROOT_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild -DPython3_INCLUDE_DIR:PATH=/Users/bdube/miniconda3/envs/controlcrashselfbuild/include/python3.10 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/private/var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/pip-build-env-9bldmehn/overlay/lib/python3.10/site-packages/numpy/core/include -DCMAKE_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING= -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
    Source directory:
      /Users/bdube/src/Slycot
    Working directory:
      /Users/bdube/src/Slycot/_skbuild/macosx--arm64-3.10/cmake-build
  Please see CMake's output for more information.
  error: subprocess-exited-with-error

  × Building wheel for slycot (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/python /Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/82/rq6mxvbx2jsdhmzdmk90c5jh0000gq/T/tmpcm7is62l
  cwd: /Users/bdube/src/Slycot
  Building wheel for slycot (pyproject.toml) ... error
  ERROR: Failed building wheel for slycot
Failed to build slycot
ERROR: Could not build wheels for slycot, which is required to install pyproject.toml-based projects

pip should not have tried to download/install anything; numpy, etc, are already in site-packages for the python install (via conda). I'm very familiar with pure python packaging (etc), but I'm not sure how to proceed from here with the fortran component. If someone can provide a bit of help, I am happy to continue.

@bnavigator
Copy link
Collaborator

bnavigator commented Feb 1, 2023

Hi @bdube-jpl, thanks for the extensive info!

I am fetching the core right now. Hopefully I can analyze it later this week.

Regarding pip: The new standard way is to build wheels in an isolated environment which needs all the build requirements as wheels. There is the --no-build-isolation flag to disable that. The displayed error is because of missing numpy files. They belong to f2py. Without the build-isolation, cmake should be able to find the files from the conda environment.

Did you try the conda-recipe from the repository? It should be executable with a current conda, we test it (with mambaforge) on the CI:

- name: Checkout Slycot
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
activate-environment: build-env
environment-file: .github/conda-env/build-env.yml
miniforge-version: latest
miniforge-variant: Mambaforge
channel-priority: strict
auto-update-conda: false
auto-activate-base: false
- name: Conda build
shell: bash -l {0}
run: |
set -e
numpyversion=$(python -c 'import numpy; print(numpy.version.version)')
conda mambabuild --python "${{ matrix.python }}" --numpy $numpyversion conda-recipe

Also there is https://github.com/conda-forge/slycot-feedstock/blob/main/recipe/build.sh for a reference of tweaks

@bdube-jpl
Copy link

The actual compilation worked (I assume), but there is some setup issue still.

 copying _skbuild/macosx--arm64-3.10/setuptools/lib.macosx--arm64-cpython-310/slycot/synthesis.py -> _skbuild/macosx--arm64-3.10/setuptools/bdist.macosx--arm64/wheel/slycot
  copied 27 files
  running install_egg_info
  Copying slycot.egg-info to _skbuild/macosx--arm64-3.10/setuptools/bdist.macosx--arm64/wheel/slycot-0.5.4.dev4+g773c893-py3.10.egg-info
  running install_scripts
  copied 0 files
  Traceback (most recent call last):
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/build_meta.py", line 413, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
      self.run_setup()
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
      exec(code, locals())
    File "<string>", line 61, in <module>
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 754, in setup
      return setuptools.setup(**kw)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
      return distutils.core.setup(**attrs)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
      super().run_command(command)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/skbuild/command/bdist_wheel.py", line 31, in run
      super().run(*args, **kwargs)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 362, in run
      impl_tag, abi_tag, plat_tag = self.get_tag()
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 280, in get_tag
      plat_name = get_platform(self.bdist_dir)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 51, in get_platform
      result = calculate_macosx_platform_tag(archive_root, result)
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/wheel/macosx_libfile.py", line 399, in calculate_macosx_platform_tag
      base_version = tuple(int(x) for x in base_version.split("."))
    File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/wheel/macosx_libfile.py", line 399, in <genexpr>
      base_version = tuple(int(x) for x in base_version.split("."))
  ValueError: invalid literal for int() with base 10: ''
  error: subprocess-exited-with-error

I can try the conda recipe if you'd like, too

@bnavigator
Copy link
Collaborator

Yes please try the conda recipe.

Looks like you have encountered a bug in either wheel or scikit-build regarding an expected but not existing macosx_platform_tag.

Ping @henryiii

@henryiii
Copy link

henryiii commented Feb 2, 2023

I fixed something lightly related to this recently, I'm guessing the above is with the most recent version of scikit-build? Don't think it would fix exactly this (why is it not getting any information about the platform tag? I expect all packaging starts breaking if that's empty - in fact yes, this is crashing before it even gets to scikit-build's customizations, so my recent fix for valid platform tags wouldn't even get hit).

I guess there's a small chance it's setting this based on an observed CMAKE_* variable before it entered the bdist wheel upstream step, but that's not too likely, especially since the recent fix shouldn't allow it to set it to empty.

I'm guessing you are trying to cross-compile, and are setting up an invalid environment? Conda-forge's environment setup is complex. By hand, it's much easier to build a cross-compiled wheel (such as via cibuildwheel). Conda is a hacked-together mess of scripts that kind of needs perfect setup to build (like on CI).

@bnavigator
Copy link
Collaborator

Thanks for the inpit @henryiii, I fully agree with your assessment that conda is too brittle.

@bdube-jpl is actually trying to natively compile on ARM as opposed to cross-compile like conda-forge does. Either way it is hard to get a functioning compiled package.

@bdube-jpl
Copy link

👋 @henryiii

I think it may be an issue in skbuild. I have v0.16.6. Here's a tree of _skbuild:

_skbuild/
└── macosx--arm64-3.10
    ├── cmake-build
    │   ├── CMakeCache.txt
    │   ├── CMakeFiles
    │   │   ├── 3.25.2
    │   │   │   ├── CMakeCCompiler.cmake
    │   │   │   ├── CMakeDetermineCompilerABI_C.bin
    │   │   │   ├── CMakeDetermineCompilerABI_Fortran.bin
    │   │   │   ├── CMakeFortranCompiler.cmake
    │   │   │   ├── CMakeSystem.cmake
    │   │   │   ├── CompilerIdC
    │   │   │   │   ├── CMakeCCompilerId.c
    │   │   │   │   ├── a.out
    │   │   │   │   └── tmp
    │   │   │   └── CompilerIdFortran
    │   │   │       ├── CMakeFortranCompilerId.F
    │   │   │       ├── a.out
    │   │   │       └── tmp
    │   │   ├── CMakeDirectoryInformation.cmake
    │   │   ├── CMakeError.log
    │   │   ├── CMakeOutput.log
    │   │   ├── CMakeRuleHashes.txt
    │   │   ├── Makefile.cmake
    │   │   ├── Makefile2
    │   │   ├── TargetDirectories.txt
    │   │   ├── _f2py_runtime_library.dir
    │   │   │   ├── DependInfo.cmake
    │   │   │   ├── Users
    │   │   │   │   └── bdube
    │   │   │   │       └── miniconda3
    │   │   │   │           └── envs
    │   │   │   │               └── controlcrashselfbuild
    │   │   │   │                   └── lib
    │   │   │   │                       └── python3.10
    │   │   │   │                           └── site-packages
    │   │   │   │                               └── numpy
    │   │   │   │                                   └── f2py
    │   │   │   │                                       └── src
    │   │   │   │                                           ├── fortranobject.c.o
    │   │   │   │                                           └── fortranobject.c.o.d
    │   │   │   ├── build.make
    │   │   │   ├── cmake_clean.cmake
    │   │   │   ├── cmake_clean_target.cmake
    │   │   │   ├── compiler_depend.make
    │   │   │   ├── compiler_depend.ts
    │   │   │   ├── depend.make
    │   │   │   ├── flags.make
    │   │   │   ├── link.txt
    │   │   │   └── progress.make
    │   │   ├── cmake.check_cache
    │   │   ├── pkgRedirects
    │   │   └── progress.marks
    │   ├── CMakeSpec.json
    │   ├── CMakeTmp
    │   │   └── link_flags
    │   │       ├── gnu_ld_ignore
    │   │       │   └── MODULE
    │   │       │       └── SHARED
    │   │       │           ├── build
    │   │       │           │   ├── CMakeCache.txt
    │   │       │           │   ├── CMakeFiles
    │   │       │           │   │   ├── CMakeDirectoryInformation.cmake
    │   │       │           │   │   ├── Makefile.cmake
    │   │       │           │   │   ├── Makefile2
    │   │       │           │   │   ├── Progress
    │   │       │           │   │   │   ├── 1
    │   │       │           │   │   │   ├── 2
    │   │       │           │   │   │   ├── 5
    │   │       │           │   │   │   ├── 6
    │   │       │           │   │   │   └── count.txt
    │   │       │           │   │   ├── TargetDirectories.txt
    │   │       │           │   │   ├── cmake.check_cache
    │   │       │           │   │   ├── counter.dir
    │   │       │           │   │   │   ├── DependInfo.cmake
    │   │       │           │   │   │   ├── build.make
    │   │       │           │   │   │   ├── cmake_clean.cmake
    │   │       │           │   │   │   ├── compiler_depend.make
    │   │       │           │   │   │   ├── compiler_depend.ts
    │   │       │           │   │   │   ├── counter.c.o
    │   │       │           │   │   │   ├── counter.c.o.d
    │   │       │           │   │   │   ├── depend.make
    │   │       │           │   │   │   ├── flags.make
    │   │       │           │   │   │   ├── link.txt
    │   │       │           │   │   │   └── progress.make
    │   │       │           │   │   ├── main.dir
    │   │       │           │   │   │   ├── DependInfo.cmake
    │   │       │           │   │   │   ├── build.make
    │   │       │           │   │   │   ├── cmake_clean.cmake
    │   │       │           │   │   │   ├── compiler_depend.make
    │   │       │           │   │   │   ├── compiler_depend.ts
    │   │       │           │   │   │   ├── depend.make
    │   │       │           │   │   │   ├── flags.make
    │   │       │           │   │   │   ├── link.txt
    │   │       │           │   │   │   └── progress.make
    │   │       │           │   │   ├── number.dir
    │   │       │           │   │   │   ├── DependInfo.cmake
    │   │       │           │   │   │   ├── build.make
    │   │       │           │   │   │   ├── cmake_clean.cmake
    │   │       │           │   │   │   ├── compiler_depend.make
    │   │       │           │   │   │   ├── compiler_depend.ts
    │   │       │           │   │   │   ├── depend.make
    │   │       │           │   │   │   ├── flags.make
    │   │       │           │   │   │   ├── link.txt
    │   │       │           │   │   │   ├── number.c.o
    │   │       │           │   │   │   ├── number.c.o.d
    │   │       │           │   │   │   └── progress.make
    │   │       │           │   │   ├── pkgRedirects
    │   │       │           │   │   └── progress.marks
    │   │       │           │   ├── Makefile
    │   │       │           │   ├── cmake_install.cmake
    │   │       │           │   └── libnumber.dylib
    │   │       │           └── src
    │   │       │               ├── CMakeLists.txt
    │   │       │               ├── counter.c
    │   │       │               ├── counter.h
    │   │       │               ├── main.c
    │   │       │               ├── number.c
    │   │       │               └── number.h
    │   │       └── osx_dynamic_lookup
    │   │           └── MODULE
    │   │               └── SHARED
    │   │                   ├── build
    │   │                   │   ├── CMakeCache.txt
    │   │                   │   ├── CMakeFiles
    │   │                   │   │   ├── CMakeDirectoryInformation.cmake
    │   │                   │   │   ├── Makefile.cmake
    │   │                   │   │   ├── Makefile2
    │   │                   │   │   ├── TargetDirectories.txt
    │   │                   │   │   ├── cmake.check_cache
    │   │                   │   │   ├── counter.dir
    │   │                   │   │   │   ├── DependInfo.cmake
    │   │                   │   │   │   ├── build.make
    │   │                   │   │   │   ├── cmake_clean.cmake
    │   │                   │   │   │   ├── compiler_depend.make
    │   │                   │   │   │   ├── compiler_depend.ts
    │   │                   │   │   │   ├── counter.c.o
    │   │                   │   │   │   ├── counter.c.o.d
    │   │                   │   │   │   ├── depend.make
    │   │                   │   │   │   ├── flags.make
    │   │                   │   │   │   ├── link.txt
    │   │                   │   │   │   └── progress.make
    │   │                   │   │   ├── main.dir
    │   │                   │   │   │   ├── DependInfo.cmake
    │   │                   │   │   │   ├── build.make
    │   │                   │   │   │   ├── cmake_clean.cmake
    │   │                   │   │   │   ├── compiler_depend.make
    │   │                   │   │   │   ├── compiler_depend.ts
    │   │                   │   │   │   ├── depend.make
    │   │                   │   │   │   ├── flags.make
    │   │                   │   │   │   ├── link.txt
    │   │                   │   │   │   ├── main.c.o
    │   │                   │   │   │   ├── main.c.o.d
    │   │                   │   │   │   └── progress.make
    │   │                   │   │   ├── number.dir
    │   │                   │   │   │   ├── DependInfo.cmake
    │   │                   │   │   │   ├── build.make
    │   │                   │   │   │   ├── cmake_clean.cmake
    │   │                   │   │   │   ├── compiler_depend.make
    │   │                   │   │   │   ├── compiler_depend.ts
    │   │                   │   │   │   ├── depend.make
    │   │                   │   │   │   ├── flags.make
    │   │                   │   │   │   ├── link.txt
    │   │                   │   │   │   ├── number.c.o
    │   │                   │   │   │   ├── number.c.o.d
    │   │                   │   │   │   └── progress.make
    │   │                   │   │   ├── pkgRedirects
    │   │                   │   │   └── progress.marks
    │   │                   │   ├── Makefile
    │   │                   │   ├── cmake_install.cmake
    │   │                   │   ├── counter.so
    │   │                   │   ├── libnumber.dylib
    │   │                   │   └── main
    │   │                   └── src
    │   │                       ├── CMakeLists.txt
    │   │                       ├── counter.c
    │   │                       ├── counter.h
    │   │                       ├── main.c
    │   │                       ├── number.c
    │   │                       └── number.h
    │   ├── Makefile
    │   ├── cmake_install.cmake
    │   ├── install_manifest.txt
    │   ├── lib_f2py_runtime_library.a
    │   └── slycot
    │       ├── CMakeFiles
    │       │   ├── CMakeDirectoryInformation.cmake
    │       │   ├── _wrapper.dir
    │       │   │   ├── DependInfo.cmake
    │       │   │   ├── Users
    │       │   │   │   └── bdube
    │       │   │   │       └── miniconda3
    │       │   │   │           └── envs
    │       │   │   │               └── controlcrashselfbuild
    │       │   │   │                   └── lib
    │       │   │   │                       └── python3.10
    │       │   │   │                           └── site-packages
    │       │   │   │                               └── numpy
    │       │   │   │                                   └── f2py
    │       │   │   │                                       └── src
    │       │   │   │                                           ├── fortranobject.c.o
    │       │   │   │                                           └── fortranobject.c.o.d
    │       │   │   ├── _wrapper-f2pywrappers.f.o
    │       │   │   ├── _wrappermodule.c.o
    │       │   │   ├── _wrappermodule.c.o.d
    │       │   │   ├── build.make
    │       │   │   ├── cmake_clean.cmake
    │       │   │   ├── compiler_depend.make
    │       │   │   ├── compiler_depend.ts
    │       │   │   ├── depend.internal
    │       │   │   ├── depend.make
    │       │   │   ├── flags.make
    │       │   │   ├── fortran.internal
    │       │   │   ├── link.txt
    │       │   │   ├── progress.make
    │       │   │   └── src
    │       │   │       ├── SLICOT-Reference
    │       │   │       │   └── src
    │       │   │       │       ├── ...snip
    │       │   │       ├── XERBLA.f.o
    │       │   │       └── ftruefalse.f.o
    │       │   ├── progress.marks
    │       │   └── wrapper.dir
    │       │       ├── DependInfo.cmake
    │       │       ├── build.make
    │       │       ├── cmake_clean.cmake
    │       │       ├── compiler_depend.make
    │       │       ├── compiler_depend.ts
    │       │       └── progress.make
    │       ├── Makefile
    │       ├── _wrapper-f2pywrappers.f
    │       ├── _wrapper.cpython-310-darwin.so
    │       ├── _wrappermodule.c
    │       ├── cmake_install.cmake
    │       └── tests
    │           ├── CMakeFiles
    │           │   ├── CMakeDirectoryInformation.cmake
    │           │   └── progress.marks
    │           ├── Makefile
    │           └── cmake_install.cmake
    ├── cmake-install
    │   └── slycot
    │       ├── __init__.py
    │       ├── _wrapper.cpython-310-darwin.so
    │       ├── analysis.py
    │       ├── examples.py
    │       ├── exceptions.py
    │       ├── math.py
    │       ├── synthesis.py
    │       ├── tests
    │       │   ├── ...snip
    │       │   └── test_transform.py
    │       ├── transform.py
    │       └── version.py
    └── setuptools
        ├── bdist.macosx--arm64
        │   └── wheel
        │       ├── slycot
        │       │   ├── __init__.py
        │       │   ├── _wrapper.cpython-310-darwin.so
        │       │   ├── analysis.py
        │       │   ├── examples.py
        │       │   ├── exceptions.py
        │       │   ├── math.py
        │       │   ├── synthesis.py
        │       │   ├── tests
        │       │   │   ├── ...snip
        │       │   │   └── test_transform.py
        │       │   ├── transform.py
        │       │   └── version.py
        │       └── slycot-0.5.4.dev4+g773c893-py3.10.egg-info
        │           ├── PKG-INFO
        │           ├── SOURCES.txt
        │           ├── dependency_links.txt
        │           ├── not-zip-safe
        │           ├── requires.txt
        │           └── top_level.txt
        └── lib.macosx--arm64-cpython-310
            └── slycot
                ├── __init__.py
                ├── _wrapper.cpython-310-darwin.so
                ├── analysis.py
                ├── examples.py
                ├── exceptions.py
                ├── math.py
                ├── synthesis.py
                ├── tests
                │   ├── ... snip
                ├── transform.py
                └── version.py

76 directories, 872 files

The exception thrown by wheel is,

base_version = tuple(int(x) for x in base_version.split("."))
ValueError: invalid literal for int() with base 10: ''

I don't actually see anything that has a trailing period, lib.macosx--arm64-cpython-310, and so on.

Now, conda build.. conda-build -c conda-forge conda-recipe fails, due to being unable to find a suitable version of numpy. The controlcrashselfbuild env has 1.24.1, so I'm not sure why it can't resolve a proper one.

Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for slycot
INFO:conda_build.metadata:Attempting to finalize metadata for slycot
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed

Leaving build/test directories:
  Work:
 /Users/bdube/miniconda3/envs/controlcrashselfbuild/conda-bld/work
  Test:
 /Users/bdube/miniconda3/envs/controlcrashselfbuild/conda-bld/test_tmp
Leaving build/test environments:
  Test:
source activate  /Users/bdube/miniconda3/envs/controlcrashselfbuild/conda-bld/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl
  Build:
source activate  /Users/bdube/miniconda3/envs/controlcrashselfbuild/conda-bld/_build_env


Traceback (most recent call last):
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/environ.py", line 796, in get_install_actions
    actions = install_actions(prefix, index, specs, force=True)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/common/io.py", line 84, in decorated
    return f(*args, **kwds)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/plan.py", line 470, in install_actions
    txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/core/solve.py", line 132, in solve_for_transaction
    unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/core/solve.py", line 175, in solve_for_diff
    final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/core/solve.py", line 293, in solve_final_state
    ssc = self._add_specs(ssc)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/core/solve.py", line 590, in _add_specs
    explicit_pool = ssc.r._get_package_pool(self.specs_to_add)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/resolve.py", line 553, in _get_package_pool
    pool = self.get_reduced_index(specs)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/common/io.py", line 84, in decorated
    return f(*args, **kwds)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/resolve.py", line 574, in get_reduced_index
    explicit_specs, features = self.verify_specs(explicit_specs)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda/resolve.py", line 286, in verify_specs
    raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound:
  - numpy[version='!=1.23.0,1.16.*']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 495, in main
    execute(sys.argv[1:])
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 475, in execute
    outputs = api.build(
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/api.py", line 180, in build
    return build_tree(
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/build.py", line 3097, in build_tree
    packages_from_this = build(metadata, stats,
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/build.py", line 2049, in build
    output_metas = expand_outputs([(m, need_source_download, need_reparse_in_env)])
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/render.py", line 780, in expand_outputs
    for (output_dict, m) in deepcopy(_m).get_output_metadata_set(permit_unsatisfiable_variants=False):
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/metadata.py", line 2524, in get_output_metadata_set
    conda_packages = finalize_outputs_pass(
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/metadata.py", line 870, in finalize_outputs_pass
    output_d = om.get_rendered_output(metadata.name()) or {
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/metadata.py", line 2615, in get_rendered_output
    for output_ in self.get_rendered_outputs_section(
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/metadata.py", line 2597, in get_rendered_outputs_section
    self._get_contents(
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/metadata.py", line 1872, in _get_contents
    rendered = template.render(environment=env)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/bdube/src/Slycot/conda-recipe/meta.yaml", line 31, in top-level template code
    - pip
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/jinja_context.py", line 231, in pin_compatible
    pins, _, _ = get_env_dependencies(m, 'host', m.config.variant)
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/render.py", line 132, in get_env_dependencies
    actions = environ.get_install_actions(tmpdir, tuple(dependencies), env,
  File "/Users/bdube/miniconda3/envs/controlcrashselfbuild/lib/python3.10/site-packages/conda_build/environ.py", line 798, in get_install_actions
    raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-arm64: {"numpy[version='!=1.23.0,1.16.*']"}

@bnavigator
Copy link
Collaborator

Oh my, that stupid conda resolver.

Could you try to replace

- numpy !=1.23.0
with

    - numpy >=1.19,!=1.23.0

?
(https://github.com/conda-forge/slycot-feedstock/blob/a37fc29999dbf730415b35a2e39635d7eda2fc23/recipe/meta.yaml#L31)

@bnavigator
Copy link
Collaborator

@bdube-jpl
Copy link

bdube-jpl commented Feb 2, 2023

sysconfig:

>>> import sysconfig
>>> sysconfig.get_platform()
'macosx-11.0-arm64'

e: I am on ventura 13.1, so there is probably a separate bug in sysconfig with Ventura...

With the modified numpy in meta.yml, the package does build and install properly, but results in the segfault on import. The fortran compile complained about some out-of-bounds array access, so maybe that is the fundamental issue (why it seems to work in general and not on arm could easily be a difference in UB between compilers). ~line 1354 in the log. It may also be Numpy ABI incompatibility between 1.16 (I think it built with this anyway?) and my 1.24.1. Usually Numpy self-detects that and prints a warning on import that the size of the array object has changed between compile and runtime though.

The attached is the log from conda-build
condabuild.txt

@bnavigator
Copy link
Collaborator

The out of bounds is a false positive error message, see #111.
The logs use lib.macosx-11.0-arm64-cpython-310 and _skbuild/macosx-11.0-arm64-3.10 so that is different from the pip build. They also say that it found numpy 1.24.1. Where do you see 1.16 except for the first 4 lines?

Thanks for trying! So we can conclude that it is not problem with the cross-compilation.

Now back to the segfault, can you run gdb or a Mac equivalent for it?

@bdube-jpl
Copy link

yes

@murrayrm
Copy link
Member

murrayrm commented Aug 5, 2023

Follow up on this thread: I recently upgraded to Ventura with M2 and was able to get python-control and Slycot all working with arm64. Are others on this thread still having problems? If not, we can probably close this one off.

@bnavigator
Copy link
Collaborator

No further feedback since. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants