Skip to content

Commit 98def2c

Browse files
committed
[geogram] Update to 1.7.5
1 parent b8183de commit 98def2c

98 files changed

Lines changed: 54840 additions & 3382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ include(cmake/geogram.cmake)
4848

4949
set(VORPALINE_VERSION_MAJOR 1)
5050
set(VORPALINE_VERSION_MINOR 7)
51-
set(VORPALINE_VERSION_PATCH 4)
51+
set(VORPALINE_VERSION_PATCH 5)
5252
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
5353

5454
set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})

‎CMakeLists.txt.GARGANTUA‎

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
##############################################################################
2+
# Geogram/Vorpaline root CMakeList
3+
##############################################################################
4+
5+
# CMake 2.8.11 is required for 2 reasons:
6+
# - it is the first version that fully supports the specification of Visual
7+
# Studio toolsets (v110_xp).
8+
# - it is the version that supports the command string(TIMESTAMP ...)
9+
cmake_minimum_required(VERSION 2.8.11)
10+
11+
# Note: geogram.cmake defines GEOGRAM_WITH_VORPALINE
12+
# that we could have used instead,
13+
# but geogram.cmake needs to be included after the project()
14+
# command, since project() resets CFLAGS and CXXFLAGS.
15+
16+
if("$ENV{GEOGRAM_WITH_VORPALINE}" STREQUAL "")
17+
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/vorpalib)
18+
project(Vorpaline)
19+
else()
20+
project(Geogram)
21+
endif()
22+
elseif ("$ENV{GEOGRAM_WITH_VORPALINE}" STREQUAL ON)
23+
project(Vorpaline)
24+
else()
25+
project(Geogram)
26+
endif()
27+
28+
# Optional modules
29+
# (can be overriden in CMakeOptions.txt)
30+
31+
# Set GEOGRAM_SUB_BUILD if Geogram sources included in buildtree, then
32+
# VORPALINE_PLATFORM can be set directly in parent CMakeLists.txt
33+
if(NOT GEOGRAM_SUB_BUILD)
34+
option(GEOGRAM_WITH_GRAPHICS "Viewers and geogram_gfx library" OFF)
35+
option(GEOGRAM_WITH_LEGACY_NUMERICS "Legacy numerical libraries" OFF)
36+
option(GEOGRAM_WITH_HLBFGS "Non-linear solver (Yang Liu's HLBFGS)" OFF)
37+
option(GEOGRAM_WITH_TETGEN "Tetrahedral mesher (Hang Si's TetGen)" OFF)
38+
option(GEOGRAM_WITH_TRIANGLE "Triangle mesher (Jonathan Shewchuk's triangle)" OFF)
39+
option(GEOGRAM_WITH_EXPLORAGRAM "Experimental code (hexahedral meshing pipeline and optimal transport)" OFF)
40+
option(GEOGRAM_WITH_LUA "Built-in LUA interpreter" ON)
41+
option(GEOGRAM_LIB_ONLY "Libraries only (no example programs/no viewer)" OFF)
42+
option(GEOGRAM_WITH_FPG "Predicate generator (Sylvain Pion's FPG)" OFF)
43+
option(GEOGRAM_USE_SYSTEM_GLFW3 "Use the version of GLFW3 installed in the system if found" OFF)
44+
set(VORPALINE_PLATFORM "" CACHE STRING "")
45+
endif()
46+
47+
include(cmake/geogram.cmake)
48+
49+
set(VORPALINE_VERSION_MAJOR 1)
50+
set(VORPALINE_VERSION_MINOR 7)
51+
set(VORPALINE_VERSION_PATCH 5)
52+
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
53+
54+
set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
55+
56+
# Determine the current Build-OS (Build-platform without the compiler info)
57+
string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM})
58+
59+
# Determine the current build date
60+
string(TIMESTAMP VORPALINE_BUILD_DATE "%Y-%m-%d %H:%M:%S")
61+
string(TIMESTAMP YEAR "%Y")
62+
63+
# Determine the current build number
64+
# This is set by Jenkins in environment variable BUILD_NUMBER
65+
set(VORPALINE_BUILD_NUMBER $ENV{BUILD_NUMBER})
66+
67+
68+
##############################################################################
69+
# Get SVN revision info
70+
71+
if(GEOGRAM_WITH_VORPALINE)
72+
find_package(Subversion QUIET)
73+
if(NOT SUBVERSION_FOUND)
74+
message(WARNING "Subversion executable not found - cannot determine current revision")
75+
else()
76+
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Vorpaline)
77+
message(STATUS "Vorpaline revision is ${Vorpaline_WC_REVISION}")
78+
set(VORPALINE_SVN_REVISION ${Vorpaline_WC_REVISION})
79+
endif()
80+
endif()
81+
82+
##############################################################################
83+
# RPATH (where executables find the .so / DLLs)
84+
# - Enables RPATH support for MACOSX
85+
# - Makes RPATH of dynamic libraries and executable point to the directory
86+
# where libraries are installed.
87+
88+
if(VORPALINE_BUILD_DYNAMIC)
89+
set(CMAKE_MACOSX_RPATH 1)
90+
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
91+
endif()
92+
93+
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
94+
95+
# uninstall target
96+
# Needs to be created before add_subdirectory() because GLFw has
97+
# also an uninstall target that will be inhibited if there is
98+
# already one (Geogram's one needs to be first)
99+
100+
configure_file(
101+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
102+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
103+
IMMEDIATE @ONLY)
104+
105+
add_custom_target(uninstall
106+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
107+
108+
##############################################################################
109+
# Geogram/Vorpaline sources
110+
111+
add_subdirectory(src/lib/geogram)
112+
if(GEOGRAM_WITH_VORPALINE)
113+
add_subdirectory(src/lib/vorpalib)
114+
endif()
115+
116+
add_subdirectory(src/lib/third_party)
117+
118+
if(GEOGRAM_WITH_GRAPHICS)
119+
add_subdirectory(src/lib/geogram_gfx)
120+
endif()
121+
122+
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/exploragram)
123+
if(GEOGRAM_WITH_EXPLORAGRAM)
124+
add_subdirectory(src/lib/exploragram)
125+
endif()
126+
endif()
127+
128+
if(NOT GEOGRAM_LIB_ONLY)
129+
add_subdirectory(src/bin)
130+
add_subdirectory(src/tests)
131+
add_subdirectory(src/examples)
132+
add_subdirectory(tests)
133+
endif()
134+
135+
add_subdirectory(doc)
136+
137+
##############################################################################
138+
# Cleanup from previous builds
139+
140+
file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
141+
142+
143+
##############################################################################
144+
# Geogram installation
145+
146+
147+
# FindGeogram.cmake
148+
149+
install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
150+
151+
# Configure CPack
152+
153+
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
154+
set(CPACK_SYSTEM_NAME ${VORPALINE_OS})
155+
set(CPACK_PACKAGE_VENDOR "INRIA - ALICE")
156+
157+
158+
if(${GEOGRAM_WITH_VORPALINE})
159+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A flexible mesh generator")
160+
else()
161+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "fast, simple and easy-to-use primitives for geometric programming")
162+
endif()
163+
164+
set(CPACK_PACKAGE_VERSION_MAJOR ${VORPALINE_VERSION_MAJOR})
165+
set(CPACK_PACKAGE_VERSION_MINOR ${VORPALINE_VERSION_MINOR})
166+
set(CPACK_PACKAGE_VERSION_PATCH ${VORPALINE_VERSION_PATCH})
167+
set(CPACK_PACKAGE_VERSION ${VORPALINE_VERSION})
168+
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
169+
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY true)
170+
171+
if(CPACK_GENERATOR STREQUAL "DEB")
172+
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
173+
set(CPACK_PACKAGE_CONTACT Bruno.Levy@inria.fr)
174+
# set(CPACK_PACKAGE_DEPENDS "libglfw3 (>= 3.2-1), libc6 (>= 2.22-11), libstdc++ (>= 6.1.1-4)")
175+
# TODO: use objdump -p | grep NEEDED to automate...
176+
# or GET_PROPERTY(result GLOBAL ENABLED_FEATURES) (successful FIND_PACKAGE())
177+
endif()
178+
179+
if(NOT DEFINED CPACK_GENERATOR)
180+
if(WIN32)
181+
set(CPACK_GENERATOR ZIP)
182+
else()
183+
set(CPACK_GENERATOR TGZ)
184+
endif()
185+
endif()
186+
187+
# Enable component-based packaging for archive generators (TGZ, ZIP)
188+
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
189+
190+
set(CPACK_COMPONENTS_ALL runtime devkit devkit-full doc-devkit doc-devkit-full)
191+
set(CPACK_COMPONENTS_GROUPING "IGNORE")
192+
193+
set(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Vorpaline Application")
194+
set(CPACK_COMPONENT_RUNTIME_GROUP "Runtime")
195+
196+
set(CPACK_COMPONENT_DEVKIT_DISPLAY_NAME "Vorpaline Developer Kit")
197+
set(CPACK_COMPONENT_DEVKIT_GROUP "Development")
198+
199+
set(CPACK_COMPONENT_DEVKIT-FULL_DISPLAY_NAME "Vorpaline Full Developer Kit")
200+
set(CPACK_COMPONENT_DEVKIT-FULL_GROUP "Development")
201+
202+
set(CPACK_COMPONENT_DOC-DEVKIT_DISPLAY_NAME "Vorpaline API Developer Kit Documentation")
203+
set(CPACK_COMPONENT_DOC-DEVKIT_GROUP "Documentation")
204+
205+
set(CPACK_COMPONENT_DOC-DEVKIT-FULL_DISPLAY_NAME "Vorpaline Full Developer Kit Documentation")
206+
set(CPACK_COMPONENT_DOC-DEVKIT-FULL_GROUP "Documentation")
207+
208+
set(CPACK_COMPONENT_DOC-DEVKIT-INTERNAL_DISPLAY_NAME "Vorpaline Internal Developer Kit Documentation")
209+
set(CPACK_COMPONENT_DOC-DEVKIT-INTERNAL_GROUP "Documentation")
210+
211+
# Copy the helper script to build individual packages to the binary directory
212+
configure_file(
213+
tools/make_package.pl.in
214+
make_package.pl
215+
@ONLY
216+
)
217+
218+
# This must always be last!
219+
include(CPack)
220+
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
#-------------------------------------------------------------------
2+
# Flags common to all Linux based platforms with GNU compiler
3+
#-------------------------------------------------------------------
4+
5+
include(${GEOGRAM_SOURCE_DIR}/cmake/platforms/Linux.cmake)
6+
7+
# Warning flags
8+
set(NORMAL_WARNINGS -Wall -Wextra)
9+
set(FULL_WARNINGS
10+
${NORMAL_WARNINGS}
11+
-pedantic
12+
-Wno-long-long
13+
-Wconversion
14+
)
15+
16+
# Determine gcc version and activate additional warnings available in latest versions
17+
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
18+
19+
if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
20+
set(FULL_WARNINGS ${FULL_WARNINGS} -Wsign-conversion)
21+
endif()
22+
23+
if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
24+
set(FULL_WARNINGS ${FULL_WARNINGS} -Wdouble-promotion)
25+
endif()
26+
27+
28+
# Compile with full warnings by default
29+
add_definitions(${FULL_WARNINGS})
30+
31+
# Warn about missing virtual destructor (C++ only)
32+
add_flags(CMAKE_CXX_FLAGS -Wnon-virtual-dtor)
33+
34+
# Add static and dynamic bounds checks (optimization required)
35+
if (GCC_VERSION VERSION_GREATER 4.0)
36+
add_flags(CMAKE_CXX_FLAGS_RELEASE -D_FORTIFY_SOURCE=2)
37+
add_flags(CMAKE_C_FLAGS_RELEASE -D_FORTIFY_SOURCE=2)
38+
endif()
39+
40+
# Enable setting FPU rounding mode (needed by FPG) and
41+
# disable automatic generation of FMAs (would break exact
42+
# predicates)
43+
add_flags(CMAKE_CXX_FLAGS -frounding-math -ffp-contract=off)
44+
add_flags(CMAKE_C_FLAGS -frounding-math -ffp-contract=off)
45+
46+
# Activate AVX2 instruction set
47+
#add_flags(CMAKE_CXX_FLAGS -mavx2)
48+
#add_flags(CMAKE_C_FLAGS -mavx2)
49+
50+
# Activate 64 bit indices everywhere
51+
add_flags(CMAKE_CXX_FLAGS -DGARGANTUA)
52+
add_flags(CMAKE_C_FLAGS -DGARGANTUA)
53+
54+
55+
# Activate c++ 2011
56+
add_flags(CMAKE_CXX_FLAGS -std=c++11)
57+
58+
# Enable glibc parallel mode
59+
#add_flags(CMAKE_CXX_FLAGS -D_GLIBCXX_PARALLEL)
60+
61+
# Generate debug information even in release mode
62+
#add_flags(CMAKE_CXX_FLAGS_RELEASE -g)
63+
#add_flags(CMAKE_C_FLAGS_RELEASE -g)
64+
65+
# Additional debug flags
66+
# deactivated for now: I added bound checking in VOR::vector<>.
67+
#add_flags(CMAKE_CXX_FLAGS_DEBUG -D_GLIBCXX_DEBUG)
68+
69+
70+
# Compile and link with OpenMP
71+
if (GCC_VERSION VERSION_GREATER 4.0)
72+
add_flags(CMAKE_CXX_FLAGS -fopenmp)
73+
add_flags(CMAKE_C_FLAGS -fopenmp)
74+
endif()
75+
76+
# Alaways generate position independant code
77+
# (to allow linking geogram/vorlalib with DLLs)
78+
add_flags(CMAKE_CXX_FLAGS -fPIC)
79+
add_flags(CMAKE_C_FLAGS -fPIC)
80+
81+
# Hide symbols that are not explicitly exported
82+
add_flags(CMAKE_CXX_FLAGS -fvisibility=hidden)
83+
add_flags(CMAKE_C_FLAGS -fvisibility=hidden)
84+
85+
# Profiler compilation flags
86+
if(VORPALINE_WITH_GPROF)
87+
message(STATUS "Building for code profiling")
88+
add_flags(CMAKE_CXX_FLAGS -pg -DPROFILER)
89+
add_flags(CMAKE_C_FLAGS -pg -DPROFILER)
90+
endif()
91+
92+
93+
# Code coverage compilation flags
94+
if(VORPALINE_WITH_GCOV)
95+
message(STATUS "Building for coverage analysis")
96+
add_flags(CMAKE_CXX_FLAGS --coverage)
97+
add_flags(CMAKE_C_FLAGS --coverage)
98+
endif()
99+
100+
101+
# Compilation flags for Google's AddressSanitizer
102+
# These flags can only be specified for dynamic builds
103+
if(VORPALINE_WITH_ASAN)
104+
if(VORPALINE_BUILD_DYNAMIC)
105+
message(STATUS "Building with AddressSanitizer (debug only)")
106+
add_flags(CMAKE_CXX_FLAGS_DEBUG -fsanitize=address -fno-omit-frame-pointer)
107+
add_flags(CMAKE_C_FLAGS_DEBUG -fsanitize=address -fno-omit-frame-pointer)
108+
else()
109+
message(WARNING "AddressSanitizer can be used with dynamic builds only")
110+
set(VORPALINE_WITH_ASAN false)
111+
endif()
112+
endif()
113+
if(NOT VORPALINE_WITH_ASAN)
114+
# Use native GCC stack smash Protection and buffer overflow detection (debug only)
115+
add_flags(CMAKE_CXX_FLAGS_DEBUG -fstack-protector-all)
116+
add_flags(CMAKE_C_FLAGS_DEBUG -fstack-protector-all)
117+
endif()
118+
119+
120+
# Compilation flags for Google's ThreadSanitizer
121+
# Does not work for the moment: cannot figure out how to link with library libtsan
122+
if(VORPALINE_WITH_TSAN)
123+
message(STATUS "Building with ThreadSanitizer (debug only)")
124+
message(FATAL_ERROR "ThreadSanitizer is not available: cannot figure out how to link with library libtsan")
125+
add_flags(CMAKE_CXX_FLAGS_DEBUG -fsanitize=thread)
126+
add_flags(CMAKE_C_FLAGS_DEBUG -fsanitize=thread)
127+
if(NOT VORPALINE_BUILD_DYNAMIC)
128+
add_flags(CMAKE_EXE_LINKER_FLAGS -static-libtsan)
129+
endif()
130+
endif()
131+
132+
133+
# Reset the warning level for third parties
134+
function(vor_reset_warning_level)
135+
remove_definitions(${FULL_WARNINGS})
136+
add_definitions(${NORMAL_WARNINGS})
137+
endfunction()
138+
139+
macro(vor_add_executable)
140+
if(NOT VORPALINE_BUILD_DYNAMIC)
141+
# Create a statically linked executable
142+
# Link with static libraries
143+
add_flags(CMAKE_CXX_FLAGS -static-libstdc++ -static-libgcc -static)
144+
add_flags(CMAKE_C_FLAGS -static-libgcc -static)
145+
endif()
146+
147+
add_executable(${ARGN})
148+
149+
if(NOT VORPALINE_BUILD_DYNAMIC AND DEFINED VORPALINE_WITH_DDT)
150+
# Static builds running with Allinea's DDT must be linked with a
151+
# special malloc library which replaces the malloc primitives of
152+
# the Glibc (We must allow multiple definitions)
153+
add_flags(CMAKE_EXE_LINKER_FLAGS -Wl,--allow-multiple-definition)
154+
155+
if(VORPALINE_ARCH_64)
156+
link_directories(${VORPALINE_WITH_DDT}/lib/64)
157+
else()
158+
link_directories(${VORPALINE_WITH_DDT}/lib/32)
159+
endif()
160+
target_link_libraries(${ARGV0} dmallocthcxx)
161+
endif()
162+
163+
if(UNIX)
164+
target_link_libraries(${ARGV0} m pthread)
165+
endif()
166+
endmacro()
167+

0 commit comments

Comments
 (0)