ralna / CUTEst

The Constrained and Unconstrained Testing Environment with safe threads (CUTEst) for optimization software
Other
88 stars 19 forks source link

Add a README.md #55

Open amontoison opened 1 month ago

amontoison commented 1 month ago

@jfowkes @nimgould We should add a nice README.md like we did for GALAHAD. It should explain that we have a new build system, precompiled shared libraries and the latest features like support of quadruple precision, shared libraries, Python and Julia interfaces, etc...

jfowkes commented 1 month ago

@amontoison is CUTEst now also fully installable with Meson? If so we should definitely add the README and I will switch PyCUTEst over to installing SIFDecode/CUTEst with Meson. ARCHDefs is not needed with the Meson installs right?

amontoison commented 1 month ago

Yes @jfowkes, you can compile libcutest with Meson on all platforms (even Windows). You just need to be careful if you want incomplete static libraries or complete shared libraries with the dexumer of SIF files. The best examples of compilation are in the CI files.

You used an incomplete shared library before, but it's not supported by all linkers and quite hard to generate on Mac. I think the future is the SIF demuxer 🙂

ARCHDefs is not needed except if you want to compile some interfaces in GALAHAD / CUTEst like MATLAB ones. But for Python and Julia we don't need it.

We should definitely update the README.

nimgould commented 1 month ago

Careful, @jfowkes while we can install cutest this way, it does require @amontoison 's trick to add in the compiled elfuns.o (etc) to the shared library. The old way simply allows you to link in the elfuns.o on the fly. Your choice. In addition, the makefile build provides interfaces to over 30 other optimization solvers, and this is what many people use it for.

jfowkes commented 1 month ago

Good point @nimgould, I will of course carefully investigate the various options. @amontoison is it not possible to also compile the incomplete shared/static library with meson? That would be a good starting point.

amontoison commented 1 month ago

@jfowkes You can compile the incomplete static library of CUTEst with Meson, it's the default behavior.

From that, you can then create a static or shared library libproblem.a / libproblem.$dlext when completed with the .o of the SIF file. But it's just dedicated to one problem.

For the shared library with the SIF demuxer, you need to pass this option to Meson:

meson setup builddir -Ddefault_library=shared

It compiles this additional file: https://github.com/ralna/CUTEst/blob/master/src/tools/cutest_delegate.f90 It provides routines to load any shared library of a SIF problem at runtime.

I don't provide an option for an incomplete shared library because:

jfowkes commented 1 month ago

Thanks @amontoison, PyCUTEst currently does the first approach you describe so we can easily switch over to that as a starting point. The more involved change would be to move it over to the demuxer shared library, this is for the future!

dpo commented 6 days ago

Just so we remember what to add to the README, I just installed SIFDecode and CUTEst with Meson on Linux and all went smoothly. Here are the different steps:

1. Install Meson and Ninja (together, they replace Make):

- pip3 install —user meson
- install Ninja with your package manager or follow the instructions in the CMake section of the README:

  git clone https://github.com/ninja-build/ninja.git
  cd ninja
  git checkout release
  cmake -Bbuild-cmake
  cmake --build build-cmake

  The “ninja” executable is in build-cmake. Copy it to a place that is on your PATH.

2. Download and build SIFDecode (you don’t need ARCHDefs with this method)

  git clone https://github.com/ralna/SIFDecode.git
  cd SIFDecode
  meson setup builddir
  meson compile -C builddir
  export SIFDECODE=$PWD/builddir

3. Download and install CUTEst:

  git clone https://github.com/ralna/CUTEst.git
  cd CUTEst
  meson setup builddir [-Dquadruple=true]
  meson compile -C builddir