Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
20 changes: 12 additions & 8 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: Linux
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v6
with:
fetch-depth: 10

Expand All @@ -39,7 +39,7 @@ jobs:

- name: Cache Build
id: cache-build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-${{ matrix.config }}-cache-${{ github.sha }}
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v6
with:
fetch-depth: 10

Expand All @@ -95,7 +95,7 @@ jobs:

- name: Cache Build
id: cache-build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.CACHE_PATH }}
key: ${{ matrix.os }}-${{ matrix.config }}-cache-${{ github.sha }}
Expand Down Expand Up @@ -140,12 +140,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v6
with:
fetch-depth: 10

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
# - name: Install Ninja
# uses: seanmiddleditch/gha-setup-ninja@master

# - name: VCPKG
# run: |
# vcpkg install gmp:x64-windows

- name: Dependencies
run: |
Expand All @@ -154,7 +158,7 @@ jobs:

- name: Cache build
id: cache-build
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.SCCACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.config }}-cache-${{ github.sha }}
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ include(spdlog)
include(paraviewo)
include(fenvelope)
include(nanoflann)
include(polysolve)

include(simple_bvh)
# Sort projects inside the solution
Expand Down Expand Up @@ -128,6 +129,7 @@ target_link_libraries(wildmeshing_toolkit PUBLIC
paraviewo::paraviewo
FastEnvelope::FastEnvelope
simple_bvh::simple_bvh
polysolve::polysolve
)

if(MSVC)
Expand Down
5 changes: 4 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ endif()
# ###############################################################################

add_executable(wmtk_app main.cpp)
target_link_libraries(wmtk_app PRIVATE
target_link_libraries(wmtk_app PUBLIC
wmtk::toolkit
nlohmann_json::nlohmann_json
CLI11::CLI11
)

wmtk_copy_dll(wmtk_app)

if(WMTK_PYBIND)
add_subdirectory(pywmtk)
endif()
5 changes: 5 additions & 0 deletions cmake/FindGMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ if(WIN32)
find_file(GMP_RUNTIME_LIB
NAMES
gmp.dll
gmp-10.dll
libgmp-10.dll
PATHS
ENV GMP_DIR
${LIB_INSTALL_DIR}
PATH_SUFFIXES
bin
lib
)
list(APPEND GMP_EXTRA_VARS GMP_RUNTIME_LIB)

message(STATUS "Windows GMP Paths: \n ${GMP_INCLUDES}\n ${GMP_LIBRARIES}\n ${GMP_RUNTIME_LIB}")
endif()


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP
REQUIRED_VARS
Expand Down
18 changes: 9 additions & 9 deletions cmake/recipes/fenvelope.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ set(FAST_ENVELOPE_ENABLE_TBB OFF)

include(cli11)

# HACK because there is a linker error on Windows otherwise
if(WIN32)
set(FAST_ENVELOPE_WITH_GEOGRAM_PREDICATES ON)
set(FAST_ENVELOPE_WITH_GEOGRAM_PSM_PREDICATES OFF)
else()
set(FAST_ENVELOPE_WITH_GEOGRAM_PREDICATES OFF)
set(FAST_ENVELOPE_WITH_GEOGRAM_PSM_PREDICATES ON)
endif()
# # HACK because there is a linker error on Windows otherwise
# if(WIN32)
# set(FAST_ENVELOPE_WITH_GEOGRAM_PREDICATES ON)
# set(FAST_ENVELOPE_WITH_GEOGRAM_PSM_PREDICATES OFF)
# else()
# set(FAST_ENVELOPE_WITH_GEOGRAM_PREDICATES OFF)
# set(FAST_ENVELOPE_WITH_GEOGRAM_PSM_PREDICATES ON)
# endif()


message(STATUS "Third-party: creating target 'FastEnvelope::FastEnvelope'")


include(CPM)
CPMAddPackage("gh:daniel-zint/fast-envelope#a631e3555ff7bd495a66d61a311f5aafe00a2f08")
CPMAddPackage("gh:daniel-zint/fast-envelope#0046a216171237aab654dd1580aa8a5eaef675ee")

set_target_properties(FastEnvelope PROPERTIES FOLDER third_party)
add_library(FastEnvelope::FastEnvelope ALIAS FastEnvelope)
4 changes: 2 additions & 2 deletions cmake/recipes/gmp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ if(TARGET gmp::gmp)
return()
endif()

message(STATUS "Third-party: creating target 'gmp::gmp'")

# Download precompiled .dll on Windows
include(gmp_mpfr)

message(STATUS "Third-party: creating target 'gmp::gmp'")

# Find_package will look for our downloaded lib on Windows, and system-wide on Linux/macOS
find_package(GMP REQUIRED)

Expand Down
19 changes: 16 additions & 3 deletions cmake/recipes/gmp_mpfr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,28 @@ if(WIN32)
lib
)

if(GMP_TRY_FIND_INCLUDES AND GMP_TRY_FIND_LIBRARIES)
message(STATUS "System GMP found: ${GMP_TRY_FIND_INCLUDES}")
find_file(GMP_TRY_FIND_RUNTIME_LIB
NAMES
gmp.dll
gmp-10.dll
libgmp-10.dll
PATHS
ENV GMP_DIR
${LIB_INSTALL_DIR}
PATH_SUFFIXES
bin
lib
)

if(GMP_TRY_FIND_INCLUDES AND GMP_TRY_FIND_LIBRARIES AND GMP_TRY_FIND_RUNTIME_LIB)
message(STATUS "System GMP found: \n ${GMP_TRY_FIND_INCLUDES}\n ${GMP_TRY_FIND_LIBRARIES}\n ${GMP_TRY_FIND_RUNTIME_LIB}")
else()
message(WARNING "Third-party: downloading gmp + mpfr. The code may be crazy slow! Please install GMP using your preferred package manager. Do not forget to delete your <build>/CMakeCache.txt for the changes to take effect.")

include(CPM)
CPMAddPackage(
NAME gmp_mpfr
URL "https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip"
URL "https://github.com/CGAL/cgal/releases/download/v6.1.1/CGAL-6.1.1-win64-auxiliary-libraries-gmp-mpfr.zip"
DOWNLOAD_ONLY YES
)

Expand Down
5 changes: 1 addition & 4 deletions cmake/recipes/nanoflann.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ CPMAddPackage(
"NANOFLANN_USE_SYSTEM_GTEST OFF"
"MASTER_PROJECT_HAS_TARGET_UNINSTALL ON"
)
set_target_properties(nanoflann PROPERTIES FOLDER third_party)
if(WIN32)
set_target_properties(nanoflann_uninstall PROPERTIES FOLDER third_party)
endif()
set_target_properties(nanoflann PROPERTIES FOLDER third_party)
33 changes: 33 additions & 0 deletions cmake/recipes/polysolve.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PolySolve (https://github.com/polyfem/polysolve)
# License: MIT

if(TARGET polysolve::polysolve)
return()
endif()

message(STATUS "Third-party: creating target 'polysolve::polysolve'")

# # TODO: this requires a conflicting version of Eigen. Reenable when Eigen 3.4+ is available.
# set(POLYSOLVE_WITH_ACCELERATE OFF CACHE BOOL "Enable Apple Accelerate" FORCE)

include(CPM)
CPMAddPackage(
NAME polysolve
GITHUB_REPOSITORY polyfem/polysolve
GIT_TAG 57dbeadcb65932a38508e3a5a07e98732a1c50bc
OPTIONS
"POLYSOLVE_WITH_ACCELERATE OFF"
"POLYSOLVE_WITH_CHOLMOD OFF"
"POLYSOLVE_WITH_UMFPACK OFF"
"POLYSOLVE_WITH_SUPERLU OFF"
"POLYSOLVE_WITH_SPQR OFF"
"POLYSOLVE_WITH_MKL OFF"
"POLYSOLVE_WITH_CUSOLVER OFF"
"POLYSOLVE_WITH_PARDISO OFF"
"POLYSOLVE_WITH_HYPRE OFF"
"POLYSOLVE_WITH_AMGCL OFF"
"POLYSOLVE_WITH_SPECTRA OFF"
)

set_target_properties(polysolve PROPERTIES FOLDER third_party)
set_target_properties(polysolve_linear PROPERTIES FOLDER third_party)
23 changes: 17 additions & 6 deletions cmake/wmtk_copy_dll.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function(wmtk_copy_dll target)
message(FATAL_ERROR "wmtk_copy_dll() was called on a non-executable target: ${target}")
endif()

# Create a custom command to do the actual copy. This needs to be executed before Catch2's POST_BUILD command,
# so we define this as a PRE_LINK command for the executable target.
# Create a custom command to do the actual copy. We use POST_BUILD so the executable output directory
# always exists before attempting to copy dependencies.
add_custom_command(
TARGET ${target}
PRE_LINK
Expand All @@ -80,10 +80,21 @@ function(wmtk_copy_dll target)

# Instruction to copy target file if it exists
string(APPEND COPY_SCRIPT_CONTENT
"if(EXISTS \"$<TARGET_FILE:${DEPENDENCY}>\")\n "
"execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "
"\"$<TARGET_FILE:${DEPENDENCY}>\" "
"\"$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_NAME:${DEPENDENCY}>\")\n"
"set(SRC_FILE \"$<TARGET_FILE:${DEPENDENCY}>\")\n"
"if(EXISTS \"\${SRC_FILE}\")\n"
" set(DEST_FILE \"$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_NAME:${DEPENDENCY}>\")\n"
" message(STATUS \"Copying: \${SRC_FILE} -> \${DEST_FILE}\")\n"
" execute_process(COMMAND \"${CMAKE_COMMAND}\" -E copy_if_different "
"\"\${SRC_FILE}\" \"\${DEST_FILE}\" "
"RESULT_VARIABLE COPY_RESULT ERROR_VARIABLE COPY_ERROR)\n"
" if(NOT COPY_RESULT EQUAL 0)\n"
" message(FATAL_ERROR \"Failed to copy \${SRC_FILE} to \${DEST_FILE} for target ${target}. Result: \${COPY_RESULT}, Error: \${COPY_ERROR}\")\n"
" endif()\n"
" if(NOT EXISTS \"\${DEST_FILE}\")\n"
" message(FATAL_ERROR \"Copy completed (exit 0) but destination file does not exist: \${DEST_FILE}\")\n"
" endif()\n"
"else()\n "
"message(STATUS \"Dependency does not exist (will not copy): \${SRC_FILE}\")\n"
"endif()\n"
)
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion components/cmake/add_component.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(add_component COMPONENT_NAME)
"components_map[\"${COMPONENT_NAME}\"] = wmtk::components::${COMPONENT_NAME}::${COMPONENT_NAME};\n")

# add component to wmtk app
target_link_libraries(wmtk_app PRIVATE wmtk::${COMPONENT_NAME})
target_link_libraries(wmtk_app PUBLIC wmtk::${COMPONENT_NAME})
# add component to python bindings
if(WMTK_PYBIND)
target_link_libraries(pywmtk PUBLIC wmtk::${COMPONENT_NAME})
Expand Down
Loading
Loading