Package Details: highs 1.8.1-3

Git Clone URL: https://aur.archlinux.org/highs.git (read-only, click to copy)
Package Base: highs
Description: Linear optimization software
Upstream URL: https://github.com/ERGO-Code/HiGHS
Keywords: math optimization solver
Licenses: MIT
Submitter: x2b
Maintainer: x2b
Last Packager: x2b
Votes: 5
Popularity: 0.003443
First Submitted: 2022-01-20 10:24 (UTC)
Last Updated: 2024-11-15 17:03 (UTC)

Latest Comments

x2b commented on 2024-11-15 17:05 (UTC)

Sorry about the late reply, the build is now generator agnostic. However, the flags seem to have to be set manually for some reason, otherwise namcap shows corresponding warnings.

sergiud commented on 2024-06-15 22:44 (UTC)

Thank you for providing this package. Unfortunately, the package unconditionally assumes (Unix) Makefiles CMake generator which causes the following error every time I update:

-- Configuring done (2.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/<user>/Projects/highs/src/HiGHS-1.7.1/build
==> Starting build()...
make: *** No targets specified and no makefile found.  Stop.
==> ERROR: A failure occurred in build().
    Aborting...

because I have CMAKE_GENERATOR=Ninja defined in my ~/.bashrc.

Resolving this issue requires replacing all make calls either by cmake --build or cmake --install to be generator agnostic. I suggest the following changes:

diff --git a/PKGBUILD b/PKGBUILD
index eb34216..66e1109 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,30 +14,22 @@ source=("https://github.com/ERGO-Code/HiGHS/archive/refs/tags/v${pkgver}.tar.gz"
 sha256sums=('65c6f9fc2365ced42ee8eb2d209a0d3a7942cd59ff4bd20464e195c433f3a885')

 prepare() {
-    cd "$srcdir/${_pkgname}-${pkgver}"
-    mkdir -p "build"
-    cd "build"
-
-    cmake \
-      -DCMAKE_EXE_LINKER_FLAGS=$LDFLAGS \
-      -DCMAKE_SHARED_LINKER_FLAGS=$LDFLAGS \
-      -DCMAKE_INSTALL_PREFIX=/usr \
-      ..
+    cmake -S "$srcdir/${_pkgname}-${pkgver}" \
+      -B "$srcdir/${_pkgname}-${pkgver}/build" \
+      -DCMAKE_INSTALL_PREFIX=/usr
 }

 build() {
-    cd "$srcdir/${_pkgname}-${pkgver}/build"
-    make
+    cmake --build "$srcdir/${_pkgname}-${pkgver}/build"
 }

 check() {
-    cd "$srcdir/${_pkgname}-${pkgver}/build"
-    make test
+    cmake --build "$srcdir/${_pkgname}-${pkgver}/build" \
+          --target test
 }

 package() {
-    cd "$srcdir/${_pkgname}-${pkgver}/build"
-    make DESTDIR="$pkgdir/" install
+    DESTDIR="$pkgdir/" cmake --install "$srcdir/${_pkgname}-${pkgver}/build"

     cd "$srcdir/${_pkgname}-${pkgver}"
     install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

I took here the liberty to further simplify the build recipe. Particularly, setting linker flags is unnecessary since CMake pulls these from LDFLAGS anyway.

x2b commented on 2023-10-04 14:19 (UTC)

@ducakar: Sorry for the late reply. To improve build times I suggest you visit the makepkg page in the wiki:

https://wiki.archlinux.org/title/Makepkg

The TLDR is that you should set MAKEFLAGS="-j<N>" in /etc/makepkg.conf to enable parallel compilation system wide for your machine, which should make more sense than fiddling with individual packages (and including ninja as additional dependency).

ducakar commented on 2023-08-06 18:21 (UTC)

This builds in only one thread. Could you pass the -j <N> parameter for more parallel jobs or - even better - ninja?

x2b commented on 2022-03-21 09:17 (UTC)

@belgium: I updated to the latest release (1.2.1 currently), which compiles correctly on my machine. Beware that there are always a lot of warnings during the compilation, even if there are no downright errors.

belgium commented on 2022-03-20 19:51 (UTC)

doesn't compile, many errors