CUTEst icon indicating copy to clipboard operation
CUTEst copied to clipboard

Add a README.md

Open amontoison opened this issue 1 year ago • 7 comments

@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...

amontoison avatar Jul 25 '24 18:07 amontoison

@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?

jfowkes avatar Aug 15 '24 06:08 jfowkes

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.

amontoison avatar Aug 15 '24 07:08 amontoison

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.

nimgould avatar Aug 15 '24 09:08 nimgould

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.

jfowkes avatar Aug 15 '24 10:08 jfowkes

@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:

  • we can't do it on Windows
  • it needs dedicated flags for each compiler
  • it needs dedicated flags for each platform

amontoison avatar Aug 15 '24 17:08 amontoison

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!

jfowkes avatar Aug 16 '24 07:08 jfowkes

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

dpo avatar Sep 09 '24 17:09 dpo