casacore / homebrew-tap

0 stars 2 forks source link

macos-13: casacore Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.12.6") #11

Open d3v-null opened 1 month ago

d3v-null commented 1 month ago

Hi there, I have a pretty simple macos CI workflow, basically

runs-on: macos-13
...
- run: brew install casacore/tap/casacore

it passes on macos-14 but it's currently failing on macos-13 with

 ==> Installing casacore/tap/casacore dependency: boost-python3
==> Downloading https://ghcr.io/v2/homebrew/core/boost-python3/manifests/1.86.0
Already downloaded: /Users/runner/Library/Caches/Homebrew/downloads/4bbe3f6afa6b6c78cfec1c1a73ae60e009f48faf25bab7a3bd47c4554728a36e--boost-python3-1.86.0.bottle_manifest.json
==> Pouring boost-python3--1.86.0.ventura.bottle.tar.gz
🍺  /usr/local/Cellar/boost-python3/1.86.0: 24 files, 14.2MB
==> Installing casacore/tap/casacore
==> cmake ../.. -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON3=ON -DUSE_OPENMP=OFF -
Last 15 lines from /Users/runner/Library/Logs/Homebrew/casacore/01.cmake:

-- Found Boost: /usr/local/include (found version "1.86.0") found components: system filesystem unit_test_framework
-- Looking for python3 specific environment...
CMake Error at /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found
  version "3.12.6")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPython/Support.cmake:4017 (find_package_handle_standard_args)
  /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPython3.cmake:601 (include)
  python3/CMakeLists-cmake3.14.txt:3 (find_package)
  python3/CMakeLists.txt:4 (include)

-- Configuring incomplete, errors occurred!

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/casacore/homebrew-tap/issues

I can see that your CI passes all the format checks, but perhaps you can add a test to install the formula.

While I'm here, I noticed that in a recent CI run, the "upload bottles as artifact" step is being skipped, and so there's no casacore-3.6.1 bottle available. Not sure if this is intentional.

Thanks!

d3v-null commented 1 month ago

I've just remembered that I've solved a similar problem before. It may help to set the cmake defines like this

something like

# the ruby equivalent of ...
export PYTHON_EXECUTABLE=$(which python3)
export PYTHON_NUMPY_INCLUDE=$($PYTHON_EXECUTABLE -c "import numpy; print(numpy.get_include())")

cmake_args <<  "-DPython3_EXECUTABLE=#{PYTHON_EXECUTABLE}" 
cmake_args <<  "-DPython3_NumPy_INCLUDE_DIR=${PYTHON_NUMPY_INCLUDE}"