Skip to content

Commit

Permalink
Merged script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjc8237 committed Aug 27, 2024
2 parents f57ea11 + 3fa4526 commit 201db0b
Show file tree
Hide file tree
Showing 198 changed files with 15,975 additions and 3,287 deletions.
120 changes: 58 additions & 62 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ set(DIR_EXT "${CMAKE_CURRENT_SOURCE_DIR}/ext")

# Set options if top level
if (PROJECT_IS_TOP_LEVEL)
# Options for the project
# Options to generate python bindings
option(USE_PYBIND "Generate pybindings" ON)

# Alternative library options
option(USE_MULTIPRECISION "Use high precision floating point" OFF)
option(CHECK_VALIDITY "Check validity pre and post conditions" ON)
option(USE_EMBREE "Use Embree for rendering" OFF)
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" ON)
option(USE_COMISO "Use Comiso for field generation" ON)

# Visualization options
option(ENABLE_VISUALIZATION "Generate viewers for visualization" ON)
option(RENDER_TEXTURE "Render results" ON)
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" ON)
option(USE_PYBIND "Generate pybindings" ON)

# Validity check options
option(BUILD_CURVATURE_METRIC_TESTS "Build tests" ON)
option(USE_EMBREE "Use Embree for rendering" OFF)
option(CHECK_VALIDITY "Check validity pre and post conditions" ON)

# Set libigl and suitesparse options
# Set default libigl and suitesparse options
option(LIBIGL_PREDICATES "Use Predicates" ON)
set ( SUITESPARSE_ENABLE_PROJECTS "suitesparse_config;cholmod;spqr" )
option ( SUITESPARSE_USE_CUDA OFF )
Expand All @@ -40,6 +47,25 @@ if(USE_MULTIPRECISION)
link_directories(${MPFR_LIBRARIES_DIR})
endif()

# Optionally get frame field libraries
if (USE_COMISO)
add_compile_definitions(USE_COMISO)
option(LIBIGL_COPYLEFT_COMISO "Use COSIMO" ON)
set(COMISO_LIBS
igl_copyleft::comiso
)
endif()

# Set libigl options for rendering if enabled
if (RENDER_TEXTURE)
option(LIBIGL_OPENGL "Use OpenGL" ON)
option(LIBIGL_GLFW "Use GLFW" ON)
option(LIBIGL_PNG "Use PNG" ON)
endif()
if (USE_EMBREE)
option(LIBIGL_EMBREE "Use EMBREE" ON)
endif()

# Set compile definitions
add_compile_definitions(_USE_MATH_DEFINES)
if(USE_MULTIPRECISION)
Expand All @@ -49,49 +75,56 @@ if(CHECK_VALIDITY)
add_compile_definitions(CHECK_VALIDITY)
endif()
if (RENDER_TEXTURE)
option(LIBIGL_OPENGL "Use OpenGL" ON)
option(LIBIGL_GLFW "Use GLFW" ON)
option(LIBIGL_PNG "Use PNG" ON)
add_compile_definitions(RENDER_TEXTURE)
endif()
if (USE_EMBREE)
add_compile_definitions(USE_EMBREE)
option(LIBIGL_EMBREE "Use EMBREE" ON)
endif()
if(USE_PYBIND)
add_compile_definitions(PYBIND)
endif()

# Set suitesparse compile definitions
# WARNING: This compile definition publicly links suitesparse into the
# conformal ideal delaunay library
if(USE_SUITESPARSE)
add_compile_definitions(USE_SUITESPARSE)
set(SUITESPARSE_LIBS
SuiteSparse::SuiteSparseConfig
SuiteSparse::SPQR
SuiteSparse::CHOLMOD
)
endif()

# Get external libraries
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/util")
include(conformal_ideal_delaunay)
include(libigl)
include(spectra)
include(cli11)
include(json)
include(geometry-central)

# Optionally create visualization library
# Optionally create rendering library
if(RENDER_TEXTURE)
# Build core rendering library
# TODO: Move somewhere reasonable
add_library(rendering
src/util/visualization.cc
src/optimization/util/visualization.cc
)
target_include_directories(rendering PUBLIC include/optimization/optimization/util)
target_link_libraries(rendering PUBLIC
igl::core
igl::glfw
igl::png
plot
)
if(USE_EMBREE)
target_link_libraries(rendering PUBLIC
igl::embree
)
endif()

# Link in embree if enabled
if(USE_EMBREE)
target_link_libraries(rendering PUBLIC
igl::embree
)
endif()

# Change rendering libraries from null to singleton
set(RENDER_LIBRARIES
rendering
)
Expand All @@ -106,50 +139,13 @@ if(ENABLE_VISUALIZATION)
)
endif()

# Install executables to bin directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Make main cpp library
add_subdirectory(src)

# Build executables
add_subdirectory(src/app)

# Build pybind optimization functions
# Optionally build pybind
if(USE_PYBIND)
include(pybind11)
add_library(optimization_py MODULE
src/penner_optimization_pybind.cpp
)

# Link libraries
target_link_libraries(optimization_py PUBLIC
PennerOptimizationLib
pybind11::module
${RENDER_LIBRARIES}
)

# Set pybinding settings
set_target_properties(optimization_py PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/py
)
set_target_properties(optimization_py PROPERTIES PREFIX
"${PYTHON_MODULE_PREFIX}"
)
endif()

# Optionally build tests (only valid for double precision)
if((BUILD_CURVATURE_METRIC_TESTS) AND (NOT USE_MULTIPRECISION))
include(Catch2)
# Install executables to bin directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Build testing executable
add_executable(CurvatureMetricTests
src/tests/tests.cpp
)
target_link_libraries(CurvatureMetricTests PRIVATE
PennerOptimizationLib
Catch2::Catch2WithMain
)
set(TEST_DATA_ROOT "${PROJECT_SOURCE_DIR}/src/tests/regression/")
target_compile_definitions(CurvatureMetricTests PUBLIC TEST_DATA_DIR=\"${TEST_DATA_ROOT}\")
endif()
# Make main cpp library
add_subdirectory(src)
11 changes: 11 additions & 0 deletions cmake/geometry-central.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if(TARGET geometry-central)
return()
endif()

include(FetchContent)
FetchContent_Declare(
geometry-central
SYSTEM
GIT_REPOSITORY https://github.com/nmwsharp/geometry-central.git
)
FetchContent_MakeAvailable(geometry-central)
8 changes: 8 additions & 0 deletions cmake/json.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(FetchContent)
FetchContent_Declare(
json
SYSTEM
GIT_REPOSITORY https://github.com/nlohmann/json.git
)
FetchContent_MakeAvailable(json)

11 changes: 0 additions & 11 deletions figures/fig-all.sh

This file was deleted.

6 changes: 0 additions & 6 deletions figures/fig-comparison.sh

This file was deleted.

6 changes: 0 additions & 6 deletions figures/fig-disk.sh

This file was deleted.

7 changes: 0 additions & 7 deletions figures/fig-examples.sh

This file was deleted.

7 changes: 0 additions & 7 deletions figures/fig-initial.sh

This file was deleted.

10 changes: 0 additions & 10 deletions figures/fig-interpolation.sh

This file was deleted.

7 changes: 0 additions & 7 deletions figures/fig-objectives.sh

This file was deleted.

5 changes: 0 additions & 5 deletions figures/fig-teaser.sh

This file was deleted.

9 changes: 0 additions & 9 deletions figures/pipeline.sh

This file was deleted.

64 changes: 0 additions & 64 deletions figures/pipelines/comparison_fixed.json

This file was deleted.

Loading

0 comments on commit 201db0b

Please sign in to comment.