Skip to content
Open
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
321 changes: 316 additions & 5 deletions CMakeLists.txt

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions doc/manual/tuto/cp_robotics/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Adding IBEX

# In case you installed IBEX in a local directory, you need
# to specify its path with the CMAKE_PREFIX_PATH option.
# set(CMAKE_PREFIX_PATH "~/ibex-lib/build_install")

find_package(IBEX REQUIRED)
ibex_init_common() # IBEX should have installed this function
message(STATUS "Found IBEX version ${IBEX_VERSION}")

# Adding Codac

# In case you installed Codac in a local directory, you need
Expand All @@ -38,4 +28,4 @@
)
target_compile_options(${PROJECT_NAME} PUBLIC ${CODAC_CXX_FLAGS})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CODAC_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${CODAC_LIBRARIES} Ibex::ibex)
target_link_libraries(${PROJECT_NAME} PUBLIC ${CODAC_LIBRARIES})
4 changes: 0 additions & 4 deletions examples/00_graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/01_batman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/02_centered_form/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/03_sivia/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/04_explored_area/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
11 changes: 0 additions & 11 deletions examples/05_capd_solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ project(codac_example LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Adding IBEX

# In case you installed IBEX in a local directory, you need
# to specify its path with the CMAKE_PREFIX_PATH option.
# set(CMAKE_PREFIX_PATH "~/ibex-lib/build_install")

find_package(IBEX REQUIRED)
ibex_init_common() # IBEX should have installed this function
message(STATUS "Found IBEX version ${IBEX_VERSION}")

# Adding Codac

# In case you installed Codac in a local directory, you need
Expand All @@ -41,5 +31,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
${CODAC_LIBRARIES}
${CODAC_CAPD_LIBRARY}
capd::capd
Ibex::ibex
)
4 changes: 0 additions & 4 deletions examples/06_graphics_3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/07_centered_2D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/08_centered_3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/09_robot_simu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/10_lie_groups/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/11_peibos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
5 changes: 0 additions & 5 deletions examples/12_peibos_capd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand All @@ -35,5 +31,4 @@
${CODAC_LIBRARIES}
${CODAC_CAPD_LIBRARY}
capd::capd
Ibex::ibex
)
4 changes: 0 additions & 4 deletions examples/13_qinter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
4 changes: 0 additions & 4 deletions examples/14_lohner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
5 changes: 0 additions & 5 deletions examples/15_sympy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand All @@ -37,5 +33,4 @@
${CODAC_LIBRARIES}
${CODAC_SYMPY_LIBRARY} # linking to the codac-sympy extension
pybind11::embed # linking to pybind11
Ibex::ibex
)
4 changes: 0 additions & 4 deletions examples/16_visibility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
find_package(CODAC REQUIRED)
message(STATUS "Found Codac version ${CODAC_VERSION}")

# Initializating Ibex

ibex_init_common()

# Compilation

if(FAST_RELEASE)
Expand Down
12 changes: 1 addition & 11 deletions examples/ellipsoid_example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Adding IBEX

# In case you installed IBEX in a local directory, you need
# to specify its path with the CMAKE_PREFIX_PATH option.
# set(CMAKE_PREFIX_PATH "~/ibex-lib/build_install")

find_package(IBEX REQUIRED)
ibex_init_common() # IBEX should have installed this function
message(STATUS "Found IBEX version ${IBEX_VERSION}")

# Adding Eigen3

# In case you installed Eigen3 in a local directory, you need
Expand All @@ -41,4 +31,4 @@
add_executable(${PROJECT_NAME} main.cpp)
target_compile_options(${PROJECT_NAME} PUBLIC ${CODAC_CXX_FLAGS})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CODAC_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${CODAC_LIBRARIES} Ibex::ibex Eigen3::Eigen)
target_link_libraries(${PROJECT_NAME} PUBLIC ${CODAC_LIBRARIES} Eigen3::Eigen)
4 changes: 3 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
# Adds pybind11::headers, pybind11::module, pybind11::embed

set(PYTHON_PACKAGE_NAME ${PROJECT_NAME})
set(PYTHON_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/python_package")
set(PYTHON_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/python_package"
CACHE INTERNAL "Codac Python package build directory"
)

file(MAKE_DIRECTORY ${PYTHON_PACKAGE_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/${PYTHON_PACKAGE_NAME}/" "${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}")
Expand Down
65 changes: 63 additions & 2 deletions python/src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@
)

target_include_directories(_core
# First, so that a header is opened at src/... rather than through
# build/include: the path a translation unit used is the path gcov records,
# and the two spellings would split every header into two entries in the
# coverage report. See codac_publish_include_dirs() in the top-level CMakeLists.txt.
PRIVATE ${CODAC_SOURCE_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../docstring
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../../include
PRIVATE ${CMAKE_BINARY_DIR}/src
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/actions/
Expand All @@ -160,9 +165,65 @@
)

target_link_libraries(_core
PRIVATE ${PROJECT_NAME}-core ${PROJECT_NAME}-sympy ${LIBS} Ibex::ibex
PRIVATE ${PROJECT_NAME}-core ${PROJECT_NAME}-sympy Threads::Threads Codac::gaol
)

# --------------------------------------------------------------
# Sanitizer runtime as a shared library (Debug builds only)
# --------------------------------------------------------------
#
# _core.so is loaded via dlopen() by an unsanitized python
# interpreter. By default Clang/GCC embed the ASan/UBSan runtime
# statically into shared libraries, which leaves symbols like
# __ubsan_vptr_type_cache or __asan_* unresolved at dlopen() time
# (python has no sanitizer runtime of its own to provide them).
# -shared-libsan makes _core.so depend on the sanitizer runtime as
# a proper shared library instead; that runtime is then LD_PRELOAD-ed
# for the python tests (see tests/CMakeLists.txt).
# Not gated behind CMAKE_BUILD_TYPE (see the matching note in the root
# CMakeLists.txt): that variable is meaningless for multi-configuration
# generators, so -shared-libsan is applied via a $<CONFIG:Debug>
# generator expression instead, which CMake evaluates correctly for
# both single- and multi-config generators.
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(_core PRIVATE $<$<CONFIG:Debug>:-shared-libsan>)
target_link_options(_core PRIVATE $<$<CONFIG:Debug>:-shared-libsan>)
endif()

# --------------------------------------------------------------
# MSVC AddressSanitizer runtime DLL (Debug builds only)
# --------------------------------------------------------------
#
# /fsanitize=address (enabled in Debug mode only if a matching runtime
# was found -- see the MSVC branch in the root CMakeLists.txt, which
# sets CODAC_MSVC_ASAN_RUNTIME_DLL) makes _core.pyd import that runtime
# DLL. Unlike Clang/GCC on Linux, there is no LD_PRELOAD-style env var
# and no "must be the first library loaded" requirement to work around
# on Windows -- the loader simply needs to be able to find that DLL when
# Python calls LoadLibrary() on _core.pyd, which it does by searching
# the directory of the loading module before PATH. So it is enough to
# copy the runtime DLL next to the built _core.pyd, the same way
# _core.pyd itself is already copied into the package folder below.
# CODAC_MSVC_ASAN_RUNTIME_DLL is already empty (and this is then a
# no-op) whenever the root CMakeLists.txt couldn't locate that runtime,
# so /fsanitize=address was in that case never even added.
if(MSVC AND CODAC_MSVC_ASAN_RUNTIME_DLL)
# CODAC_MSVC_ASAN_RUNTIME_DLL is now found regardless of which
# configuration will be built (see the root CMakeLists.txt), since a
# multi-config generator does not know that yet at configure time. So
# the copy itself has to stay conditional on the configuration that is
# actually being built, which a plain if() cannot express:
# $<IF:$<CONFIG:Debug>,copy_if_different,echo> selects between the real
# "-E copy_if_different" and "-E echo", which merely prints the two
# paths, so the DLL is only copied for a Debug-configuration build, in
# any generator. "-E true" would read better, but it only exists since
# CMake 3.16 while this project accepts 3.14.
add_custom_command(TARGET _core POST_BUILD
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_if_different,echo> "${CODAC_MSVC_ASAN_RUNTIME_DLL}" "${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}"
)
endif()


# Copy the generated library in the package folder
add_custom_command(TARGET _core POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:_core>" "${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}"
Expand Down
9 changes: 7 additions & 2 deletions python/src/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
)

target_include_directories(_graphics
# First, so that a header is opened at src/... rather than through
# build/include: the path a translation unit used is the path gcov records,
# and the two spellings would split every header into two entries in the
# coverage report. See codac_publish_include_dirs() in the top-level CMakeLists.txt.
PRIVATE ${CODAC_SOURCE_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../docstring
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../../include
PRIVATE ${CMAKE_BINARY_DIR}/src
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../core/
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/
Expand All @@ -28,7 +33,7 @@
)

target_link_libraries(_graphics
PRIVATE ${PROJECT_NAME}-graphics ${LIBS} Ibex::ibex
PRIVATE ${PROJECT_NAME}-graphics Threads::Threads Codac::gaol
)

# Copy the generated library in the package folder
Expand Down
Loading
Loading