From 153686a6c0a103fc90924eacc954b4a1691a0c9f Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 14 May 2018 05:53:16 +0000 Subject: Fix CGAL 4.12 build errors - include missing git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3435 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 59e1e78f26032154a8b81146b0f4d5b4ecead992 --- src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp | 2 ++ src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp | 2 ++ src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp | 2 ++ src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp | 2 ++ .../utilities/weighted_periodic_alpha_complex_3d_persistence.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp index efa20db9..8cda0b70 100644 --- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp index 54c074c4..cbe003ff 100644 --- a/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/exact_alpha_complex_3d_persistence.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp index 7c6e1583..11010701 100644 --- a/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/periodic_alpha_complex_3d_persistence.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp index 54483819..cdeeabfc 100644 --- a/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_alpha_complex_3d_persistence.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include // For CGAL < 4.11 diff --git a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp index f03f29a7..d030c88c 100644 --- a/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp +++ b/src/Alpha_complex/utilities/weighted_periodic_alpha_complex_3d_persistence.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include -- cgit v1.2.3 -- cgit v1.2.3 From 00a3424bd68ced3e2d159acf8b2e73f515a3d88b Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 15 May 2018 19:55:31 +0000 Subject: CMake minimal version is now 3.1 Compilation flags are now externalized in cmake/modules Add NO_POLICY_SCOPE for GUDHI_third_parties to fix warnings Try to fix CGAL 4.12 that is no more setting CGAL_LIBRARIES git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cmake_v3_vincent@3445 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0ac7613f016e28cc634606f76e85ecaf5bacb2d4 --- CMakeLists.txt | 29 ++++------------ src/Alpha_complex/example/CMakeLists.txt | 1 - src/Alpha_complex/test/CMakeLists.txt | 1 - src/Alpha_complex/utilities/CMakeLists.txt | 1 - src/Bitmap_cubical_complex/example/CMakeLists.txt | 1 - src/Bitmap_cubical_complex/test/CMakeLists.txt | 1 - .../utilities/CMakeLists.txt | 1 - src/Bottleneck_distance/benchmark/CMakeLists.txt | 1 - src/Bottleneck_distance/example/CMakeLists.txt | 1 - src/Bottleneck_distance/test/CMakeLists.txt | 1 - src/Bottleneck_distance/utilities/CMakeLists.txt | 1 - src/CMakeLists.txt | 39 ++++++---------------- src/Contraction/example/CMakeLists.txt | 1 - src/GudhUI/CMakeLists.txt | 3 +- src/Nerve_GIC/example/CMakeLists.txt | 7 ++-- src/Nerve_GIC/test/CMakeLists.txt | 1 - src/Nerve_GIC/utilities/CMakeLists.txt | 1 - .../example/CMakeLists.txt | 1 - .../test/CMakeLists.txt | 1 - .../utilities/persistence_heat_maps/CMakeLists.txt | 1 - .../utilities/persistence_intervals/CMakeLists.txt | 1 - .../persistence_landscapes/CMakeLists.txt | 1 - .../persistence_landscapes_on_grid/CMakeLists.txt | 1 - .../utilities/persistence_vectors/CMakeLists.txt | 1 - src/Persistent_cohomology/benchmark/CMakeLists.txt | 2 -- src/Persistent_cohomology/example/CMakeLists.txt | 1 - src/Persistent_cohomology/test/CMakeLists.txt | 1 - src/Rips_complex/example/CMakeLists.txt | 1 - src/Rips_complex/test/CMakeLists.txt | 1 - src/Rips_complex/utilities/CMakeLists.txt | 1 - src/Simplex_tree/example/CMakeLists.txt | 1 - src/Simplex_tree/test/CMakeLists.txt | 1 - src/Skeleton_blocker/example/CMakeLists.txt | 1 - src/Skeleton_blocker/test/CMakeLists.txt | 1 - src/Spatial_searching/example/CMakeLists.txt | 1 - src/Spatial_searching/test/CMakeLists.txt | 1 - src/Subsampling/example/CMakeLists.txt | 1 - src/Subsampling/test/CMakeLists.txt | 1 - src/Tangential_complex/benchmark/CMakeLists.txt | 1 - src/Tangential_complex/example/CMakeLists.txt | 1 - src/Tangential_complex/test/CMakeLists.txt | 1 - src/Witness_complex/example/CMakeLists.txt | 1 - src/Witness_complex/test/CMakeLists.txt | 1 - src/Witness_complex/utilities/CMakeLists.txt | 1 - src/cmake/modules/GUDHI_compilation_flags.cmake | 36 ++++++++++++++++++++ src/common/example/CMakeLists.txt | 1 - src/common/test/CMakeLists.txt | 1 - src/common/utilities/CMakeLists.txt | 1 - src/cython/CMakeLists.txt | 6 ++-- 49 files changed, 60 insertions(+), 104 deletions(-) create mode 100644 src/cmake/modules/GUDHI_compilation_flags.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 10373f75..08291b54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,35 +1,18 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.1) + project(GUDHIdev) include(CMakeGUDHIVersion.txt) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") -enable_testing() - -# This variable is used by Cython CMakeLists.txt to know its path +# This variable is used by Cython CMakeLists.txt and by GUDHI_third_party_libraries to know its path set(GUDHI_CYTHON_PATH "src/cython") -# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include(GUDHI_third_party_libraries) - -if(MSVC) - # Turn off some VC++ warnings - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic") -endif() -if(CMAKE_BUILD_TYPE MATCHES Debug) - message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") -else() - message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") -endif() +# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH +include(GUDHI_third_party_libraries NO_POLICY_SCOPE) -if (DEBUG_TRACES) - # For programs to be more verbose - message(STATUS "DEBUG_TRACES are activated") - add_definitions(-DDEBUG_TRACES) -endif() +include(GUDHI_compilation_flags) # Add your new module in the list, order is not important include(GUDHI_modules) diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index 5bf553e9..2fc62452 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Alpha_complex_examples) # need CGAL 4.7 diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index 9e0b3b3c..9255d3db 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Alpha_complex_tests) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/Alpha_complex/utilities/CMakeLists.txt b/src/Alpha_complex/utilities/CMakeLists.txt index a2dfac20..7ace6064 100644 --- a/src/Alpha_complex/utilities/CMakeLists.txt +++ b/src/Alpha_complex/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Alpha_complex_utilities) if(CGAL_FOUND) diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt index 99304aa4..dc659f2d 100644 --- a/src/Bitmap_cubical_complex/example/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bitmap_cubical_complex_examples) add_executable ( Random_bitmap_cubical_complex Random_bitmap_cubical_complex.cpp ) diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt index 02b026f2..8b43632a 100644 --- a/src/Bitmap_cubical_complex/test/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bitmap_cubical_complex_tests) include(GUDHI_test_coverage) diff --git a/src/Bitmap_cubical_complex/utilities/CMakeLists.txt b/src/Bitmap_cubical_complex/utilities/CMakeLists.txt index 676a730a..416db67f 100644 --- a/src/Bitmap_cubical_complex/utilities/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bitmap_cubical_complex_utilities) add_executable ( cubical_complex_persistence cubical_complex_persistence.cpp ) diff --git a/src/Bottleneck_distance/benchmark/CMakeLists.txt b/src/Bottleneck_distance/benchmark/CMakeLists.txt index 20a4e47b..3105a1d5 100644 --- a/src/Bottleneck_distance/benchmark/CMakeLists.txt +++ b/src/Bottleneck_distance/benchmark/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_benchmark) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt index 6095d6eb..c6f10127 100644 --- a/src/Bottleneck_distance/example/CMakeLists.txt +++ b/src/Bottleneck_distance/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_examples) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/test/CMakeLists.txt b/src/Bottleneck_distance/test/CMakeLists.txt index 2676b82c..bb739280 100644 --- a/src/Bottleneck_distance/test/CMakeLists.txt +++ b/src/Bottleneck_distance/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_tests) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/utilities/CMakeLists.txt b/src/Bottleneck_distance/utilities/CMakeLists.txt index d19e3b1c..2f35885c 100644 --- a/src/Bottleneck_distance/utilities/CMakeLists.txt +++ b/src/Bottleneck_distance/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_utilities) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94587044..5d543018 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,19 @@ -cmake_minimum_required(VERSION 2.6) -project(GUDHI) +cmake_minimum_required(VERSION 3.1) -include("CMakeGUDHIVersion.txt") +project(GUDHI) -enable_testing() +include(CMakeGUDHIVersion.txt) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") +# This variable is used by Cython CMakeLists.txt and by GUDHI_third_party_libraries to know its path +set(GUDHI_CYTHON_PATH "cython") + +# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH +include(GUDHI_third_party_libraries NO_POLICY_SCOPE) + +include(GUDHI_compilation_flags) + # Add your new module in the list, order is not important include(GUDHI_modules) @@ -33,30 +40,6 @@ message("++ GUDHI_MODULES list is:\"${GUDHI_MODULES}\"") set(GUDHI_USER_VERSION_DIR ${CMAKE_SOURCE_DIR}) include(GUDHI_doxygen_target) -# This variable is used by Cython CMakeLists.txt to know its path -set(GUDHI_CYTHON_PATH "cython") -# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include(GUDHI_third_party_libraries) - -if(MSVC) - # Turn off some VC++ warnings - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic") -endif() - -if(CMAKE_BUILD_TYPE MATCHES Debug) - message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") -else() - message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") -endif() - -if (DEBUG_TRACES) - message(STATUS "DEBUG_TRACES are activated") - # For programs to be more verbose - add_definitions(-DDEBUG_TRACES) -endif() - #--------------------------------------------------------------------------------------- # Gudhi compilation part include_directories(include) diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt index a92d1685..582b7ab8 100644 --- a/src/Contraction/example/CMakeLists.txt +++ b/src/Contraction/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Contraction_examples) add_executable(RipsContraction Rips_contraction.cpp) diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index 2503a03e..b357b8f7 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8) project(GudhUI) # Need to find OpenGL first as find_package(Qt5) tries to #include"GL/gl.h" on some platforms @@ -38,4 +37,4 @@ if (OPENGL_FOUND) install(TARGETS GudhUI DESTINATION bin) endif() -endif(OPENGL_FOUND) \ No newline at end of file +endif(OPENGL_FOUND) diff --git a/src/Nerve_GIC/example/CMakeLists.txt b/src/Nerve_GIC/example/CMakeLists.txt index 542c6af4..fdecf86e 100644 --- a/src/Nerve_GIC/example/CMakeLists.txt +++ b/src/Nerve_GIC/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Nerve_GIC_examples) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) @@ -17,11 +16,11 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1) file(COPY "${CMAKE_SOURCE_DIR}/data/points/COIL_database/lucky_cat_PCA1" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) add_test(NAME Nerve_GIC_example_CoordGIC COMMAND $ - "tore3D_1307.off" "0") + "${CMAKE_CURRENT_BINARY_DIR}/tore3D_1307.off" "0") add_test(NAME Nerve_GIC_example_FuncGIC COMMAND $ - "lucky_cat.off" - "lucky_cat_PCA1") + "${CMAKE_CURRENT_BINARY_DIR}/lucky_cat.off" + "${CMAKE_CURRENT_BINARY_DIR}/lucky_cat_PCA1") install(TARGETS CoordGIC DESTINATION bin) install(TARGETS FuncGIC DESTINATION bin) diff --git a/src/Nerve_GIC/test/CMakeLists.txt b/src/Nerve_GIC/test/CMakeLists.txt index c35cdff7..99263ea0 100644 --- a/src/Nerve_GIC/test/CMakeLists.txt +++ b/src/Nerve_GIC/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Graph_induced_complex_tests) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Nerve_GIC/utilities/CMakeLists.txt b/src/Nerve_GIC/utilities/CMakeLists.txt index 7a838a8c..215f9dfd 100644 --- a/src/Nerve_GIC/utilities/CMakeLists.txt +++ b/src/Nerve_GIC/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Nerve_GIC_examples) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Persistence_representations/example/CMakeLists.txt b/src/Persistence_representations/example/CMakeLists.txt index 54d719ac..33558df3 100644 --- a/src/Persistence_representations/example/CMakeLists.txt +++ b/src/Persistence_representations/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_example) add_executable ( Persistence_representations_example_landscape_on_grid persistence_landscape_on_grid.cpp ) diff --git a/src/Persistence_representations/test/CMakeLists.txt b/src/Persistence_representations/test/CMakeLists.txt index 335a71ef..5e2b6910 100644 --- a/src/Persistence_representations/test/CMakeLists.txt +++ b/src/Persistence_representations/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_test) include(GUDHI_test_coverage) diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_heat_maps/CMakeLists.txt index 386e9fa5..89ef232f 100644 --- a/src/Persistence_representations/utilities/persistence_heat_maps/CMakeLists.txt +++ b/src/Persistence_representations/utilities/persistence_heat_maps/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_heat_maps_utilities) add_persistence_representation_creation_utility(create_pssk "10" "-1" "-1" "4" "-1") diff --git a/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt index 875ff45e..649b72cb 100644 --- a/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt +++ b/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_intervals_utilities) diff --git a/src/Persistence_representations/utilities/persistence_landscapes/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_landscapes/CMakeLists.txt index d7087ed8..6b24d032 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes/CMakeLists.txt +++ b/src/Persistence_representations/utilities/persistence_landscapes/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_landscapes_utilities) add_persistence_representation_creation_utility(create_landscapes "-1") diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/CMakeLists.txt index c5ea4bbf..36f3196b 100644 --- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/CMakeLists.txt +++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_representations_lanscapes_on_grid_utilities) # Need to set grid min and max for further average, distance and scalar_product diff --git a/src/Persistence_representations/utilities/persistence_vectors/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_vectors/CMakeLists.txt index a401c955..bc982094 100644 --- a/src/Persistence_representations/utilities/persistence_vectors/CMakeLists.txt +++ b/src/Persistence_representations/utilities/persistence_vectors/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistence_vectors_utilities) add_persistence_representation_creation_utility(create_persistence_vectors "-1") diff --git a/src/Persistent_cohomology/benchmark/CMakeLists.txt b/src/Persistent_cohomology/benchmark/CMakeLists.txt index 8b135ba1..2bb3b0c7 100644 --- a/src/Persistent_cohomology/benchmark/CMakeLists.txt +++ b/src/Persistent_cohomology/benchmark/CMakeLists.txt @@ -1,6 +1,4 @@ -cmake_minimum_required(VERSION 2.6) project(Persistent_cohomology_benchmark) - if(GMP_FOUND) if(GMPXX_FOUND) diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 18e2913b..0f731519 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistent_cohomology_examples) add_executable(plain_homology plain_homology.cpp) diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index 45f53eb9..f8baf861 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Persistent_cohomology_tests) include(GUDHI_test_coverage) diff --git a/src/Rips_complex/example/CMakeLists.txt b/src/Rips_complex/example/CMakeLists.txt index af86636b..e7772bdb 100644 --- a/src/Rips_complex/example/CMakeLists.txt +++ b/src/Rips_complex/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Rips_complex_examples) # Point cloud diff --git a/src/Rips_complex/test/CMakeLists.txt b/src/Rips_complex/test/CMakeLists.txt index 3da9c90d..745d953c 100644 --- a/src/Rips_complex/test/CMakeLists.txt +++ b/src/Rips_complex/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Rips_complex_tests) include(GUDHI_test_coverage) diff --git a/src/Rips_complex/utilities/CMakeLists.txt b/src/Rips_complex/utilities/CMakeLists.txt index deb73ff0..4b565628 100644 --- a/src/Rips_complex/utilities/CMakeLists.txt +++ b/src/Rips_complex/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Rips_complex_utilities) add_executable(rips_distance_matrix_persistence rips_distance_matrix_persistence.cpp) diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index b33b2d05..857e8518 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Simplex_tree_examples) add_executable ( Simplex_tree_example_from_cliques_of_graph simplex_tree_from_cliques_of_graph.cpp ) diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index 8684ad2a..c63d8532 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Simplex_tree_tests) include(GUDHI_test_coverage) diff --git a/src/Skeleton_blocker/example/CMakeLists.txt b/src/Skeleton_blocker/example/CMakeLists.txt index de70f089..0e5d2f11 100644 --- a/src/Skeleton_blocker/example/CMakeLists.txt +++ b/src/Skeleton_blocker/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Skeleton_blocker_examples) add_executable(Skeleton_blocker_example_from_simplices Skeleton_blocker_from_simplices.cpp) diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt index 4a363294..19c65871 100644 --- a/src/Skeleton_blocker/test/CMakeLists.txt +++ b/src/Skeleton_blocker/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Skeleton_blocker_tests) include(GUDHI_test_coverage) diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt index 4cf3d863..0f799987 100644 --- a/src/Spatial_searching/example/CMakeLists.txt +++ b/src/Spatial_searching/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Spatial_searching_examples) if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index b9da7b4e..b60ab1e3 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Spatial_searching_tests) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 34400b1e..f26d107f 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Subsampling_examples) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index dbf97db3..924f0925 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Subsampling_tests) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/benchmark/CMakeLists.txt b/src/Tangential_complex/benchmark/CMakeLists.txt index 8729e394..f136ab27 100644 --- a/src/Tangential_complex/benchmark/CMakeLists.txt +++ b/src/Tangential_complex/benchmark/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Tangential_complex_benchmark) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 16d1339d..af0dac51 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Tangential_complex_examples) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/test/CMakeLists.txt b/src/Tangential_complex/test/CMakeLists.txt index 1948c8f6..902f19af 100644 --- a/src/Tangential_complex/test/CMakeLists.txt +++ b/src/Tangential_complex/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Tangential_complex_tests) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index a8231392..3d838c0d 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Witness_complex_examples) add_executable ( Witness_complex_example_nearest_landmark_table example_nearest_landmark_table.cpp ) diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt index 0b523eaf..58ac60c5 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Witness_complex_tests) include(GUDHI_test_coverage) diff --git a/src/Witness_complex/utilities/CMakeLists.txt b/src/Witness_complex/utilities/CMakeLists.txt index 125a41ff..ce5e29f2 100644 --- a/src/Witness_complex/utilities/CMakeLists.txt +++ b/src/Witness_complex/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Witness_complex_utilities) # CGAL and Eigen3 are required for Euclidean version of Witness diff --git a/src/cmake/modules/GUDHI_compilation_flags.cmake b/src/cmake/modules/GUDHI_compilation_flags.cmake new file mode 100644 index 00000000..614d3812 --- /dev/null +++ b/src/cmake/modules/GUDHI_compilation_flags.cmake @@ -0,0 +1,36 @@ +# This files manage compilation flags required by GUDHI + +include(TestCXXAcceptsFlag) + +# add a compiler flag only if it is accepted +macro(add_cxx_compiler_flag _flag) + string(REPLACE "-" "_" _flag_var ${_flag}) + check_cxx_accepts_flag("${_flag}" CXX_COMPILER_${_flag_var}_OK) + if(CXX_COMPILER_${_flag_var}_OK) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}") + endif() +endmacro() + +set (CMAKE_CXX_STANDARD 11) + +enable_testing() + +if(MSVC) + # Turn off some VC++ warnings + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") +endif() + +add_cxx_compiler_flag("-Wall") +add_cxx_compiler_flag("-pedantic") + +if(CMAKE_BUILD_TYPE MATCHES Debug) + message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") +else() + message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") +endif() + +if (DEBUG_TRACES) + # For programs to be more verbose + message(STATUS "DEBUG_TRACES are activated") + add_definitions(-DDEBUG_TRACES) +endif() diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 1273c699..04015cdc 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Common_examples) add_executable ( vector_double_off_reader example_vector_double_points_off_reader.cpp ) diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index de3e765a..0b49fa1e 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(Common_tests) include(GUDHI_test_coverage) diff --git a/src/common/utilities/CMakeLists.txt b/src/common/utilities/CMakeLists.txt index b3e4b436..7f1d1cd7 100644 --- a/src/common/utilities/CMakeLists.txt +++ b/src/common/utilities/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.6) project(off_file_from_shape_generator) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index b19cc550..2c21d158 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8) project(Cython) include(CheckCXXSourceCompiles) @@ -100,12 +99,13 @@ if(CYTHON_FOUND) add_gudhi_cython_lib(${Boost_THREAD_LIBRARY}) set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ") endif() - + message("*** ${CGAL_HEADER_ONLY}") # Add CGAL compilation args if(CGAL_HEADER_ONLY) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DCGAL_HEADER_ONLY', ") else(CGAL_HEADER_ONLY) - add_gudhi_cython_lib(${CGAL_LIBRARIES}) + message("*** ${CGAL_LIBRARY}") + add_gudhi_cython_lib(${CGAL_LIBRARY}) set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${CGAL_LIBRARIES_DIR}', ") # If CGAL is not header only, CGAL library may link with boost system, add_gudhi_cython_lib(${Boost_SYSTEM_LIBRARY}) -- cgit v1.2.3 From a135db991a6c7a49659b77660796c99c7cddb1dc Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 15 May 2018 20:56:53 +0000 Subject: Seems to be fixed. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cmake_v3_vincent@3446 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 01f10ae61484982dc99fd67573d9ca61ffbbec0a --- src/cython/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index 2c21d158..1b953648 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -99,12 +99,10 @@ if(CYTHON_FOUND) add_gudhi_cython_lib(${Boost_THREAD_LIBRARY}) set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ") endif() - message("*** ${CGAL_HEADER_ONLY}") # Add CGAL compilation args if(CGAL_HEADER_ONLY) set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DCGAL_HEADER_ONLY', ") else(CGAL_HEADER_ONLY) - message("*** ${CGAL_LIBRARY}") add_gudhi_cython_lib(${CGAL_LIBRARY}) set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${CGAL_LIBRARIES_DIR}', ") # If CGAL is not header only, CGAL library may link with boost system, -- cgit v1.2.3 From 843a6603e27a55062133ec53f7719c27da6614eb Mon Sep 17 00:00:00 2001 From: glisse Date: Fri, 18 May 2018 17:09:51 +0000 Subject: Try once more to clarify what 'keys' do in the FilteredComplex concept. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3447 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 59ba4649eb53b4da2b24e4a147196c2a93641aec --- .../concept/FilteredComplex.h | 34 +++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Persistent_cohomology/concept/FilteredComplex.h b/src/Persistent_cohomology/concept/FilteredComplex.h index 178503c9..62b9002f 100644 --- a/src/Persistent_cohomology/concept/FilteredComplex.h +++ b/src/Persistent_cohomology/concept/FilteredComplex.h @@ -29,10 +29,6 @@ struct FilteredComplex { /** Handle to specify a simplex. */ typedef unspecified Simplex_handle; -/** \brief Key associated to each simplex. - * - * Must be an integer type. */ - typedef unspecified Simplex_key; /** \brief Type for the value of the filtration function. * * Must be comparable with <. */ @@ -58,20 +54,10 @@ struct FilteredComplex * filtration function on the complex. */ Filtration_value filtration(Simplex_handle sh); -/** \brief Returns a key that is different from the keys associated - * to the simplices. */ - Simplex_key null_key (); -/** \brief Returns the key associated to a simplex. - * - * This is never called on null_simplex(). */ - Simplex_key key ( Simplex_handle sh ); /** \brief Returns the simplex that has index idx in the filtration. * * This is only called on valid indices. */ Simplex_handle simplex ( size_t idx ); -/** \brief Assign a key to a simplex. */ - void assign_key(Simplex_handle sh, Simplex_key key); - /** \brief Iterator on the simplices belonging to the * boundary of a simplex. * @@ -115,6 +101,26 @@ typedef unspecified Filtration_simplex_range; * .begin() and .end() return type Filtration_simplex_iterator.*/ Filtration_simplex_range filtration_simplex_range(); +/** \name Map interface + * Conceptually a `std::unordered_map`. + * @{ */ +/** \brief Data stored for each simplex. + * + * Must be an integer type. */ + typedef unspecified Simplex_key; +/** \brief Returns a constant dummy number that is either negative, + * or at least as large as `num_simplices()`. Suggested value: -1. */ + Simplex_key null_key (); +/** \brief Returns the number stored for a simplex by `assign_key`. + * + * This is never called on null_simplex(). */ + Simplex_key key ( Simplex_handle sh ); +/** \brief Store a number for a simplex, which can later be retrieved with `key(sh)`. + * + * This is never called on null_simplex(). */ + void assign_key(Simplex_handle sh, Simplex_key n); +/** @} */ + /* \brief Iterator over the simplices of the complex, * in an arbitrary order. -- cgit v1.2.3 From f8e33c3e6e73efe8290de3c4712b720cedfb4138 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 22 May 2018 12:47:49 +0000 Subject: -pedantic is only for developpers Bug fix in gudhi_patches mechanism git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cmake_v3_vincent@3448 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0ecb0da6e6c63733a800a2f30b0f50d2c7e29441 --- CMakeLists.txt | 2 ++ src/cmake/modules/GUDHI_compilation_flags.cmake | 1 - src/cmake/modules/GUDHI_third_party_libraries.cmake | 4 ++-- src/cmake/modules/GUDHI_user_version_target.cmake | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08291b54..d3474681 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ set(GUDHI_CYTHON_PATH "src/cython") include(GUDHI_third_party_libraries NO_POLICY_SCOPE) include(GUDHI_compilation_flags) +# Only for dev version +add_cxx_compiler_flag("-pedantic") # Add your new module in the list, order is not important include(GUDHI_modules) diff --git a/src/cmake/modules/GUDHI_compilation_flags.cmake b/src/cmake/modules/GUDHI_compilation_flags.cmake index 614d3812..394f1f42 100644 --- a/src/cmake/modules/GUDHI_compilation_flags.cmake +++ b/src/cmake/modules/GUDHI_compilation_flags.cmake @@ -21,7 +21,6 @@ if(MSVC) endif() add_cxx_compiler_flag("-Wall") -add_cxx_compiler_flag("-pedantic") if(CMAKE_BUILD_TYPE MATCHES Debug) message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index a008dd0a..7433f2f3 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -54,12 +54,12 @@ if(CGAL_FOUND) endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0) - if (NOT CGAL_VERSION VERSION_GREATER 4.11.0) + if (CGAL_VERSION VERSION_LESS 4.11.0) # For dev version include_directories(BEFORE "src/common/include/gudhi_patches") # For user version include_directories(BEFORE "include/gudhi_patches") - endif (NOT CGAL_VERSION VERSION_GREATER 4.11.0) + endif () endif() endif() diff --git a/src/cmake/modules/GUDHI_user_version_target.cmake b/src/cmake/modules/GUDHI_user_version_target.cmake index 4abc2574..0d1220cf 100644 --- a/src/cmake/modules/GUDHI_user_version_target.cmake +++ b/src/cmake/modules/GUDHI_user_version_target.cmake @@ -48,7 +48,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11) copy_directory ${CMAKE_SOURCE_DIR}/src/GudhUI ${GUDHI_USER_VERSION_DIR}/GudhUI) set(GUDHI_DIRECTORIES "doc;example;concept;utilities") - if (NOT CGAL_VERSION VERSION_GREATER 4.11.0) + if (CGAL_VERSION VERSION_LESS 4.11.0) set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/gudhi_patches") else () set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi") -- cgit v1.2.3 From e996b0fd0a0aecfa3b77e0ff3780f31b1b8bab4a Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 22 May 2018 20:59:45 +0000 Subject: Add CMake 3.1 in installation requirements. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3450 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: bae61cf108841dae3ff1be5953eb9f87f1713e41 --- src/common/doc/installation.h | 5 +++-- src/cython/doc/installation.rst | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index 25675cc5..12407c18 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -5,8 +5,9 @@ * Examples of GUDHI headers inclusion can be found in \ref demos. * * \section compiling Compiling - * The library uses c++11 and requires Boost with version 1.48.0 or - * more recent. It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. + * The library uses c++11 and requires Boost ≥ 1.48.0 + * and CMake ≥ 3.1. + * It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. * * \subsection demos Demos and examples * To build the demos and examples, run the following commands in a terminal: diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst index c182f176..52c5eb49 100644 --- a/src/cython/doc/installation.rst +++ b/src/cython/doc/installation.rst @@ -3,10 +3,10 @@ Installation Compiling ********* - -The library uses c++11 and requires `Boost `_ with -version 1.48.0 or more recent. It is a multi-platform library and compiles on -Linux, Mac OSX and Visual Studio 2015. +The library uses c++11 and requires `Boost `_ ≥ 1.48.0 +and `CMake `_ ≥ 3.1. +It is a multi-platform library and compiles on Linux, Mac OSX and Visual +Studio 2015. It also requires cmake to generate makefiles, and cython to compile the library. -- cgit v1.2.3 From 2745d59751e862701d675470994978ca460ac870 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 25 May 2018 13:21:43 +0000 Subject: Fix bug on Cubical reported by user. Add test on Python level. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3461 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fffa8df624f81427d0feef6ddc3f8a567aa2d366 --- .../include/gudhi/Bitmap_cubical_complex_base.h | 4 ++-- ...Bitmap_cubical_complex_periodic_boundary_conditions_base.h | 2 +- src/cython/test/test_cubical_complex.py | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index 47e71f8a..e06d198b 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -492,7 +492,7 @@ class Bitmap_cubical_complex_base { this->multipliers.push_back(multiplier); multiplier *= 2 * sizes[i] + 1; } - this->data = std::vector(multiplier, std::numeric_limits::max()); + this->data = std::vector(multiplier, std::numeric_limits::infinity()); this->total_number_of_cells = multiplier; } @@ -562,7 +562,7 @@ void Bitmap_cubical_complex_base::put_data_to_bins(T diameter_of_bin) { template std::pair Bitmap_cubical_complex_base::min_max_filtration() { - std::pair min_max(std::numeric_limits::max(), std::numeric_limits::min()); + std::pair min_max(std::numeric_limits::infinity(), std::numeric_limits::min()); for (std::size_t i = 0; i != this->data.size(); ++i) { if (this->data[i] < min_max.first) min_max.first = this->data[i]; if (this->data[i] > min_max.second) min_max.second = this->data[i]; diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h index 97070cda..8c35f590 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h @@ -177,7 +177,7 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c } } // std::reverse( this->sizes.begin() , this->sizes.end() ); - this->data = std::vector(multiplier, std::numeric_limits::max()); + this->data = std::vector(multiplier, std::numeric_limits::infinity()); this->total_number_of_cells = multiplier; } Bitmap_cubical_complex_periodic_boundary_conditions_base(const std::vector& sizes); diff --git a/src/cython/test/test_cubical_complex.py b/src/cython/test/test_cubical_complex.py index 79d39aa8..92e591e9 100755 --- a/src/cython/test/test_cubical_complex.py +++ b/src/cython/test/test_cubical_complex.py @@ -72,6 +72,17 @@ def test_dimension_simple_constructor(): assert cub.betti_numbers() == [1, 0, 0] assert cub.persistent_betti_numbers(0, 1000) == [0, 0, 0] +def test_user_case_simple_constructor(): + cub = CubicalComplex(dimensions=[3, 3], + top_dimensional_cells = [float('inf'), 0.,0.,0.,1.,0.,0.,0.,0.]) + assert cub.__is_defined() == True + assert cub.__is_persistence_defined() == False + assert cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))] + assert cub.__is_persistence_defined() == True + other_cub = CubicalComplex(dimensions=[3, 3], + top_dimensional_cells = [1000., 0.,0.,0.,1.,0.,0.,0.,0.]) + assert other_cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))] + def test_dimension_file_constructor(): # Create test file test_file = open('CubicalOneSphere.txt', 'w') -- cgit v1.2.3 From a4cc98d569c63d04729242e1cabe7a0e49ed3908 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 25 May 2018 14:02:08 +0000 Subject: forgot -inf from patch sent by Marc git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3462 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8e7fe4acb33ee785ef918052f3111d2845542450 --- src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index e06d198b..9b74e267 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -562,7 +562,7 @@ void Bitmap_cubical_complex_base::put_data_to_bins(T diameter_of_bin) { template std::pair Bitmap_cubical_complex_base::min_max_filtration() { - std::pair min_max(std::numeric_limits::infinity(), std::numeric_limits::min()); + std::pair min_max(std::numeric_limits::infinity(), -std::numeric_limits::infinity()); for (std::size_t i = 0; i != this->data.size(); ++i) { if (this->data[i] < min_max.first) min_max.first = this->data[i]; if (this->data[i] > min_max.second) min_max.second = this->data[i]; -- cgit v1.2.3