potassco / clingcon

⛓️ Extension of clingo to handle constraints over integers
https://potassco.org/
MIT License
25 stars 4 forks source link

Issue with CMake installation on MacOS #108

Closed Dekker1 closed 6 months ago

Dekker1 commented 6 months ago

As part of my tap for Homebrew of MiniZinc solvers, I build clingcon as a dependency to FlatZingo.

I was hoping to update to the latest version released a few days ago, but I'm running into an issue with the CMake configuration on MacOS. It seems that it is trying to now create /usr/local/lib/python3.12/site-packages/clingcon eventhough the prefix is set as -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/clingcon/5.2.1. I found that there is a further possible configuration -DPYCLINGCON_INSTALL=prefix, but this does not seem to have any effect.

The full build logs can be found here: https://github.com/Dekker1/homebrew-minizinc/actions/runs/7965451767/job/21744994037?pr=53#step:7:120

The build does seem to pass on Ubuntu builder, so I'm not sure whether the problem does not occur there, or whether it just isn't as strict on the creation of folders.

Can you confirm that this is not intended behaviour, and help me in finding how to resolve the problem?

rkaminsk commented 6 months ago

I don't quite know what is going wrong here. You configuration looks correct. There is a script that should determine the correct path:

$ python cmake/python-site.py target --prefix /usr/local/Cellar/clingcon/5.2.1
/usr/local/Cellar/clingcon/5.2.1/lib/python3.11/site-packages

This is also the path that should be taken by default.

You can also set the install prefix manually via cmake variable PYCLINGCON_INSTALL_DIR.

PS: Some debugging help on macos would be appreciated here. The script involved is rather simple.

Dekker1 commented 6 months ago

I tried running the python script, and the CMake configuration with the same arguments on my mac, with my local version of CMake, but couldn't find any inconsistencies.

I've adjusted my homebrew formula to determine the Python install path itself: https://github.com/Dekker1/homebrew-minizinc/pull/53/files#diff-404afd2215582d05940d1b05190db490f05fceae805356e4733f36b8d4d7ca0fR26 That seems to resolve the issue.

I suppose I'll close this issue, since it seems that it was only triggered in a very particular case.