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

Linux aarch64 (ARM64) Python Wheels #1489

Open
jmwright opened this issue Jan 10, 2024 · 16 comments
Open

Linux aarch64 (ARM64) Python Wheels #1489

jmwright opened this issue Jan 10, 2024 · 16 comments
Assignees
Labels
announcement Communication with the community: project updates, etc help wanted Extra attention is needed

Comments

@jmwright
Copy link
Member

See the announcement on the ocp-build-system repo. You will need to download the cadquery-ocp wheel for your version of Python, and do a local install. In that shared directory there is also a requirements.txt file that contains the CadQuery dependencies so that you can try to hack together a working CadQuery install. However, there are some challenges.

  • Tools for building software (gcc, cmake, build-essential, etc) have to be installed for installing/building nlopt.
  • nlopt fails to build for me without reporting why

If someone in the community can help figure out the issue with nlopt compilation, that would be great.

If you are interested, please hack around and let me know what you find. Use pip install -r requirements.txt to install the dependencies in your Python environment after doing a local install of the cadquery-ocp wheel.

@jmwright jmwright added the announcement Communication with the community: project updates, etc label Jan 10, 2024
@jmwright jmwright self-assigned this Jan 10, 2024
@adam-urbanczyk adam-urbanczyk added the help wanted Extra attention is needed label Jan 12, 2024
@hf-krechan
Copy link

Hey @jmwright I tried to use the cqgridfinity python package which needs cadquery.

After I successfully installed the arm64 cad query wheel from https://github.com/jdegenstein/ocp-build-system/releases/tag/7.7.2_macos_arm64 I stumbled over the same issue with nlopt.

On my search I found this issue.
There are three other issues linked, which got all closed.
I hoped to find a solution there, but all issues with nlopt got "solved" by replacing it with scipy.

I gave it a try, but I was not successful so far.

The question I am asking myself now, what kind of approach would be more promising: Either to replace nlopt with scipy or try to contribute to nlopt and make it work on arm64?

There is already a two year old issue which mentions the problem with the M1 processors.

@thasti
Copy link

thasti commented Feb 10, 2024

I also succesfully tested those, thanks for providing those wheels. nlopt didn't act up for me, installed just fine out of the box via pip (Python 3.12.1).

@hf-krechan
Copy link

I used also Python 3.12.1 but on my Macbook Pro with M1 processor.
But if I want to install nlopt with

pip install nlopt

I get the error message

ERROR: Could not build wheels for nlopt, which is required to install pyproject.toml-based projects

I found this comment which deactivates some options to compile nlopt:

I am able to run on an M2 MacBook Pro by following the NLopt steps (although slightly modified):

  1. Open terminal and cd to desired directory (e.g. Documents).
  2. git clone https://github.com/stevengj/nlopt.git
  3. cd nlopt
  4. mkdir build
  5. cd build
  6. cmake .. -DNLOPT_OCTAVE=Off -DNLOPT_MATLAB=Off -DNLOPT_GUILE=Off
  7. make
  8. sudo make install

If you need a CMakeLists.txt template please refer to my comment on #502.

@thasti do you also used an arm architecture?

@thasti
Copy link

thasti commented Feb 11, 2024

Hi. Indeed, I'm on an M2 Air running Fedora Asahi Remix. nlopt simply installs from wheels for me (i.e. is not compiled locally), no issues:

(venv_nlopt) [thasti@slab tmp]$ pip install nlopt
Collecting nlopt
  Using cached nlopt-2.6.2-cp312-cp312-linux_aarch64.whl
Collecting numpy>=1.14 (from nlopt)
  Obtaining dependency information for numpy>=1.14 from https://files.pythonhosted.org/packages/79/f8/97f10e6755e2a7d027ca783f63044d5b1bc1ae7acb12afe6a9b4286eac17/numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
  Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.3/62.3 kB 1.9 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 33.7 MB/s eta 0:00:00
Installing collected packages: numpy, nlopt
Successfully installed nlopt-2.6.2 numpy-1.26.4

Nonetheless, I tried and I also have no troubles following the step-by-step instructions above without disabling anything (i.e. I just run cmake .. instead of cmake .. -DNLOPT_OCTAVE=Off -DNLOPT_MATLAB=Off -DNLOPT_GUILE=Off) and it builds just fine.

Edit: In other words, this looks like it's a MacOS (operating system) issue more than an ARM64 (processor architecture) issue. The issue here concerns only Linux aarch64 wheels, not macOS ones as far as I understand it.

@hf-krechan
Copy link

Alright, that is good to know. Thanks for testing :)

I tested now the the commands to build (is this the right term? ^^') nlopt.
These commands worked for me, but if I try to install nlopt in my virtual environment with pip install nlopt it crashes again with this error

$ (.venv)  pip install nlopt
Collecting nlopt
  Using cached nlopt-2.6.2.tar.gz (2.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.14 in ./.venv/lib/python3.12/site-packages (from nlopt) (1.26.4)
Building wheels for collected packages: nlopt
  Building wheel for nlopt (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for nlopt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [261 lines of output]
      running bdist_wheel
      running build
      running build_ext
      cmake version 3.28.3

These are only the first lines.
In the collapsed section you can find the whole output.

Whole error message
Collecting nlopt
  Using cached nlopt-2.6.2.tar.gz (2.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.14 in ./.venv/lib/python3.12/site-packages (from nlopt) (1.26.4)
Building wheels for collected packages: nlopt
  Building wheel for nlopt (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for nlopt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [261 lines of output]
      running bdist_wheel
      running build
      running build_ext
      cmake version 3.28.3
      
      CMake suite maintained and supported by Kitware (kitware.com/cmake).
      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.
      
      
      -- The C compiler identification is AppleClang 15.0.0.15000100
      -- The CXX compiler identification is AppleClang 15.0.0.15000100
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Warning (dev) at CMakeLists.txt:12 (find_package):
        Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
        are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
        the cmake_policy command to set the policy and suppress this warning.
      
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      -- Found PythonInterp: /Users/kevin/workspaces/privat/try-cadquery/.venv/bin/python (found version "3.12.1")
      -- Found Python includes: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/include/python3.12
      -- Found Python libs: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/lib
      CMake Deprecation Warning at extern/nlopt/CMakeLists.txt:15 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.
      
      
      -- NLopt version 2.6.2
      -- Looking for dlfcn.h
      -- Looking for dlfcn.h - found
      -- Looking for getopt.h
      -- Looking for getopt.h - found
      -- Looking for unistd.h
      -- Looking for unistd.h - found
      -- Looking for string.h
      -- Looking for string.h - found
      -- Looking for strings.h
      -- Looking for strings.h - found
      -- Looking for inttypes.h
      -- Looking for inttypes.h - found
      -- Looking for memory.h
      -- Looking for memory.h - found
      -- Looking for stdlib.h
      -- Looking for stdlib.h - found
      -- Looking for stdint.h
      -- Looking for stdint.h - found
      -- Looking for time.h
      -- Looking for time.h - found
      -- Looking for sys/types.h
      -- Looking for sys/types.h - found
      -- Looking for sys/stat.h
      -- Looking for sys/stat.h - found
      -- Looking for sys/time.h
      -- Looking for sys/time.h - found
      -- Looking for getpid
      -- Looking for getpid - found
      -- Looking for syscall
      -- Looking for syscall - found
      -- Looking for isinf
      -- Looking for isinf - found
      -- Looking for isnan
      -- Looking for isnan - found
      -- Looking for gettimeofday
      -- Looking for gettimeofday - found
      -- Looking for qsort_r
      -- Looking for qsort_r - found
      -- Looking for time
      -- Looking for time - found
      -- Looking for copysign
      -- Looking for copysign - found
      -- Looking for stddef.h
      -- Looking for stddef.h - found
      -- Check size of uint32_t
      -- Check size of uint32_t - done
      -- Check size of unsigned int
      -- Check size of unsigned int - done
      -- Check size of unsigned long
      -- Check size of unsigned long - done
      -- Looking for sqrt in m
      -- Looking for sqrt in m - found
      -- Looking for fpclassify
      -- Looking for fpclassify - TRUE
      -- Performing Test HAVE_THREAD_LOCAL_STORAGE
      -- Performing Test HAVE_THREAD_LOCAL_STORAGE - Success
      -- Performing Test HAVE_THREAD_LOCAL_STORAGE
      -- Performing Test HAVE_THREAD_LOCAL_STORAGE - Failed
      -- Looking for __cplusplus
      -- Looking for __cplusplus - found
      -- Performing Test SUPPORTS_STDCXX11
      -- Performing Test SUPPORTS_STDCXX11 - Success
      -- Performing Test HAS_FPIC
      -- Performing Test HAS_FPIC - Success
      CMake Warning (dev) at extern/nlopt/CMakeLists.txt:306 (find_package):
        Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
        are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
        the cmake_policy command to set the policy and suppress this warning.
      
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      CMake Warning (dev) at extern/nlopt/CMakeLists.txt:307 (find_package):
        Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
        are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
        the cmake_policy command to set the policy and suppress this warning.
      
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      -- Found PythonLibs: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/lib (found suitable exact version "3.12.1")
      CMake Warning (dev) at extern/nlopt/cmake/FindNumPy.cmake:45 (find_package):
        Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
        are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
        the cmake_policy command to set the policy and suppress this warning.
      
      Call Stack (most recent call first):
        extern/nlopt/CMakeLists.txt:308 (find_package)
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      -- Could NOT find NumPy (missing: NUMPY_INCLUDE_DIRS)
      -- Could NOT find Guile (missing: GUILE_EXECUTABLE GUILE_ROOT_DIR GUILE_INCLUDE_DIRS GUILE_LIBRARIES)
      -- Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
      -- Could NOT find Octave (missing: OCTAVE_EXECUTABLE OCTAVE_ROOT_DIR OCTAVE_INCLUDE_DIRS OCTAVE_LIBRARIES)
      -- Could NOT find Matlab (missing: Matlab_INCLUDE_DIRS Matlab_MEX_LIBRARY Matlab_MEX_EXTENSION Matlab_ROOT_DIR Matlab_MX_LIBRARY MX_LIBRARY MAIN_PROGRAM) (found version "NOTFOUND")
      -- Configuring done (4.1s)
      -- Generating done (0.0s)
      -- Build files have been written to: /private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-install-d_a9ml63/nlopt_955c2a2093ae4da388863f6d58dc4958/build/temp.macosx-14-arm64-cpython-312
      [  3%] Generating nlopt.f
      [  3%] Generating nlopt.hpp
      CMake Deprecation Warning at /private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-install-d_a9ml63/nlopt_955c2a2093ae4da388863f6d58dc4958/extern/nlopt/cmake/generate-cpp.cmake:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.
      
      
      CMake Deprecation Warning at /private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-install-d_a9ml63/nlopt_955c2a2093ae4da388863f6d58dc4958/extern/nlopt/cmake/generate-fortran.cmake:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.
      
      
      [  3%] Built target generate-fortran
      [  3%] Built target generate-cpp
      [  7%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/direct/DIRect.c.o
      [  7%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/direct/direct_wrap.c.o
      [  9%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/direct/DIRserial.c.o
      [ 11%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/direct/DIRsubrout.c.o
      [ 13%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/cdirect/cdirect.c.o
      [ 15%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/cdirect/hybrid.c.o
      [ 17%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/praxis/praxis.c.o
      [ 19%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/luksan/plis.c.o
      [ 21%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/luksan/plip.c.o
      [ 23%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/luksan/pnet.c.o
      [ 25%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/luksan/mssubs.c.o
      [ 27%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/luksan/pssubs.c.o
      [ 29%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/crs/crs.c.o
      [ 31%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/mlsl/mlsl.c.o
      [ 33%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/mma/mma.c.o
      [ 35%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/mma/ccsa_quadratic.c.o
      [ 37%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/cobyla/cobyla.c.o
      [ 39%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/newuoa/newuoa.c.o
      [ 41%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/neldermead/nldrmd.c.o
      [ 43%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/neldermead/sbplx.c.o
      [ 45%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/auglag/auglag.c.o
      [ 47%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/bobyqa/bobyqa.c.o
      [ 49%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/isres/isres.c.o
      [ 50%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/slsqp/slsqp.c.o
      [ 52%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/esch/esch.c.o
      [ 54%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/api/general.c.o
      [ 56%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/api/options.c.o
      [ 58%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/api/optimize.c.o
      [ 60%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/api/deprecated.c.o
      [ 62%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/api/f77api.c.o
      [ 64%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/mt19937ar.c.o
      [ 66%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/sobolseq.c.o
      [ 68%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/timer.c.o
      [ 70%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/stop.c.o
      [ 72%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/redblack.c.o
      [ 74%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/qsort_r.c.o
      [ 76%] Building C object extern/nlopt/CMakeFiles/nlopt.dir/src/util/rescale.c.o
      [ 78%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/stogo/global.cc.o
      [ 80%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/stogo/linalg.cc.o
      [ 82%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/stogo/local.cc.o
      [ 84%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/stogo/stogo.cc.o
      [ 86%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/stogo/tools.cc.o
      [ 88%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/ags/evolvent.cc.o
      [ 90%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/ags/solver.cc.o
      [ 92%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/ags/local_optimizer.cc.o
      [ 94%] Building CXX object extern/nlopt/CMakeFiles/nlopt.dir/src/algs/ags/ags.cc.o
      [ 96%] Linking CXX static library libnlopt.a
      [100%] Built target nlopt
      Traceback (most recent call last):
        File "/Users/kevin/workspaces/privat/try-cadquery/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/kevin/workspaces/privat/try-cadquery/.venv/lib/python3.12/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/kevin/workspaces/privat/try-cadquery/.venv/lib/python3.12/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 "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 404, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 85, in <module>
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/normal/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/private/var/folders/5_/rkzx1ly96xbcb33y2phnbq940000gn/T/pip-build-env-d_uajgbu/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 28, in run
        File "<string>", line 70, in build_extension
      StopIteration
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for nlopt
Failed to build nlopt
ERROR: Could not build wheels for nlopt, which is required to install pyproject.toml-based projects

@adam-urbanczyk
Copy link
Member

Feel free to continue the discussion here, but it might be more efficient to ask on the nlopt issue tracker.

@thasti
Copy link

thasti commented Feb 11, 2024

Not obvious to me what is going wrong with your build. I would also suggest you take your problem to the nlopt issue tracker (https://github.com/stevengj/nlopt/issues) since this seems unrelated to Linux aarch64 discussed here, people are more likely to be able to help you there.

@adam-urbanczyk let me know if any other tests would be useful for you. Can you confirm the issue you had with nlopt on linux aarch64 has been resolved in the meantime or do you still see failures?

@jmwright
Copy link
Member Author

I have not been able to get around the Python 3.12 problem on Debían 12 aarch64 running on a Pinebook Pro, and I also tried on a Rock Pro 64 running the same distro. However, I have not tried with the different cmake options listed above. @hf-krechan Is it possible that the proper nlopt and nlopt-dev packages are not installed via your distro's package manager that would allow nlopt to build locally with the new cmake options? If that is not the remaining issue, I think the nlopt issue tracker is the best place for this (as mentioned above).

@hf-krechan
Copy link

I did not know that you can also install nlopt with a package manager.
On macOS I use homebrew and there is a nlopt package: https://formulae.brew.sh/formula/nlopt#default

But the pip install nlopt command still fails.
I will move to the nlopt issue tracker with this problem.

Do you have some opinions about the idea to replace nlopt with scipy?
As far as I see it get's only used in the sketch_solver.py module.

@jmwright
Copy link
Member Author

Do you have some opinions about the idea to replace nlopt with scipy?

@adam-urbanczyk Will probably have better insight on that. I am fine sticking with nlopt and contributing to that package unless there are other compelling reasons to switch.

@adam-urbanczyk
Copy link
Member

Definitely not scipy. Long term we should switch to casadi (i.e. what is used by the assy solver) or get rid of the sketch solver completely.

@adam-urbanczyk
Copy link
Member

I don't understand what precisely are we discussing here. It does not look like a nlopt issue per se. It uses CMake and not pip for building... Maybe try the offical way first.

BTW conda-forge seems to have a aarch64/arm64 nlopt pacakges also for py3.12.

@hf-krechan
Copy link

hf-krechan commented Feb 11, 2024

I thought the topic would be the issue to install cadquery on an ARM64 machines.

I am not familiar with conda and I am a little bit afraid to crash my Python setup which I need for work.
I will try find a way to install the nlopt-python on macOS.

Thanks for all your inputs ☺️

@adam-urbanczyk
Copy link
Member

FYI mamba/conda is the best supported way to install cadquery, install to a local dir if you are afraid of side effects: https://cadquery.readthedocs.io/en/latest/installation.html#install-the-conda-package-manager

@hf-krechan
Copy link

Thanks for this hint.
I tried it and it worked :)
And I learned a lot about Anaconda, Conda, Miniforge and Mamba 😄

@jmwright
Copy link
Member Author

Linux aarch64 and MacOS ARM64 wheels have been attached to the ocp-build-system release here. It is possible to do a pip install of the wheels on that release by copying the URL for the file that matches your OS and Python version and then doing pip install URL_OF_CORRECT_WHEEL_FILE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement Communication with the community: project updates, etc help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants