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

Feature/fix appveyor #77

Merged
merged 16 commits into from
Nov 5, 2024
Merged
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
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ clone_script:
&& git submodule update --init --recursive

environment:
APPVEYOR_SAVE_CACHE_ON_ERROR : true
APPVEYOR_SAVE_CACHE_ON_ERROR: false
APPVEYOR_CACHE_SKIP_RESTORE: true
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_ROOT: c:\tools\vcpkg

Expand Down
77 changes: 77 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
language: en-US
tone_instructions: 'Be constructive and professional. Focus on technical accuracy while maintaining a friendly tone.'
early_access: true
enable_free_tier: true
reviews:
profile: assertive
request_changes_workflow: false
high_level_summary: true
high_level_summary_placeholder: '@coderabbitai summary'
auto_title_placeholder: '@coderabbitai'
review_status: true
commit_status: true
poem: true
collapse_walkthrough: false
sequence_diagrams: true
changed_files_summary: true
labeling_instructions: []
path_filters: []
acgetchell marked this conversation as resolved.
Show resolved Hide resolved
path_instructions:
- path: 'src/**/*.cpp'
instructions: 'Focus on performance, memory management, and RAII principles'
- path: 'include/**/*.hpp'
instructions: 'Focus on design patterns, interfaces, and encapsulation'
- path: 'test/**/*.cpp'
instructions: |
Review the following unit test code written using doctest. Ensure the following:
- Comprehensive test coverage and proper test organization.
- The code adheres to best practices using doctest.
- Descriptive test names are used to clearly convey the intent of each test.
abort_on_close: true
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords: []
labels: []
drafts: true
base_branches: []
tools:
shellcheck:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
gitleaks:
enabled: true
cppcheck:
enabled: true
languagetool:
enabled: true
enabled_only: false
level: default
hadolint:
enabled: true
yamllint:
enabled: true
actionlint:
enabled: true
pmd:
enabled: true
semgrep:
enabled: true
acgetchell marked this conversation as resolved.
Show resolved Hide resolved
chat:
auto_reply: true
knowledge_base:
opt_out: false
learnings:
scope: auto
issues:
scope: auto
jira:
project_keys: []
linear:
team_keys: []
pull_requests:
scope: auto
acgetchell marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- develop
workflow_dispatch:

jobs:
formatting-check:
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,13 @@ jobs:

- name: Setup
run: |
rm /usr/local/bin/2to3
rm /usr/local/bin/2to3-3.11
rm /usr/local/bin/2to3-3.12
rm /usr/local/bin/idle3
rm /usr/local/bin/idle3.11
rm /usr/local/bin/idle3.12
rm /usr/local/bin/pydoc3
rm /usr/local/bin/pydoc3.11
rm /usr/local/bin/pydoc3.12
rm /usr/local/bin/python3
rm /usr/local/bin/python3.11
rm /usr/local/bin/python3.12
rm /usr/local/bin/python3-config
rm /usr/local/bin/python3.11-config
rm /usr/local/bin/python3.12-config
# Remove Python symlinks if they exist
echo "Checking and removing Python symlinks..."
for file in \
/usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do
[ -L "$file" ] && sudo rm "$file" || true
done
echo "Python symlink cleanup completed."
brew install automake autoconf autoconf-archive libtool texinfo yasm ninja python ccache pkg-config

- name: Restore artifacts or setup vcpkg
Expand Down
26 changes: 18 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16...3.26)
cmake_minimum_required(VERSION 3.16)

# vcpkg settings must be set before project()
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
Expand Down Expand Up @@ -30,7 +30,7 @@ include(cmake/PreventInSourceBuilds.cmake)

# Link this 'library' to set the c++ standard / compile-time options requested
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_20)
target_compile_features(project_options INTERFACE cxx_std_23)
acgetchell marked this conversation as resolved.
Show resolved Hide resolved

if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF)
Expand Down Expand Up @@ -67,21 +67,31 @@ include(CMakeDependentOption)
# Set CGAL_DATA_DIR to the location of the CGAL data files
set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data)

# Minimum compiler versions required for C++23 support:
# - MSVC 19.34 (Visual Studio 2022 version 17.4)
# - GCC 12.2
# - AppleClang 14.0
# - Clang 16.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.34")
message(FATAL_ERROR "MSVC 19.34 or higher required for C++23 support")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.2")
message(FATAL_ERROR "GCC 12.2 or higher required for C++23 support")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16.0")
message(FATAL_ERROR "Clang 16.0 or higher required for C++23 support")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0")
message(FATAL_ERROR "AppleClang 14.0 or higher required for C++23 support")
endif()

# Set NOMINMAX to avoid min/max macro errors on Windows in date.h
#if(WIN32)
# # Workaround for https://github.com/CGAL/cgal/issues/4665 and https://github.com/microsoft/vcpkg/issues/23572
# add_compile_options(/DNOMINMAX)
#endif()

if (MSVC)
# Add /utf-8 flag for MSVC
add_compile_options(/utf-8)
endif()

# Project vcpkg dependencies

# https://github.com/CGAL/cgal
find_package(CGAL CONFIG REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL CONFIG REQUIRED)
# Don't let CGAL override flags
set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS
TRUE
Expand Down
7 changes: 4 additions & 3 deletions cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif()
# Set minimum Boost version
set(BOOST_MIN_VERSION "1.75.0")

# Use C++20
# Use C++23
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand All @@ -55,8 +55,9 @@ add_definitions(-DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTC
# Easier navigation in an IDE when projects are organized in folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Check if the compiler is MSVC
# Deal with UTF-8 encoding
if (MSVC)
# Add /utf-8 flag to MSVC
add_compile_options(/utf-8)
else()
add_compile_options(-finput-charset=UTF-8)
endif()
72 changes: 36 additions & 36 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_link_libraries(
spdlog::spdlog_header_only
TBB::tbb
CGAL::CGAL)
target_compile_features(initialize PRIVATE cxx_std_20)
target_compile_features(initialize PRIVATE cxx_std_23)

add_executable(cdt-opt ${PROJECT_SOURCE_DIR}/src/cdt-opt.cpp)
target_link_libraries(
Expand All @@ -23,7 +23,7 @@ target_link_libraries(
spdlog::spdlog_header_only
TBB::tbb
CGAL::CGAL)
target_compile_features(cdt-opt PRIVATE cxx_std_20)
target_compile_features(cdt-opt PRIVATE cxx_std_23)

add_executable(cdt ${PROJECT_SOURCE_DIR}/src/cdt.cpp)
target_link_libraries(
Expand All @@ -37,40 +37,40 @@ target_link_libraries(
spdlog::spdlog_header_only
TBB::tbb
CGAL::CGAL)
target_compile_features(cdt PRIVATE cxx_std_20)
target_compile_features(cdt PRIVATE cxx_std_23)

# Build cdt-viewer locally, but not in CI since QT takes more than an hour to build there
if(APPLE AND NOT ($ENV{CI}))
add_executable(cdt-viewer ${PROJECT_SOURCE_DIR}/src/cdt-viewer.cpp)
target_link_libraries(
cdt-viewer
PRIVATE project_options
project_warnings
date::date-tz
Boost::program_options
fmt::fmt-header-only
Eigen3::Eigen
spdlog::spdlog_header_only
TBB::tbb
CGAL::CGAL_Basic_viewer)
target_compile_features(cdt-viewer PRIVATE cxx_std_20)
endif()
#if(APPLE AND NOT ($ENV{CI}))
# add_executable(cdt-viewer ${PROJECT_SOURCE_DIR}/src/cdt-viewer.cpp)
# target_link_libraries(
# cdt-viewer
# PRIVATE project_options
# project_warnings
# date::date-tz
# Boost::program_options
# fmt::fmt-header-only
# Eigen3::Eigen
# spdlog::spdlog_header_only
# TBB::tbb
# CGAL::CGAL_Basic_viewer)
# target_compile_features(cdt-viewer PRIVATE cxx_std_23)
#endif()

# Build bistellar-flip locally, but not in CI since QT takes more than an hour to build there
if(APPLE AND NOT ($ENV{CI}))
add_executable(bistellar-flip ${PROJECT_SOURCE_DIR}/src/bistellar-flip.cpp)
target_link_libraries(
bistellar-flip
PRIVATE project_options
project_warnings
date::date-tz
fmt::fmt-header-only
Eigen3::Eigen
spdlog::spdlog_header_only
TBB::tbb
CGAL::CGAL_Basic_viewer)
target_compile_features(bistellar-flip PRIVATE cxx_std_20)
endif()
#if(APPLE AND NOT ($ENV{CI}))
# add_executable(bistellar-flip ${PROJECT_SOURCE_DIR}/src/bistellar-flip.cpp)
# target_link_libraries(
# bistellar-flip
# PRIVATE project_options
# project_warnings
# date::date-tz
# fmt::fmt-header-only
# Eigen3::Eigen
# spdlog::spdlog_header_only
# TBB::tbb)
# CGAL::CGAL_Basic_viewer)
acgetchell marked this conversation as resolved.
Show resolved Hide resolved
# target_compile_features(bistellar-flip PRIVATE cxx_std_23)
#endif()

#
# Tests ##
Expand Down Expand Up @@ -105,7 +105,7 @@ set_tests_properties(initialize-toroidal PROPERTIES PASS_REGULAR_EXPRESSION
add_test(NAME cdt-opt COMMAND $<TARGET_FILE:cdt-opt>)
set_tests_properties(cdt-opt PROPERTIES PASS_REGULAR_EXPRESSION "cdt-opt started at")

if(APPLE AND NOT ($ENV{CI}))
add_test(NAME cdt-viewer COMMAND $<TARGET_FILE:cdt-viewer> --dry-run test.off)
set_tests_properties(cdt-viewer PROPERTIES PASS_REGULAR_EXPRESSION "Dry run. Exiting.")
endif()
#if(APPLE AND NOT ($ENV{CI}))
# add_test(NAME cdt-viewer COMMAND $<TARGET_FILE:cdt-viewer> --dry-run test.off)
# set_tests_properties(cdt-viewer PROPERTIES PASS_REGULAR_EXPRESSION "Dry run. Exiting.")
#endif()
2 changes: 2 additions & 0 deletions src/bistellar-flip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ try
manifolds::Manifold_3 const manifold{
foliated_triangulations::FoliatedTriangulation_3{dt, 0, 1}
};
#ifdef ENABLE_VISUALIZATION
CGAL::draw(manifold.get_delaunay());
#endif
fmt::print("After bistellar flip.\n");
manifold.print_cells();
utilities::print_delaunay(dt);
Expand Down
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ add_executable(
Torus_test.cpp
Utilities_test.cpp
Vertex_test.cpp)
# Activate C++20 features
target_compile_features(CDT_unit_tests PRIVATE cxx_std_20)
# Activate C++23 features
target_compile_features(CDT_unit_tests PRIVATE cxx_std_23)
target_link_libraries(
CDT_unit_tests
PRIVATE project_options
Expand Down
10 changes: 1 addition & 9 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
"name": "yasm-tool",
"platform": "windows"
},
{
"name": "cgal",
"features": ["qt"],
"platform": "osx"
},
{
"name": "cgal",
"platform": "!osx"
}
"cgal"
]
}