Open AndrewLister-STFC opened 1 week ago
@lindonroberts I guess we should now also check the standard /usr/local/lib/
path? This is so that we can also support the newly released CUTEst meson installer that installs to /usr/local/lib/
by default. The old makefile based CUTEst installer still uses the path that we currently have so we should probably retain it for now.
@jfowkes that makes sense to me. So the new meson installer just puts everything in a standard location and doesn't set the environment variables? Is it the same default path for Mac and Linux?
@lindonroberts good question, the meson docs are rather vague on the specifics:
There is usually no need to specify install paths or the like. Meson will automatically install to the standards-conforming location.
I'll do some testing and see what the default Mac and Linux install locations are (for both CUTEst and SIFDecode).
You can add a prefix when you set up the meson build to give it a custom install directory. It might be enough to check for existence on the PATH env var?
Would something like this do the job?
import pathlib
import os
cutest_double_path = None
for p in os.environ["PATH"].split(":"):
candidate = pathlib.Path(p)/'libcutest_double.so'
if candidate.exists():
cutest_path = candidate
break
@AndrewLister-STFC no because /usr/local/lib/
is not on PATH
(path is for binaries not libraries). It is sometimes on LD_LIBRARY_PATH
on Linux but this is not guaranteed, especially on Mac.
@lindonroberts after some testing here are the default meson install directories (for SIFDecode and CUTEst):
Linux
/usr/local/lib/
/usr/local/bin/
macOS (Silicon)
/opt/homebrew/lib/
/opt/homebrew/bin/
It looks like we already have the macOS paths so we just need to add the local Linux paths.
Describe the bug I get the following error on import:
I have installed CUTEst using the meson build system, so the path is not at the expected location:
and is instead installed and on the standard path
To Reproduce I built CUTEst as part of a container here. (I plan to update SIFDecode to the meson build too).
Information about your installation:
ubuntu:24.04
uv python install 3.12
1.7.1