[geogram] Avoid hash_map and fix allocator. (#51747)

This commit is contained in:
Billy O'Neal 2026-05-14 10:38:45 -07:00 committed by GitHub
parent 415815cb4e
commit 32e9e58e7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 461 additions and 229 deletions

View File

@ -1,224 +1,224 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6934fca..c2f855d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@ set(GEOGRAM_INSTALL_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH "
set(GEOGRAM_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/modules CACHE PATH "CMake file install destination")
-set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
+set(VORPALINE_INCLUDE_SUBPATH ./)
# Determine the current Build-OS (Build-platform without the compiler info)
string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM})
@@ -130,6 +130,7 @@ endif()
add_subdirectory(src/lib/third_party)
if(GEOGRAM_WITH_GRAPHICS)
+find_package(GLFW3 REQUIRED)
add_subdirectory(src/lib/geogram_gfx)
endif()
@@ -160,7 +161,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
# FindGeogram.cmake
-install(FILES cmake/FindGeogram.cmake DESTINATION ${GEOGRAM_INSTALL_CMAKE_DIR} COMPONENT devkit)
+# This installation is not suitable for vcpkg
+# install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
+
+set(config_install_dir "share/geogram")
+set(include_install_dir "include")
+set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+# Configuration
+set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
+set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
+set(targets_export_name "${PROJECT_NAME}Targets")
+set(namespace "${PROJECT_NAME}::")
+
+# Include module with fuction 'write_basic_package_version_file'
+include(CMakePackageConfigHelpers)
+
+write_basic_package_version_file(
+ "${version_config}" COMPATIBILITY SameMajorVersion VERSION ${VORPALINE_VERSION}
+)
+
+configure_package_config_file(
+ "cmake/Config.cmake.in"
+ "${project_config}"
+ INSTALL_DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ EXPORT "${targets_export_name}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}"
+)
# Configure CPack
diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt
index d50b3d2..41ec3e4 100644
--- a/src/lib/geogram/CMakeLists.txt
+++ b/src/lib/geogram/CMakeLists.txt
@@ -69,7 +69,7 @@ endif()
# path for targets that depend on geogram.
# See: https://cmake.org/cmake/help/v3.3/command/target_include_directories.html
# https://stackoverflow.com/questions/26243169/cmake-target-include-directories-meaning-of-scope
-target_include_directories(geogram PUBLIC ${PROJECT_SOURCE_DIR}/src/lib)
+target_include_directories(geogram PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>)
if(ANDROID)
target_include_directories(geogram PRIVATE
@@ -78,6 +78,9 @@ ${ANDROID_NDK}/sources/android/native_app_glue
message(STATUS "building for Android")
endif()
+if(WIN32 AND VORPALINE_BUILD_DYNAMIC)
+ target_compile_definitions(geogram PUBLIC GEO_DYNAMIC_LIBS)
+endif()
set_target_properties(geogram PROPERTIES
VERSION ${VORPALINE_VERSION}
@@ -101,7 +104,14 @@ target_link_libraries(geogram ${GEOGRAMPLUS_LIBS})
endif()
# Install the library
-install_devkit_targets(geogram)
+install(
+ TARGETS geogram
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt
index 391e607..13b6bcb 100644
--- a/src/lib/geogram_gfx/CMakeLists.txt
+++ b/src/lib/geogram_gfx/CMakeLists.txt
@@ -52,14 +52,21 @@ target_link_libraries(geogram_gfx ${OPENGL_LIBRARIES})
endif()
# Install the library
-install_devkit_targets(geogram_gfx)
+install(
+ TARGETS geogram_gfx
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit
-FILES_MATCHING PATTERN *.h
+FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
# Install include files for the full devkit
@@ -67,7 +74,7 @@ install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit-full
-FILES_MATCHING PATTERN *.h
+FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
install(
diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt
index 5faf2fa..33c9bdd 100644
--- a/src/lib/third_party/numerics/CMakeLists.txt
+++ b/src/lib/third_party/numerics/CMakeLists.txt
@@ -14,10 +14,11 @@ endif()
include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)
+set(LAPACK_lapack_WORKS TRUE)
+find_package(BLAS REQUIRED)
+find_package(LAPACK REQUIRED)
aux_source_directories(SOURCES "Source Files" .)
aux_source_directories(SOURCES "Source Files\\LIBF2C" LIBF2C)
-aux_source_directories(SOURCES "Source Files\\CBLAS" CBLAS)
-aux_source_directories(SOURCES "Source Files\\CLAPACK" CLAPACK)
aux_source_directories(SOURCES "Source Files\\SUPERLU" SUPERLU)
aux_source_directories(SOURCES "Source Files\\ARPACK" ARPACK)
aux_source_directories(SOURCES "Source Files\\ARPACK_UTIL" ARPACK_UTIL)
@@ -28,6 +29,7 @@ list(REMOVE_ITEM SOURCES "LIBF2C/system_.c")
add_library(geogram_num_3rdparty ${SOURCES})
+target_link_libraries(geogram_num_3rdparty ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
if(UNIX)
target_link_libraries(geogram_num_3rdparty m)
endif()
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
index 2b69a1e..a4b4c55 100644
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
@@ -17,20 +17,21 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
void getarg_(ftnint *n, char *s, ftnlen ls)
#endif
{
- extern int xargc;
- extern char **xargv;
- Const char *t;
- int i;
+ // extern int xargc;
+ // extern char **xargv;
+ // Const char *t;
+ // int i;
- if(*n>=0 && *n<xargc)
- t = xargv[*n];
- else
- t = "";
- for(i = 0; i<ls && *t!='\0' ; ++i)
- *s++ = *t++;
- for( ; i<ls ; ++i)
- *s++ = ' ';
- }
+ // if(*n>=0 && *n<xargc)
+ // t = xargv[*n];
+ // else
+ // t = "";
+ // for(i = 0; i<ls && *t!='\0' ; ++i)
+ // *s++ = *t++;
+ // for( ; i<ls ; ++i)
+ // *s++ = ' ';
+ // }
+}
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
index 2f29da0..48dfd9f 100644
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
@@ -9,8 +9,9 @@ ftnint iargc_()
ftnint iargc_(void)
#endif
{
-extern int xargc;
-return ( xargc - 1 );
+// extern int xargc;
+// return ( xargc - 1 );
+ return -1;
}
#ifdef __cplusplus
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffa0615..18e0886 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@ set(GEOGRAM_INSTALL_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH "
set(GEOGRAM_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/modules CACHE PATH "CMake file install destination")
-set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
+set(VORPALINE_INCLUDE_SUBPATH ./)
# Determine the current Build-OS (Build-platform without the compiler info)
string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM})
@@ -130,6 +130,7 @@ endif()
add_subdirectory(src/lib/third_party)
if(GEOGRAM_WITH_GRAPHICS)
+find_package(GLFW3 REQUIRED)
add_subdirectory(src/lib/geogram_gfx)
endif()
@@ -160,7 +161,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
# FindGeogram.cmake
-install(FILES cmake/FindGeogram.cmake DESTINATION ${GEOGRAM_INSTALL_CMAKE_DIR} COMPONENT devkit)
+# This installation is not suitable for vcpkg
+# install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
+
+set(config_install_dir "share/geogram")
+set(include_install_dir "include")
+set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+# Configuration
+set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
+set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
+set(targets_export_name "${PROJECT_NAME}Targets")
+set(namespace "${PROJECT_NAME}::")
+
+# Include module with fuction 'write_basic_package_version_file'
+include(CMakePackageConfigHelpers)
+
+write_basic_package_version_file(
+ "${version_config}" COMPATIBILITY SameMajorVersion VERSION ${VORPALINE_VERSION}
+)
+
+configure_package_config_file(
+ "cmake/Config.cmake.in"
+ "${project_config}"
+ INSTALL_DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ EXPORT "${targets_export_name}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}"
+)
# Configure CPack
diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt
index d50b3d2..41ec3e4 100644
--- a/src/lib/geogram/CMakeLists.txt
+++ b/src/lib/geogram/CMakeLists.txt
@@ -69,7 +69,7 @@ endif()
# path for targets that depend on geogram.
# See: https://cmake.org/cmake/help/v3.3/command/target_include_directories.html
# https://stackoverflow.com/questions/26243169/cmake-target-include-directories-meaning-of-scope
-target_include_directories(geogram PUBLIC ${PROJECT_SOURCE_DIR}/src/lib)
+target_include_directories(geogram PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>)
if(ANDROID)
target_include_directories(geogram PRIVATE
@@ -78,6 +78,9 @@ ${ANDROID_NDK}/sources/android/native_app_glue
message(STATUS "building for Android")
endif()
+if(WIN32 AND VORPALINE_BUILD_DYNAMIC)
+ target_compile_definitions(geogram PUBLIC GEO_DYNAMIC_LIBS)
+endif()
set_target_properties(geogram PROPERTIES
VERSION ${VORPALINE_VERSION}
@@ -101,7 +104,14 @@ target_link_libraries(geogram ${GEOGRAMPLUS_LIBS})
endif()
# Install the library
-install_devkit_targets(geogram)
+install(
+ TARGETS geogram
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt
index 391e607..13b6bcb 100644
--- a/src/lib/geogram_gfx/CMakeLists.txt
+++ b/src/lib/geogram_gfx/CMakeLists.txt
@@ -52,14 +52,21 @@ target_link_libraries(geogram_gfx ${OPENGL_LIBRARIES})
endif()
# Install the library
-install_devkit_targets(geogram_gfx)
+install(
+ TARGETS geogram_gfx
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit
-FILES_MATCHING PATTERN *.h
+FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
# Install include files for the full devkit
@@ -67,7 +74,7 @@ install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit-full
-FILES_MATCHING PATTERN *.h
+FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
install(
diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt
index 5faf2fa..33c9bdd 100644
--- a/src/lib/third_party/numerics/CMakeLists.txt
+++ b/src/lib/third_party/numerics/CMakeLists.txt
@@ -14,10 +14,11 @@ endif()
include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)
+set(LAPACK_lapack_WORKS TRUE)
+find_package(BLAS REQUIRED)
+find_package(LAPACK REQUIRED)
aux_source_directories(SOURCES "Source Files" .)
aux_source_directories(SOURCES "Source Files\\LIBF2C" LIBF2C)
-aux_source_directories(SOURCES "Source Files\\CBLAS" CBLAS)
-aux_source_directories(SOURCES "Source Files\\CLAPACK" CLAPACK)
aux_source_directories(SOURCES "Source Files\\SUPERLU" SUPERLU)
aux_source_directories(SOURCES "Source Files\\ARPACK" ARPACK)
aux_source_directories(SOURCES "Source Files\\ARPACK_UTIL" ARPACK_UTIL)
@@ -28,6 +29,7 @@ list(REMOVE_ITEM SOURCES "LIBF2C/system_.c")
add_library(geogram_num_3rdparty ${SOURCES})
+target_link_libraries(geogram_num_3rdparty ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
if(UNIX)
target_link_libraries(geogram_num_3rdparty m)
endif()
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
index 2b69a1e..a4b4c55 100644
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
@@ -17,20 +17,21 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
void getarg_(ftnint *n, char *s, ftnlen ls)
#endif
{
- extern int xargc;
- extern char **xargv;
- Const char *t;
- int i;
+ // extern int xargc;
+ // extern char **xargv;
+ // Const char *t;
+ // int i;
- if(*n>=0 && *n<xargc)
- t = xargv[*n];
- else
- t = "";
- for(i = 0; i<ls && *t!='\0' ; ++i)
- *s++ = *t++;
- for( ; i<ls ; ++i)
- *s++ = ' ';
- }
+ // if(*n>=0 && *n<xargc)
+ // t = xargv[*n];
+ // else
+ // t = "";
+ // for(i = 0; i<ls && *t!='\0' ; ++i)
+ // *s++ = *t++;
+ // for( ; i<ls ; ++i)
+ // *s++ = ' ';
+ // }
+}
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
index 2f29da0..48dfd9f 100644
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
@@ -9,8 +9,9 @@ ftnint iargc_()
ftnint iargc_(void)
#endif
{
-extern int xargc;
-return ( xargc - 1 );
+// extern int xargc;
+// return ( xargc - 1 );
+ return -1;
}
#ifdef __cplusplus
}

View File

@ -5,6 +5,9 @@ vcpkg_from_github(
SHA512 19cf5720496172a144b2c5725a0a9763fde730ee14af75d92598973ff84106619e564d34746fd7b3da7d56f0cf52654fa656e3228fb32c0897f3aba178421f28
PATCHES
fix-vcpkg-install.patch
remove-hash-map.diff # https://github.com/BrunoLevy/geogram/commit/4e500108606584abfe50e66cf5cc161ab4b3a8d3
# + https://github.com/BrunoLevy/geogram/commit/5c18dc89209189ab7b507ad230b50ef2952cae49
# + https://github.com/BrunoLevy/geogram/pull/353
)
#third_party: amgcl
@ -31,9 +34,12 @@ vcpkg_from_github(
SHA512 b236279d3f0e6e1062703555415236183da31a9e40c49d478954586725f8dc6c0582aef0db7b605cb7967c3bd4a96d2fe8e6601cc56b8a1d53129a25efa7d1f2
)
file(REMOVE_RECURSE "${SOURCE_PATH}/src/lib/geogram/third_party/amgcl"
file(REMOVE_RECURSE
"${SOURCE_PATH}/src/lib/geogram/third_party/amgcl"
"${SOURCE_PATH}/src/lib/geogram/third_party/libMeshb"
"${SOURCE_PATH}/src/lib/geogram/third_party/rply")
"${SOURCE_PATH}/src/lib/geogram/third_party/rply"
)
file(RENAME "${AMGCL_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/amgcl")
file(RENAME "${LIBMESHB_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/libMeshb")
file(RENAME "${RPLY_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/rply")

View File

@ -0,0 +1,218 @@
diff --git a/src/bin/fpg/FPG/SymbolEnvironment.h b/src/bin/fpg/FPG/SymbolEnvironment.h
index b0c0265..b0b77ff 100644
--- a/src/bin/fpg/FPG/SymbolEnvironment.h
+++ b/src/bin/fpg/FPG/SymbolEnvironment.h
@@ -3,7 +3,6 @@
#include <string>
#include <vector>
-//#include <ext/hash_map>
#include <map>
#include <FPG/Symbol.h>
diff --git a/src/lib/geogram/basic/memory.h b/src/lib/geogram/basic/memory.h
index 73335a6..17b7e9d 100644
--- a/src/lib/geogram/basic/memory.h
+++ b/src/lib/geogram/basic/memory.h
@@ -487,9 +487,15 @@ namespace GEO {
template <class U>
struct rebind {
/** Equivalent allocator type to allocate elements of type \p U*/
- typedef aligned_allocator<U> other;
+ typedef aligned_allocator<U, ALIGN> other;
};
+ /* default constructor */
+ constexpr aligned_allocator() noexcept = default;
+
+ /* conversion copy constructor */
+ template <class U, int A2> constexpr aligned_allocator(const aligned_allocator<U, A2>&) noexcept { }
+
/**
* \brief Gets the address of an object
* \param[in] x a reference to an object of type T
@@ -613,14 +619,6 @@ namespace GEO {
(void) p; // to avoid a "unreferenced variable" warning
#endif
}
-
- /**
- * \brief Conversion operator to different aligned_allocator
- * \details Required when compiling under MSVC version <= 2010
- */
- template <class T2, int A2> operator aligned_allocator<T2, A2>() {
- return aligned_allocator<T2,A2>();
- }
};
/**
diff --git a/src/lib/geogram/third_party/PoissonRecon/Geometry.h b/src/lib/geogram/third_party/PoissonRecon/Geometry.h
index 746d480..0661846 100644
--- a/src/lib/geogram/third_party/PoissonRecon/Geometry.h
+++ b/src/lib/geogram/third_party/PoissonRecon/Geometry.h
@@ -31,8 +31,9 @@ DAMAGE.
#include <math.h>
#include <vector>
+#include <unordered_map>
#include <stdlib.h>
-#include "Hash.h"
+#include <stdio.h>
template<class Real>
Real Random(void);
@@ -280,7 +281,7 @@ public:
int addTriangle( int p1 , int p2 , int p3 );
protected:
- hash_map<long long,int> edgeMap;
+ std::unordered_map<long long,int> edgeMap;
static long long EdgeIndex( int p1 , int p2 );
double area(const Triangle& t);
};
diff --git a/src/lib/geogram/third_party/PoissonRecon/Geometry.inl b/src/lib/geogram/third_party/PoissonRecon/Geometry.inl
index f3cd508..cc1457b 100644
--- a/src/lib/geogram/third_party/PoissonRecon/Geometry.inl
+++ b/src/lib/geogram/third_party/PoissonRecon/Geometry.inl
@@ -324,7 +324,7 @@ double Triangulation<Real>::area(void){
}
template<class Real>
int Triangulation<Real>::addTriangle(int p1,int p2,int p3){
- hash_map<long long,int>::iterator iter;
+ std::unordered_map<long long,int>::iterator iter;
int tIdx,eIdx,p[3];
p[0]=p1;
p[1]=p2;
diff --git a/src/lib/geogram/third_party/PoissonRecon/Hash.h b/src/lib/geogram/third_party/PoissonRecon/Hash.h
deleted file mode 100644
index 93ee1a5..0000000
--- a/src/lib/geogram/third_party/PoissonRecon/Hash.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef HASH_INCLUDED
-#define HASH_INCLUDED
-
-#ifdef _MSC_VER
-#include <hash_map>
-using stdext::hash_map;
-#else // !WIN32
-#include <ext/hash_map>
-using namespace __gnu_cxx;
-
-namespace __gnu_cxx
-{
- template<> struct hash<long long> {
- size_t operator()(long long __x) const { return __x; }
- };
- template<> struct hash<const long long> {
- size_t operator()(const long long __x) const { return __x; }
- };
-
-
- template<> struct hash<unsigned long long> {
- size_t operator()(unsigned long long __x) const { return __x; }
- };
- template<> struct hash<const unsigned long long> {
- size_t operator()(const unsigned long long __x) const { return __x; }
- };
-}
-#endif // WIN32
-#endif // HASH_INCLUDED
-
diff --git a/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.IsoSurface.inl b/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.IsoSurface.inl
index 2eedd51..1449193 100644
--- a/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.IsoSurface.inl
+++ b/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.IsoSurface.inl
@@ -738,7 +738,7 @@ void Octree< Real >::SetSliceIsoEdges( int depth , int slice , int z , std::vect
#pragma omp critical( add_iso_edge_access )
{
typename Octree::template SliceValues< Vertex >& _sValues = slabValues[_depth].sliceValues( _slice );
- typename hash_map< long long , std::vector< IsoEdge > >::iterator iter = _sValues.faceEdgeMap.find(key);
+ typename std::unordered_map< long long , std::vector< IsoEdge > >::iterator iter = _sValues.faceEdgeMap.find(key);
if( iter==_sValues.faceEdgeMap.end() ) _sValues.faceEdgeMap[key] = edges;
else for( int j=0 ; j<fe.count ; j++ ) iter->second.push_back( fe.edges[j] );
}
@@ -817,7 +817,7 @@ void Octree< Real >::SetXSliceIsoEdges( int depth , int slab , std::vector< Slab
#pragma omp critical( add_x_iso_edge_access )
{
typename Octree::template XSliceValues< Vertex >& _xValues = slabValues[_depth].xSliceValues( _slab );
- typename hash_map< long long , std::vector< IsoEdge > >::iterator iter = _xValues.faceEdgeMap.find(key);
+ typename std::unordered_map< long long , std::vector< IsoEdge > >::iterator iter = _xValues.faceEdgeMap.find(key);
if( iter==_xValues.faceEdgeMap.end() ) _xValues.faceEdgeMap[key] = edges;
else for( int j=0 ; j<fe.count ; j++ ) iter->second.push_back( fe.edges[j] );
}
@@ -871,7 +871,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
else
{
long long key = VertexData::FaceIndex( leaf , f , _sNodes.levels() );
- typename hash_map< long long , std::vector< IsoEdge > >::const_iterator iter = sValues.faceEdgeMap.find( key );
+ typename std::unordered_map< long long , std::vector< IsoEdge > >::const_iterator iter = sValues.faceEdgeMap.find( key );
if( iter!=sValues.faceEdgeMap.end() )
{
const std::vector< IsoEdge >& _edges = iter->second;
@@ -891,7 +891,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
else
{
long long key = VertexData::FaceIndex( leaf , f , _sNodes.levels() );
- typename hash_map< long long , std::vector< IsoEdge > >::const_iterator iter = xValues.faceEdgeMap.find( key );
+ typename std::unordered_map< long long , std::vector< IsoEdge > >::const_iterator iter = xValues.faceEdgeMap.find( key );
if( iter!=xValues.faceEdgeMap.end() )
{
const std::vector< IsoEdge >& _edges = iter->second;
@@ -915,7 +915,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
for( idx=0 ; idx<(int)edges.size() ; idx++ ) if( edges[idx][0]==current ) break;
if( idx==edges.size() )
{
- typename hash_map< long long , long long >::const_iterator iter;
+ typename std::unordered_map< long long , long long >::const_iterator iter;
if ( (iter=bValues.vertexPairMap.find(current))!=bValues.vertexPairMap.end() ) loops.back().push_back( current ) , current = iter->second;
else if( (iter=fValues.vertexPairMap.find(current))!=fValues.vertexPairMap.end() ) loops.back().push_back( current ) , current = iter->second;
else if( (iter=xValues.vertexPairMap.find(current))!=xValues.vertexPairMap.end() ) loops.back().push_back( current ) , current = iter->second;
@@ -943,7 +943,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
for( size_t k=0 ; k<loops[j].size() ; k++ )
{
long long key = loops[j][k];
- typename hash_map< long long , std::pair< int , Vertex > >::const_iterator iter;
+ typename std::unordered_map< long long , std::pair< int , Vertex > >::const_iterator iter;
if ( ( iter=bValues.edgeVertexMap.find( key ) )!=bValues.edgeVertexMap.end() ) polygon[k] = iter->second;
else if( ( iter=fValues.edgeVertexMap.find( key ) )!=fValues.edgeVertexMap.end() ) polygon[k] = iter->second;
else if( ( iter=xValues.edgeVertexMap.find( key ) )!=xValues.edgeVertexMap.end() ) polygon[k] = iter->second;
diff --git a/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.h b/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.h
index be48702..f235434 100644
--- a/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.h
+++ b/src/lib/geogram/third_party/PoissonRecon/MultiGridOctreeData.h
@@ -91,7 +91,7 @@ DAMAGE.
#pragma message( "[WARNING] Not zeroing out normal component on boundary" )
#endif // !FORCE_NEUMANN_FIELD
-#include "Hash.h"
+#include <unordered_map>
#include "BSplineData.h"
#include "PointStream.h"
@@ -582,9 +582,9 @@ public:
Pointer( long long ) edgeKeys ; Pointer( char ) edgeSet;
Pointer( FaceEdges ) faceEdges ; Pointer( char ) faceSet;
Pointer( char ) mcIndices;
- hash_map< long long , std::vector< IsoEdge > > faceEdgeMap;
- hash_map< long long , std::pair< int , Vertex > > edgeVertexMap;
- hash_map< long long , long long > vertexPairMap;
+ std::unordered_map< long long , std::vector< IsoEdge > > faceEdgeMap;
+ std::unordered_map< long long , std::pair< int , Vertex > > edgeVertexMap;
+ std::unordered_map< long long , long long > vertexPairMap;
SliceValues( void );
~SliceValues( void );
@@ -598,9 +598,9 @@ public:
typename SortedTreeNodes::XSliceTableData xSliceData;
Pointer( long long ) edgeKeys ; Pointer( char ) edgeSet;
Pointer( FaceEdges ) faceEdges ; Pointer( char ) faceSet;
- hash_map< long long , std::vector< IsoEdge > > faceEdgeMap;
- hash_map< long long , std::pair< int , Vertex > > edgeVertexMap;
- hash_map< long long , long long > vertexPairMap;
+ std::unordered_map< long long , std::vector< IsoEdge > > faceEdgeMap;
+ std::unordered_map< long long , std::pair< int , Vertex > > edgeVertexMap;
+ std::unordered_map< long long , long long > vertexPairMap;
XSliceValues( void );
~XSliceValues( void );

View File

@ -1,6 +1,7 @@
{
"name": "geogram",
"version": "1.9.3",
"port-version": 1,
"description": "Geogram is a programming library of geometric algorithms.",
"homepage": "https://github.com/BrunoLevy/geogram",
"license": "BSD-3-Clause",

View File

@ -359,8 +359,10 @@ gdal[libxml2]:arm64-linux=feature-fails
gdbm[readline]:arm64-linux=feature-fails
gdk-pixbuf[introspection]:arm64-windows=skip # needs arm64 host
gegl:arm64-osx=fail # meson bug on osx. See https://github.com/microsoft/vcpkg/issues/44411
geogram:arm64-linux=cascade
geogram[graphics](!(arm64&linux))=feature-fails # imgui not found. See https://github.com/microsoft/vcpkg/issues/32421
geogram:arm64-linux=fail # Could NOT find Threads (missing: Threads_FOUND)
geogram[graphics]:arm64-linux=cascade
geogram[graphics](!(arm64&linux) & !android)=feature-fails # imgui not found. See https://github.com/microsoft/vcpkg/issues/32421
geogram[graphics](android)=cascade
geotrans=skip # Port geotrans source ftp://ftp.nga.mil server extremely slow may take several hours to download
ggml[cuda]:arm64-linux=cascade
ginkgo[cuda]:arm64-linux=cascade

View File

@ -3346,7 +3346,7 @@
},
"geogram": {
"baseline": "1.9.3",
"port-version": 0
"port-version": 1
},
"geographiclib": {
"baseline": "2.7",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8a11940d5a0f9c1c837b52ded23749d205615f0e",
"version": "1.9.3",
"port-version": 1
},
{
"git-tree": "dfa58f69f34946e88ea16f0321fc5e5682f664af",
"version": "1.9.3",