Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2025 13:32:10 +0000
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 5e2782f377db - main - math/octave-forge-llms: fix build on non-x86
Message-ID:  <6949485a.37c38.bda95b@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e2782f377dbcbaeba368d1cd81eaf7eeb22115d

commit 5e2782f377dbcbaeba368d1cd81eaf7eeb22115d
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2025-12-22 13:26:32 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2025-12-22 13:31:53 +0000

    math/octave-forge-llms: fix build on non-x86
    
    /usr/local/bin/mkoctfile       -march=native -O2 fig2base64.cc fpng.cpp
    c++: error: unsupported option '-march=' for target 'powerpc64le-unknown-freebsd15.0'
    
    Also use __BYTE_ORDER__ instead of __BYTE_ORDER (which is undefined).
---
 math/octave-forge-llms/Makefile             |  1 +
 math/octave-forge-llms/files/patch-Makefile |  9 +++++++
 math/octave-forge-llms/files/patch-fpng.cpp | 39 +++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/math/octave-forge-llms/Makefile b/math/octave-forge-llms/Makefile
index 21c9fc32b8f4..0fac261aa88f 100644
--- a/math/octave-forge-llms/Makefile
+++ b/math/octave-forge-llms/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	octave-forge-llms
 DISTVERSIONPREFIX=	release-
 DISTVERSION=	0.1.2
+PORTREVISION=	1
 CATEGORIES=	math
 
 MAINTAINER=	stephen@FreeBSD.org
diff --git a/math/octave-forge-llms/files/patch-Makefile b/math/octave-forge-llms/files/patch-Makefile
new file mode 100644
index 000000000000..1273332beb4e
--- /dev/null
+++ b/math/octave-forge-llms/files/patch-Makefile
@@ -0,0 +1,9 @@
+--- Makefile.orig	2025-12-22 13:05:16 UTC
++++ Makefile
+@@ -1,5 +1,5 @@ all:
+ # Makefile for compiling required oct files
+ 
+ all:
+-	$(MKOCTFILE)       -march=native -O2 fig2base64.cc fpng.cpp
++	$(MKOCTFILE)       -O2 fig2base64.cc fpng.cpp
+ 	$(MKOCTFILE)       __ollama__.cc
diff --git a/math/octave-forge-llms/files/patch-fpng.cpp b/math/octave-forge-llms/files/patch-fpng.cpp
new file mode 100644
index 000000000000..e157e463c4cb
--- /dev/null
+++ b/math/octave-forge-llms/files/patch-fpng.cpp
@@ -0,0 +1,39 @@
+--- fpng.cpp.orig	2025-12-22 13:08:02 UTC
++++ fpng.cpp
+@@ -79,13 +79,13 @@
+ 	#endif
+ 
+ 	// Assume little endian on Windows/x86/x64.
+-	#define __BYTE_ORDER __LITTLE_ENDIAN
++	#define __BYTE_ORDER__ __LITTLE_ENDIAN
+ #elif defined(__APPLE__)
+-	#define __BYTE_ORDER __BYTE_ORDER__
++	#define __BYTE_ORDER__ __BYTE_ORDER__
+ 	#define __LITTLE_ENDIAN __LITTLE_ENDIAN__
+ 	#define __BIG_ENDIAN __BIG_ENDIAN__
+ #else
+-	// for __BYTE_ORDER (__LITTLE_ENDIAN or __BIG_ENDIAN)
++	// for __BYTE_ORDER__ (__LITTLE_ENDIAN or __BIG_ENDIAN)
+ 	#include <sys/param.h>
+ 
+ 	#ifndef __LITTLE_ENDIAN
+@@ -96,8 +96,8 @@
+ 	#endif
+ #endif
+ 
+-#if !defined(__BYTE_ORDER)
+-	#error __BYTE_ORDER undefined. Compile with -D__BYTE_ORDER=1234 for little endian or -D__BYTE_ORDER=4321 for big endian.
++#if !defined(__BYTE_ORDER__)
++	#error __BYTE_ORDER__ undefined. Compile with -D__BYTE_ORDER=1234 for little endian or -D__BYTE_ORDER=4321 for big endian.
+ #endif
+ 
+ namespace fpng
+@@ -131,7 +131,7 @@ namespace fpng
+ 	}
+ 
+ #if FPNG_USE_UNALIGNED_LOADS
+-	#if __BYTE_ORDER == __BIG_ENDIAN
++	#if __BYTE_ORDER__ == __BIG_ENDIAN
+ 		#define READ_LE32(p) swap32(*reinterpret_cast<const uint32_t *>(p))
+ 		#define WRITE_LE32(p, v) *reinterpret_cast<uint32_t *>(p) = swap32((uint32_t)(v))
+ 		#define WRITE_LE64(p, v) *reinterpret_cast<uint64_t *>(p) = swap64((uint64_t)(v))


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6949485a.37c38.bda95b>