Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try conan #932

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,67 @@ jobs:
displayName: "Build and test Windows"
timeoutInMinutes: 0
cancelTimeoutInMinutes: 60
pool:
vmImage: windows-latest
variables:
pythonVersion: '3.8'
# If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G
# "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:\Users\User\gudhi-devel\conan-build\conan_toolchain.cmake
# -DCMAKE_POLICY_DEFAULT_CMP0091=NEW'
cmakeConanFlags: -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
cmakeFlags: -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=OFF

steps:
# Use a specific Python version
- task: UsePythonVersion@0
displayName: Use Python $(pythonVersion)
inputs:
versionSpec: $(pythonVersion)
addToPath: true
architecture: 'x64'

- script: |
git submodule update --init
python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt
# No PyKeOps on windows, let's workaround this one.
for /F "tokens=*" %%A in (ext\gudhi-deploy\test-requirements.txt) do python -m pip install %%A
python -m pip install --user conan
displayName: 'Install build dependencies'
- script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
IF %errorlevel% NEQ 0 exit /b %errorlevel%
conan profile detect
IF %errorlevel% NEQ 0 exit /b %errorlevel%
conan install . --output-folder=build --build=missing --options=boost/1.82.0:shared=True --options=mpfr/4.1.0:shared=True
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cd build
dir
type conan_toolchain.cmake
call "conanbuild.bat"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -DFORCE_EIGEN_DEFAULT_DENSE_INDEX_TYPE_TO_INT=ON $(cmakeConanFlags) $(cmakeFlags) ..
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cmake --build . --config Release
IF %errorlevel% NEQ 0 exit /b %errorlevel%
ctest --output-on-failure -C Release -E diff_files
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cmake -DWITH_GUDHI_PYTHON=ON -DWITH_GUDHI_REMOTE_TEST=ON .
IF %errorlevel% NEQ 0 exit /b %errorlevel%
cd src\python
# Needs to copy dll or try delvewheel ?
python setup.py build_ext --inplace
IF %errorlevel% NEQ 0 exit /b %errorlevel%
SET PYTHONPATH=%CD%;%PYTHONPATH%
echo %PYTHONPATH%
ctest --output-on-failure -C Release
IF %errorlevel% NEQ 0 exit /b %errorlevel%
deactivate_conanbuild.bat
displayName: 'Build and test'

- job: 'WindowsVcpkg'
displayName: "Build and test Windows with vcpkg"
timeoutInMinutes: 0
cancelTimeoutInMinutes: 60
pool:
vmImage: windows-latest
variables:
Expand Down Expand Up @@ -87,4 +148,4 @@ jobs:
echo %PYTHONPATH%
ctest --output-on-failure -C Release
IF %errorlevel% NEQ 0 exit /b %errorlevel%
displayName: 'Build and test'
displayName: 'Build and test'
17 changes: 17 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is required to install dependencies with conan
# Notice that onetbb is not mandatory
[requires]
cgal/5.5.3
boost/1.82.0
mpfr/4.1.0
eigen/3.4.0
gmp/6.3.0

# If your CMake version is not compatible with CMakePresets (<3.23) call cmake like:
# 'cmake <path> -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW'
[tool_requires]
cmake/3.22.6

[generators]
CMakeDeps
CMakeToolchain
4 changes: 2 additions & 2 deletions src/Alpha_complex/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project(Alpha_complex_benchmark)

if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
if(CGAL_FOUND AND TARGET Eigen3::Eigen)
add_executable(Alpha_complex_3d_benchmark Alpha_complex_3d_benchmark.cpp)
target_link_libraries(Alpha_complex_3d_benchmark ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_3d_benchmark CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_3d_benchmark TBB::tbb)
endif()
Expand Down
25 changes: 13 additions & 12 deletions src/Alpha_complex/example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
project(Alpha_complex_examples)

if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
if(CGAL_FOUND AND TARGET Eigen3::Eigen)
add_executable ( Alpha_complex_example_from_points Alpha_complex_from_points.cpp )
target_link_libraries(Alpha_complex_example_from_points ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_example_from_points CGAL::CGAL Eigen3::Eigen)
add_executable ( Alpha_complex_example_from_off Alpha_complex_from_off.cpp )
target_link_libraries(Alpha_complex_example_from_off ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_example_from_off CGAL::CGAL Eigen3::Eigen)
add_executable ( Alpha_complex_example_fast_from_off Fast_alpha_complex_from_off.cpp )
target_link_libraries(Alpha_complex_example_fast_from_off ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_example_fast_from_off CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_example_from_points TBB::tbb)
target_link_libraries(Alpha_complex_example_from_off TBB::tbb)
Expand Down Expand Up @@ -44,32 +44,33 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
${CMAKE_CURRENT_BINARY_DIR}/fastalphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt)
set_tests_properties(Alpha_complex_example_fast_from_off_32_diff_files PROPERTIES DEPENDS Alpha_complex_example_fast_from_off_32)
endif()
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
endif()

if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
if (CGAL_FOUND)
add_executable ( Alpha_complex_example_weighted_3d_from_points Weighted_alpha_complex_3d_from_points.cpp )
target_link_libraries(Alpha_complex_example_weighted_3d_from_points ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_example_weighted_3d_from_points CGAL::CGAL)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_example_weighted_3d_from_points TBB::tbb)
endif()
add_test(NAME Alpha_complex_example_weighted_3d_from_points
COMMAND $<TARGET_FILE:Alpha_complex_example_weighted_3d_from_points>)

add_executable ( Alpha_complex_example_3d_from_points Alpha_complex_3d_from_points.cpp )
target_link_libraries(Alpha_complex_example_3d_from_points ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_example_3d_from_points CGAL::CGAL)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_example_3d_from_points TBB::tbb)
endif()
add_test(NAME Alpha_complex_example_3d_from_points
COMMAND $<TARGET_FILE:Alpha_complex_example_3d_from_points>)

endif(NOT CGAL_VERSION VERSION_LESS 4.11.0)
endif(CGAL_FOUND)

if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
# Weighted version of dD Alpha complex requires CGAL >= 5.1.0
if(CGAL_FOUND AND NOT CGAL_VERSION VERSION_LESS 5.1.0 AND TARGET Eigen3::Eigen)
add_executable ( Weighted_alpha_complex_example_from_points Weighted_alpha_complex_from_points.cpp )
target_link_libraries(Weighted_alpha_complex_example_from_points ${CGAL_LIBRARY})
target_link_libraries(Weighted_alpha_complex_example_from_points CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Weighted_alpha_complex_example_from_points TBB::tbb)
endif()
add_test(NAME Weighted_alpha_complex_example_from_points COMMAND $<TARGET_FILE:Weighted_alpha_complex_example_from_points>)
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
endif()
49 changes: 25 additions & 24 deletions src/Alpha_complex/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
project(Alpha_complex_tests)

include(GUDHI_boost_test)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
if(CGAL_FOUND AND TARGET Eigen3::Eigen)

# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)

add_executable ( Alpha_complex_test_unit Alpha_complex_unit_test.cpp )
target_link_libraries(Alpha_complex_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Alpha_complex_dim3_test_unit Alpha_complex_dim3_unit_test.cpp )
target_link_libraries(Alpha_complex_dim3_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_dim3_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Delaunay_complex_Epeck_dynamic_test_unit Delaunay_complex_Epeck_dynamic_unit_test.cpp )
target_link_libraries(Delaunay_complex_Epeck_dynamic_test_unit ${CGAL_LIBRARY})
target_link_libraries(Delaunay_complex_Epeck_dynamic_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Delaunay_complex_Epeck_static_test_unit Delaunay_complex_Epeck_static_unit_test.cpp )
target_link_libraries(Delaunay_complex_Epeck_static_test_unit ${CGAL_LIBRARY})
target_link_libraries(Delaunay_complex_Epeck_static_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Delaunay_complex_Epick_dynamic_test_unit Delaunay_complex_Epick_dynamic_unit_test.cpp )
target_link_libraries(Delaunay_complex_Epick_dynamic_test_unit ${CGAL_LIBRARY})
target_link_libraries(Delaunay_complex_Epick_dynamic_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Delaunay_complex_Epick_static_test_unit Delaunay_complex_Epick_static_unit_test.cpp )
target_link_libraries(Delaunay_complex_Epick_static_test_unit ${CGAL_LIBRARY})
target_link_libraries(Delaunay_complex_Epick_static_test_unit CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_test_unit TBB::tbb)
target_link_libraries(Alpha_complex_dim3_test_unit TBB::tbb)
Expand All @@ -34,18 +34,18 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
gudhi_add_boost_test(Delaunay_complex_Epick_dynamic_test_unit)
gudhi_add_boost_test(Delaunay_complex_Epick_static_test_unit)

endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
endif()

if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
if(CGAL_FOUND)

add_executable ( Alpha_complex_3d_test_unit Alpha_complex_3d_unit_test.cpp )
target_link_libraries(Alpha_complex_3d_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_complex_3d_test_unit CGAL::CGAL)
add_executable ( Weighted_alpha_complex_3d_test_unit Weighted_alpha_complex_3d_unit_test.cpp )
target_link_libraries(Weighted_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
target_link_libraries(Weighted_alpha_complex_3d_test_unit CGAL::CGAL)
add_executable ( Periodic_alpha_complex_3d_test_unit Periodic_alpha_complex_3d_unit_test.cpp )
target_link_libraries(Periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
target_link_libraries(Periodic_alpha_complex_3d_test_unit CGAL::CGAL)
add_executable ( Weighted_periodic_alpha_complex_3d_test_unit Weighted_periodic_alpha_complex_3d_unit_test.cpp )
target_link_libraries(Weighted_periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
target_link_libraries(Weighted_periodic_alpha_complex_3d_test_unit CGAL::CGAL)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_complex_3d_test_unit TBB::tbb)
target_link_libraries(Weighted_alpha_complex_3d_test_unit TBB::tbb)
Expand All @@ -58,17 +58,18 @@ if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
gudhi_add_boost_test(Periodic_alpha_complex_3d_test_unit)
gudhi_add_boost_test(Weighted_periodic_alpha_complex_3d_test_unit)

endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
endif(CGAL_FOUND)

if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
# Weighted version of dD Alpha complex requires CGAL >= 5.1.0
if(CGAL_FOUND AND NOT CGAL_VERSION VERSION_LESS 5.1.0 AND TARGET Eigen3::Eigen)
add_executable ( Alpha_kernel_d_Epeck_dynamic_test_unit Alpha_kernel_d_Epeck_dynamic_unit_test.cpp )
add_executable ( Alpha_kernel_d_Epeck_static_test_unit Alpha_kernel_d_Epeck_static_unit_test.cpp )
add_executable ( Alpha_kernel_d_Epick_dynamic_test_unit Alpha_kernel_d_Epick_dynamic_unit_test.cpp )
add_executable ( Alpha_kernel_d_Epick_static_test_unit Alpha_kernel_d_Epick_static_unit_test.cpp )
target_link_libraries(Alpha_kernel_d_Epeck_dynamic_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_kernel_d_Epeck_static_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_kernel_d_Epick_dynamic_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_kernel_d_Epick_static_test_unit ${CGAL_LIBRARY})
target_link_libraries(Alpha_kernel_d_Epeck_dynamic_test_unit CGAL::CGAL Eigen3::Eigen)
target_link_libraries(Alpha_kernel_d_Epeck_static_test_unit CGAL::CGAL Eigen3::Eigen)
target_link_libraries(Alpha_kernel_d_Epick_dynamic_test_unit CGAL::CGAL Eigen3::Eigen)
target_link_libraries(Alpha_kernel_d_Epick_static_test_unit CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Alpha_kernel_d_Epeck_dynamic_test_unit TBB::tbb)
target_link_libraries(Alpha_kernel_d_Epeck_static_test_unit TBB::tbb)
Expand All @@ -81,28 +82,28 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
gudhi_add_boost_test(Alpha_kernel_d_Epick_static_test_unit)

add_executable ( Weighted_alpha_complex_test_unit Weighted_alpha_complex_unit_test.cpp )
target_link_libraries(Weighted_alpha_complex_test_unit ${CGAL_LIBRARY})
target_link_libraries(Weighted_alpha_complex_test_unit CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Weighted_alpha_complex_test_unit TBB::tbb)
endif()
gudhi_add_boost_test(Weighted_alpha_complex_test_unit)

add_executable ( Weighted_alpha_complex_non_visible_points_test_unit Weighted_alpha_complex_non_visible_points_unit_test.cpp )
target_link_libraries(Weighted_alpha_complex_non_visible_points_test_unit ${CGAL_LIBRARY})
target_link_libraries(Weighted_alpha_complex_non_visible_points_test_unit CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Weighted_alpha_complex_non_visible_points_test_unit TBB::tbb)
endif()
gudhi_add_boost_test(Weighted_alpha_complex_non_visible_points_test_unit)

add_executable ( Zero_weighted_alpha_complex_dynamic_test_unit Zero_weighted_alpha_complex_dynamic_unit_test.cpp )
target_link_libraries(Zero_weighted_alpha_complex_dynamic_test_unit ${CGAL_LIBRARY})
target_link_libraries(Zero_weighted_alpha_complex_dynamic_test_unit CGAL::CGAL Eigen3::Eigen)
add_executable ( Zero_weighted_alpha_complex_static_test_unit Zero_weighted_alpha_complex_static_unit_test.cpp )
target_link_libraries(Zero_weighted_alpha_complex_static_test_unit ${CGAL_LIBRARY})
target_link_libraries(Zero_weighted_alpha_complex_static_test_unit CGAL::CGAL Eigen3::Eigen)
if(TARGET TBB::tbb)
target_link_libraries(Zero_weighted_alpha_complex_dynamic_test_unit TBB::tbb)
target_link_libraries(Zero_weighted_alpha_complex_static_test_unit TBB::tbb)
endif()
gudhi_add_boost_test(Zero_weighted_alpha_complex_dynamic_test_unit)
gudhi_add_boost_test(Zero_weighted_alpha_complex_static_test_unit)

endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
endif()
Loading
Loading