diff --git a/math/geogram/Makefile b/math/geogram/Makefile index e0d8ff1d3d91..15f208375f55 100644 --- a/math/geogram/Makefile +++ b/math/geogram/Makefile @@ -1,44 +1,43 @@ PORTNAME= geogram DISTVERSIONPREFIX= v DISTVERSION= 1.9.0 CATEGORIES= math MAINTAINER= yuri@FreeBSD.org COMMENT= Programming library of geometric algorithms WWW= https://github.com/BrunoLevy/geogram # was: https://github.com/alicevision/geogram 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 LIB_DEPENDS= libglfw.so:graphics/glfw USES= cmake gl localbase:ldflags xorg USE_XORG= x11 xcursor xi xinerama xrandr xxf86vm USE_GL= gl glu USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= BrunoLevy GH_TUPLE= ddemidov:amgcl:a705f0822a332e215c41bccbeb6a7d92e90c49f2:ddemidov_amgcl/src/lib/geogram/third_party/amgcl \ glfw:glfw:b35641f4a3c62aa86a0b3c983d163bc0fe36026d:glfw_glfw/src/lib/third_party/glfw \ ocornut:imgui:6d948ab47ecf984239af01434f3ed03808dbf188:ocornut_imgui/src/lib/geogram_gfx/third_party/imgui \ LoicMarechal:libMeshb:e3678731ef14497c720ee7017a14450eba2602d2:LoicMarechal_libMeshb/src/lib/geogram/third_party/libMeshb \ diegonehab:rply:4296cc91b5c8c26d4e7d7aac0cee2b194ffc5800:diegonehab_rply/src/lib/geogram/third_party/rply CMAKE_ON= GEOGRAM_USE_SYSTEM_GLFW3 VORPALINE_BUILD_DYNAMIC CMAKE_ARGS= -DVORPALINE_PLATFORM:STRING=FreeBSD LDFLAGS+= -pthread \ -lexecinfo post-install: # delete empty folders, see https://github.com/BrunoLevy/geogram/issues/185 @${FIND} ${STAGEDIR}${PREFIX} -type d -empty -delete # unclear how to run tests, see https://github.com/BrunoLevy/geogram/issues/186 .include 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,11 +1,11 @@ ---- 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() -add_subdirectory(doc) +#add_subdirectory(doc) ############################################################################## # Cleanup from previous builds 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; knb_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,11 +1,11 @@ ---- 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 -#if defined(__linux__) || defined(__ANDROID__) || defined(NL_OS_APPLE) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(NL_OS_APPLE) /** * \brief Defined if compiled on a Unix-like platform. */ 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,11 +1,11 @@ ---- 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 -#if defined(GEO_OS_LINUX) && defined(GEO_OPENMP) +#if (defined(GEO_OS_LINUX) || defined(GEO_OS_FREEBSD)) && defined(GEO_OPENMP) #if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 4) && !defined(GEO_OS_ANDROID) #include #define GEO_USE_GCC_PARALLEL_STL 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,11 +1,11 @@ ---- 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 #include -#if defined(GEO_OS_LINUX) || defined(GEO_OS_APPLE) +#if defined(GEO_OS_LINUX) || defined(GEO_OS_FREEBSD) || defined(GEO_OS_APPLE) #include #include #include 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,38 +1,38 @@ ---- 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 +// =============================== FreeBSD defines ========================= + +#elif defined(__FreeBSD__) + +#define GEO_OS_FREEBSD +#define GEO_OS_UNIX + +#if defined(_OPENMP) +# define GEO_OPENMP +#endif + +#if defined(__INTEL_COMPILER) +# define GEO_COMPILER_INTEL +#elif defined(__clang__) +# define GEO_COMPILER_CLANG +#elif defined(__GNUC__) +# define GEO_COMPILER_GCC +#else +# error "Unsupported compiler" +#endif + +// The following works on GCC and ICC +#if defined(__x86_64) +# define GEO_ARCH_64 +#else +# define GEO_ARCH_32 +#endif + + // =============================== WINDOWS defines ========================= #elif defined(_WIN32) || defined(_WIN64) 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,11 +1,11 @@ ---- 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"; +#elif defined(GEO_OS_FREEBSD) + result = "FreeBSD"; #elif defined(GEO_OS_APPLE) result = "Apple"; #elif defined(GEO_OS_WINDOWS) 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 + void SparseMatrix::SetZero() + { + Resize(this->m_N, this->m_M); + } ++*/ + + template + SparseMatrix SparseMatrix::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); + }