git: 55eef978300e - main - math/geogram: Unbreak on 15

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 20 Apr 2025 20:17:54 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=55eef978300ebc31f96caf67d521af7ccebf9623

commit 55eef978300ebc31f96caf67d521af7ccebf9623
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2025-04-20 20:16:21 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-04-20 20:17:52 +0000

    math/geogram: Unbreak on 15
    
    PR:             286244
---
 math/geogram/Makefile                              |  1 -
 math/geogram/files/patch-CMakeLists.txt            |  4 +--
 .../files/patch-src_lib_geogram_NL_nl__amgcl.cpp   | 25 ++++++++++++++
 .../files/patch-src_lib_geogram_NL_nl__private.h   |  4 +--
 .../files/patch-src_lib_geogram_basic_algorithm.h  |  4 +--
 .../patch-src_lib_geogram_basic_command__line.cpp  |  4 +--
 .../files/patch-src_lib_geogram_basic_common.h     |  4 +--
 .../files/patch-src_lib_geogram_lua_lua__io.cpp    |  4 +--
 ...ogram_third__party_PoissonRecon_PlyVertexMini.h | 38 ++++++++++++++++++++++
 ...gram_third__party_PoissonRecon_SparseMatrix.inl | 18 ++++++++++
 .../patch-src_lib_geogram_voronoi_convex__cell.cpp | 10 ++++++
 11 files changed, 103 insertions(+), 13 deletions(-)

diff --git a/math/geogram/Makefile b/math/geogram/Makefile
index e0d8ff1d3d91..15f208375f55 100644
--- a/math/geogram/Makefile
+++ b/math/geogram/Makefile
@@ -10,7 +10,6 @@ WWW=		https://github.com/BrunoLevy/geogram # was: https://github.com/alicevision
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/doc/devkit/license.dox
 
-BROKEN_FreeBSD_15=	compilation is broken with clang-19, see https://github.com/BrunoLevy/geogram/issues/188
 ONLY_FOR_ARCHS=	amd64 i386
 ONLY_FOR_ARCHS_REASON=	use of inline assembly for these architectures only, at least in src/lib/geogram/basic/atomics.h
 
diff --git a/math/geogram/files/patch-CMakeLists.txt b/math/geogram/files/patch-CMakeLists.txt
index fca07fc21795..438d70d8d43c 100644
--- a/math/geogram/files/patch-CMakeLists.txt
+++ b/math/geogram/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2018-12-09 18:48:27 UTC
+--- CMakeLists.txt.orig	2024-06-14 05:04:18 UTC
 +++ CMakeLists.txt
-@@ -132,7 +132,7 @@ if(NOT GEOGRAM_LIB_ONLY)
+@@ -141,7 +141,7 @@ endif()
    add_subdirectory(tests)
  endif()
  
diff --git a/math/geogram/files/patch-src_lib_geogram_NL_nl__amgcl.cpp b/math/geogram/files/patch-src_lib_geogram_NL_nl__amgcl.cpp
new file mode 100644
index 000000000000..37048ff4fd2d
--- /dev/null
+++ b/math/geogram/files/patch-src_lib_geogram_NL_nl__amgcl.cpp
@@ -0,0 +1,25 @@
+--- src/lib/geogram/NL/nl_amgcl.cpp.orig	2024-06-14 05:04:18 UTC
++++ src/lib/geogram/NL/nl_amgcl.cpp
+@@ -183,7 +183,7 @@ NLboolean nlSolveAMGCL() {
+ 
+     // There can be several linear systems to solve in OpenNL
+     for(int k=0; k<ctxt->nb_systems; ++k) {
+-	
++
+ 	if(ctxt->no_variables_indirection) {
+ 	    x = (double*)ctxt->variable_buffer[k].base_address;
+ 	    geo_assert(
+@@ -192,9 +192,11 @@ NLboolean nlSolveAMGCL() {
+ 	}
+ 
+ 	if(ctxt->verbose) {
+-	    GEO::Logger::out("AMGCL") << "Calling solver" << std::endl;
++        GEO::Logger::out("AMGCL") << "calling AMGCL solver (built in geogram) "
++				  << "(" << Backend::name() << ")"
++				  << std::endl;
+ 	}
+-	
++
+ 	// Call the solver and copy used iterations and last
+ 	// relative residual to OpenNL context.
+ 	std::tie(ctxt->used_iterations, ctxt->error) = solver(
diff --git a/math/geogram/files/patch-src_lib_geogram_NL_nl__private.h b/math/geogram/files/patch-src_lib_geogram_NL_nl__private.h
index 185c9f84e254..1cd628ccf71b 100644
--- a/math/geogram/files/patch-src_lib_geogram_NL_nl__private.h
+++ b/math/geogram/files/patch-src_lib_geogram_NL_nl__private.h
@@ -1,6 +1,6 @@
---- src/lib/geogram/NL/nl_private.h.orig	2018-12-09 21:38:58 UTC
+--- src/lib/geogram/NL/nl_private.h.orig	2024-06-14 05:04:18 UTC
 +++ src/lib/geogram/NL/nl_private.h
-@@ -67,7 +67,7 @@
+@@ -62,7 +62,7 @@
  #define NL_OS_APPLE
  #endif
  
diff --git a/math/geogram/files/patch-src_lib_geogram_basic_algorithm.h b/math/geogram/files/patch-src_lib_geogram_basic_algorithm.h
index 256dc47f8c17..85f528fe2f1e 100644
--- a/math/geogram/files/patch-src_lib_geogram_basic_algorithm.h
+++ b/math/geogram/files/patch-src_lib_geogram_basic_algorithm.h
@@ -1,6 +1,6 @@
---- src/lib/geogram/basic/algorithm.h.orig	2018-12-09 17:43:13 UTC
+--- src/lib/geogram/basic/algorithm.h.orig	2024-06-14 05:04:18 UTC
 +++ src/lib/geogram/basic/algorithm.h
-@@ -48,7 +48,7 @@
+@@ -42,7 +42,7 @@
  
  #include <geogram/basic/common.h>
  
diff --git a/math/geogram/files/patch-src_lib_geogram_basic_command__line.cpp b/math/geogram/files/patch-src_lib_geogram_basic_command__line.cpp
index 4d28dc3354d4..665bab5398a3 100644
--- a/math/geogram/files/patch-src_lib_geogram_basic_command__line.cpp
+++ b/math/geogram/files/patch-src_lib_geogram_basic_command__line.cpp
@@ -1,6 +1,6 @@
---- src/lib/geogram/basic/command_line.cpp.orig	2018-12-09 17:46:56 UTC
+--- src/lib/geogram/basic/command_line.cpp.orig	2024-06-14 05:04:18 UTC
 +++ src/lib/geogram/basic/command_line.cpp
-@@ -54,7 +54,7 @@
+@@ -49,7 +49,7 @@
  #include <iostream>
  #include <iomanip>
  
diff --git a/math/geogram/files/patch-src_lib_geogram_basic_common.h b/math/geogram/files/patch-src_lib_geogram_basic_common.h
index 3f491f75cc05..42f4cf8c2adc 100644
--- a/math/geogram/files/patch-src_lib_geogram_basic_common.h
+++ b/math/geogram/files/patch-src_lib_geogram_basic_common.h
@@ -1,6 +1,6 @@
---- src/lib/geogram/basic/common.h.orig	2018-12-09 17:36:40 UTC
+--- src/lib/geogram/basic/common.h.orig	2024-06-14 05:04:18 UTC
 +++ src/lib/geogram/basic/common.h
-@@ -221,6 +221,35 @@ namespace GEO {
+@@ -216,6 +216,35 @@ namespace GEO {
  #  define GEO_ARCH_32
  #endif
  
diff --git a/math/geogram/files/patch-src_lib_geogram_lua_lua__io.cpp b/math/geogram/files/patch-src_lib_geogram_lua_lua__io.cpp
index 86a90f435794..f545e8750ae6 100644
--- a/math/geogram/files/patch-src_lib_geogram_lua_lua__io.cpp
+++ b/math/geogram/files/patch-src_lib_geogram_lua_lua__io.cpp
@@ -1,6 +1,6 @@
---- src/lib/geogram/lua/lua_io.cpp.orig	2018-12-09 17:40:56 UTC
+--- src/lib/geogram/lua/lua_io.cpp.orig	2024-06-14 05:04:18 UTC
 +++ src/lib/geogram/lua/lua_io.cpp
-@@ -243,6 +243,8 @@ namespace {
+@@ -237,6 +237,8 @@ namespace {
  	    const char* result = "unknown";
  #if defined(GEO_OS_LINUX)
  	    result = "Linux";
diff --git a/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_PlyVertexMini.h b/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_PlyVertexMini.h
new file mode 100644
index 000000000000..2df2046120e5
--- /dev/null
+++ b/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_PlyVertexMini.h
@@ -0,0 +1,38 @@
+--- src/lib/geogram/third_party/PoissonRecon/PlyVertexMini.h.orig	2024-06-14 05:04:18 UTC
++++ src/lib/geogram/third_party/PoissonRecon/PlyVertexMini.h
+@@ -44,7 +44,7 @@ class PlyValueVertex (public)
+         PlyValueVertex( void ) : value( Real(0) ) { ; }
+         PlyValueVertex( Point3D< Real > p , Real v ) : point(p) , value(v) { ; }
+         PlyValueVertex operator + ( PlyValueVertex p ) const { return PlyValueVertex( point+p.point , value+p.value ); }
+-        PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.value , value-p.value ); }
++        PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.point , value-p.value ); }
+         template< class _Real > PlyValueVertex operator * ( _Real s ) const { return PlyValueVertex( point*s , Real(value*s) ); }
+         template< class _Real > PlyValueVertex operator / ( _Real s ) const { return PlyValueVertex( point/s , Real(value/s) ); }
+         PlyValueVertex& operator += ( PlyValueVertex p ) { point += p.point , value += p.value ; return *this; }
+@@ -68,7 +68,7 @@ class PlyOrientedVertex (public)
+         PlyOrientedVertex( void ) { ; }
+         PlyOrientedVertex( Point3D< Real > p , Point3D< Real > n ) : point(p) , normal(n) { ; }
+         PlyOrientedVertex operator + ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point+p.point , normal+p.normal ); }
+-        PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.value , normal-p.normal ); }
++        PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.point , normal-p.normal ); }
+         template< class _Real > PlyOrientedVertex operator * ( _Real s ) const { return PlyOrientedVertex( point*s , normal*s ); }
+         template< class _Real > PlyOrientedVertex operator / ( _Real s ) const { return PlyOrientedVertex( point/s , normal/s ); }
+         PlyOrientedVertex& operator += ( PlyOrientedVertex p ) { point += p.point , normal += p.normal ; return *this; }
+@@ -97,7 +97,7 @@ class PlyColorVertex (public)
+                 }
+ 
+                 _PlyColorVertex operator + ( _PlyColorVertex p ) const { return _PlyColorVertex( point+p.point , color+p.color ); }
+-                _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.value , color-p.color ); }
++                _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.point , color-p.color ); }
+                 template< class _Real > _PlyColorVertex operator * ( _Real s ) const { return _PlyColorVertex( point*s , color*s ); }
+                 template< class _Real > _PlyColorVertex operator / ( _Real s ) const { return _PlyColorVertex( point/s , color/s ); }
+                 _PlyColorVertex& operator += ( _PlyColorVertex p ) { point += p.point , color += p.color ; return *this; }
+@@ -143,7 +143,7 @@ class PlyColorAndValueVertex (public)
+                 }
+ 
+                 _PlyColorAndValueVertex operator + ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point+p.point , color+p.color , value+p.value ); }
+-                _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.value , color-p.color , value+p.value ); }
++                _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.point , color-p.color , value+p.value ); }
+                 template< class _Real > _PlyColorAndValueVertex operator * ( _Real s ) const { return _PlyColorAndValueVertex( point*s , color*s , value*s ); }
+                 template< class _Real > _PlyColorAndValueVertex operator / ( _Real s ) const { return _PlyColorAndValueVertex( point/s , color/s , value/s ); }
+                 _PlyColorAndValueVertex& operator += ( _PlyColorAndValueVertex p ) { point += p.point , color += p.color , value += p.value ; return *this; }
diff --git a/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_SparseMatrix.inl b/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_SparseMatrix.inl
new file mode 100644
index 000000000000..e7bb6f8473ed
--- /dev/null
+++ b/math/geogram/files/patch-src_lib_geogram_third__party_PoissonRecon_SparseMatrix.inl
@@ -0,0 +1,18 @@
+--- src/lib/geogram/third_party/PoissonRecon/SparseMatrix.inl.orig	2024-06-14 05:04:18 UTC
++++ src/lib/geogram/third_party/PoissonRecon/SparseMatrix.inl
+@@ -191,11 +191,15 @@ void SparseMatrix< T >::SetRowSize( int row , int coun
+ }
+ 
+ 
++/*
++//[Bruno] 11/09/2024 commented-out (m_M, m_N do not exist, breaks
++// clang-19 compile
+ template<class T>
+ void SparseMatrix<T>::SetZero()
+ {
+         Resize(this->m_N, this->m_M);
+ }
++*/
+ 
+ template<class T>
+ SparseMatrix<T> SparseMatrix<T>::operator * (const T& V) const
diff --git a/math/geogram/files/patch-src_lib_geogram_voronoi_convex__cell.cpp b/math/geogram/files/patch-src_lib_geogram_voronoi_convex__cell.cpp
new file mode 100644
index 000000000000..9522adaad10b
--- /dev/null
+++ b/math/geogram/files/patch-src_lib_geogram_voronoi_convex__cell.cpp
@@ -0,0 +1,10 @@
+--- src/lib/geogram/voronoi/convex_cell.cpp.orig	2024-06-14 05:04:18 UTC
++++ src/lib/geogram/voronoi/convex_cell.cpp
+@@ -274,7 +274,6 @@ namespace VBW {
+     /***********************************************************************/
+ 
+     void ConvexCell::save(const std::string& filename, double shrink) const {
+-	std::cerr << "====> Saving " << filename << std::endl;	
+ 	std::ofstream out(filename.c_str());
+ 	save(out, 1, shrink);
+     }