casacore / homebrew-tap

0 stars 2 forks source link

Latest Formula doesn't build Python component when expected #4

Closed rtobar closed 1 year ago

rtobar commented 1 year ago

I just tried installing casacore via brew following the instructions in the README, but also specifying the --with-python option to include the Python bindings. This triggered the installation of python3, numpy and boost-python, but the cmake command-line to compile casacore looked like this:

==> cmake ../.. -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON=OFF -DBUILD_PYTHON3=false -DUSE_OPENMP=OFF -DUSE_FFTW3=ON -DFFTW3_ROOT_DIR=/opt/homebrew ...

Note the false value for BUILD_PYTHON3; hence the Python component of casacore was not included in the build.

This was done in a M1 Mac, but probably is reproducible in other environments.

tammojan commented 1 year ago

Hm, the line responsible for setting this looks good to me; I don't see how it could evaluate to false:

cmake_args << "-DBUILD_PYTHON3=#{build.with?"python" ? "ON" : "OFF"}"
tammojan commented 1 year ago

I see that I removed a space as well as the parentheses. I put the space back just now, could you try again?

tammojan commented 1 year ago

I tested on my mac, the CMake call is now:

cmake ../.. -DCMAKE_BUILD_TYPE=release -DBUILD_PYTHON=OFF -DBUILD_PYTHON3=ON -DUSE_OPENMP=OFF -DUSE_FFTW3=ON -DFFTW3_ROOT_DIR=/opt/homebrew -DUSE_HDF5=ON -DHDF5_ROOT_DIR=/opt/homebrew -DBoost_NO_BOOST_CMAKE=True -DDATA_DIR=/opt/homebrew/opt/casacore-data/data

So I think this one space was the bug. I'm glad you find this bug only two days after I introduced it.

rtobar commented 1 year ago

@tammojan thanks for that. Unfortunately that didn't quite make it. After closer inspection I decided to try a small fix (I don't know Ruby, just copy/pasted what seemed to be correct) and it worked. For reference I'm using ruby 2.6.8p205 in macOS 12.5.1

tammojan commented 1 year ago

Thanks @rtobar . I copied your fix and pushed it to master.

rtobar commented 1 year ago

Thanks @tammojan!