From b5b004ae3d7705a8d7e89ea28d701b0179557484 Mon Sep 17 00:00:00 2001 From: f-rousset <francois.rousset@umontpellier.fr> Date: Wed, 26 Mar 2025 15:09:19 +0100 Subject: [PATCH] Updated installations instructions for NLopt/nloptr. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b4342df..839d9eb 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,17 @@ The `spaMM` package was developed first to fit mixed-effect models with spatial Installing `spaMM` from CRAN is generally straightforward, particularly when installing a compiled version. Installing from source on Windows is also easy when the `Rtools` have been installed. -Additional steps may be needed on other operating systems, for the required `GSL` library and `nloptr` package (which requires the `NLopt` library), and optionally for the `ROI.plugin.glpk` package (which requires the `Rglpk` package, which itself requires the external `glpk` library) +Additional steps may be needed on other operating systems, for the required `GSL` library and `nloptr` package (which requires the `NLopt` library, version 2.7), and optionally for the `ROI.plugin.glpk` package (which requires the `Rglpk` package, which itself requires the external `glpk` library) For **Debian or Ubuntu**, this should typically work:\ `sudo apt-get install libgmp3-dev`\ `sudo apt-get install libnlopt-dev`\ `sudo apt-get install libglpk-dev` \ + +If the installation of `nloptr` or `NLopt` fails, **do read the messages**. They may tell you, for example, that `NLopt` 2.7 is not installed for your system. Further, it may not be available by `apt-get` for your system. If `NLopt` 2.7 is not installed, the `nloptr` installation script tries to compile `NLopt` 2.7 from source, but for that purpose `cmake` version 3.15 (or higher) is required, and you need to make sure that it is installed. The `cmake` installation procedure described [here](https://askubuntu.com/questions/1203635/) may then be useful. + + **Mac** users may find [HomeBrew](https://brew.sh/) useful: install it and then run `brew install gsl` and `brew install glpk`. However, my limited experience with it was deceptive. It did not tell when no writeable `/usr/local/include` directory existed, preventing the installation of the `GSL`. The alternative installation procedure described [here](https://gist.github.com/TysonRayJones/af7bedcdb8dc59868c7966232b4da903#osx) has then been useful. -- GitLab