Skip to content

Commit 8bc87e5

Browse files
committed
conan is back
1 parent 7f01143 commit 8bc87e5

11 files changed

Lines changed: 47 additions & 116 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,5 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1212
libgmp-dev \
1313
ninja-build
1414

15-
COPY tools/install-deps.sh /usr/local/bin/install-deps.sh
16-
17-
RUN /usr/local/bin/install-deps.sh \
18-
&& apt-get autoremove -y \
19-
&& apt-get clean -y \
20-
&& rm -rf /var/lib/apt/lists/*
2115

2216
COPY --from=uv --chown=vscode /uv /uvx /bin/

.devcontainer/postCreateCommand.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ from libstdcxx.v6.printers import register_libstdcxx_printers
1616
register_libstdcxx_printers (None)
1717
end
1818
EOT
19+
20+
# install conan
21+
uv venv
22+
source /home/vscode/.venv/bin/activate
23+
uv pip install conan
24+
25+
# setup conan profile and install dependencies
26+
conan profile detect --force
27+
conan install . --output-folder=build --build=missing

.devcontainer/postStartCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
uv sync --all-groups --all-extras
55

66
# install pre-commit hooks
7-
# uv run pre-commit install --install-hooks
7+
# uv run pre-commit install --install-hooks

CMakeLists.txt

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,8 @@ configure_file(
9797
${PROJECT_BINARY_DIR}/include/pauliengine/Info.h
9898
)
9999

100-
add_subdirectory(src)
101-
102-
103-
104-
# cmake_minimum_required(VERSION 3.15...3.27)
105-
# cmake_policy(SET CMP0091 NEW)
106-
107-
# project(pauliengine LANGUAGES CXX)
100+
# Conan Toolchain einbinden (nach: conan install .. --install-folder=build --build=missing)
101+
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake OPTIONAL RESULT_VARIABLE _found)
108102

109-
# # Standardkonfiguration
110-
# set(CMAKE_CXX_STANDARD 20)
111-
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)
112-
113-
# if (CMAKE_VERSION VERSION_LESS 3.18)
114-
# set(DEV_MODULE Development)
115-
# else()
116-
# set(DEV_MODULE Development.Module)
117-
# endif()
118-
119-
# if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
120-
# set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
121-
# set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
122-
# endif()
123-
124-
# # Conan Toolchain einbinden (nach: conan install .. --install-folder=build --build=missing)
125-
# # include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake OPTIONAL RESULT_VARIABLE _found)
126-
127-
# add_subdirectory(src)
103+
add_subdirectory(src)
128104

CMakePresets.json

Lines changed: 0 additions & 69 deletions
This file was deleted.

CMakeUserPresets.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 4,
3+
"vendor": {
4+
"conan": {}
5+
},
6+
"include": [
7+
"build/CMakePresets.json"
8+
]
9+
}

cmake/compiler_flags/CXXFlags.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# flags.
77
# The complete list of flags is built as:
88
#
9-
# CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_<CONFIG> ARCH_FLAG pauliengine_CXX_FLAGS EXTRA_CXXFLAGS
9+
# CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_<CONFIG> ARCH_FLAG PAULIENGINE_CXX_FLAGS EXTRA_CXXFLAGS
1010
#
1111
# where:
1212
#
@@ -17,7 +17,7 @@
1717
# ``Clang.CXX.cmake``, and ``Intel.CXX.cmake`` files.
1818
# - ``ARCH_FLAG`` is the architecture-dependent optimization flag, *e.g.*
1919
# vectorization. Default is empty.
20-
# - ``pauliengine_CXX_FLAGS`` are PAULIENGINE-lite-specific flags to be used for all builds.
20+
# - ``PAULIENGINE_CXX_FLAGS`` are PAULIENGINE-specific flags to be used for all builds.
2121
# The defaults are compiler-dependent: have a look at the ``GNU.CXX.cmake``,
2222
# ``Clang.CXX.cmake``, and ``Intel.CXX.cmake`` files.
2323
# - ``EXTRA_CXXFLAGS`` useful if you need to append certain flags to the full
@@ -72,7 +72,7 @@ if(PAULIENGINE_ENABLE_ARCH_FLAGS AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
7272
endif()
7373
endif()
7474

75-
set(pauliengine_CXX_FLAGS "")
75+
set(PAULIENGINE_CXX_FLAGS "")
7676
include(${CMAKE_CURRENT_LIST_DIR}/GNU.CXX.cmake)
7777
include(${CMAKE_CURRENT_LIST_DIR}/Intel.CXX.cmake)
7878
include(${CMAKE_CURRENT_LIST_DIR}/Clang.CXX.cmake)

conan_profile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
3+
[conf]
4+
tools.cmake.cmaketoolchain:generator=Ninja

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["nanobind", "scikit-build-core>=0.11", "setuptools-scm>=8"]
2+
requires = ["nanobind", "scikit-build-core>=0.11", "setuptools-scm>=8", "conan"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
@@ -62,14 +62,17 @@ url = "https://pypi.org/simple"
6262
# protect the configuration against future changes in scikit-build-core
6363
minimum-version = "build-system.requires"
6464
# setuptools-style build caching in a local directory
65-
build-dir = "build/{state}/{build_type}"
65+
build-dir = "build"
6666
# build stable ABI wheels for CPython 3.12+
6767
wheel.py-api = "cp312"
6868
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
6969
logging.level = "INFO"
7070
# read CMake version from CMakeLists.txt
7171
cmake.version = "CMakeLists.txt"
72-
cmake.build-type = "Release"
72+
cmake.build-type = "release"
73+
cmake.args = [
74+
"-DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake",
75+
]
7376
ninja.make-fallback = false
7477
sdist.exclude = [
7578
".clang-format",

src/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ find_package(SymEngine CONFIG)
2626

2727
if (SymEngine_FOUND)
2828
target_compile_definitions(pauliengine-objs PUBLIC HAVE_SYMENGINE)
29-
target_link_libraries(pauliengine-objs PUBLIC symengine gmp)
29+
# target_link_libraries(pauliengine-objs PUBLIC symengine gmp)
30+
target_link_libraries(pauliengine-objs PUBLIC symengine)
3031
endif()
3132

3233
# flags to prepend
@@ -43,11 +44,11 @@ target_compile_options(pauliengine-objs PUBLIC "${EXTRA_CXXFLAGS}")
4344

4445
if(DEFINED SKBUILD)
4546
add_subdirectory(bindings)
46-
else()
47+
# else()
4748
# if you want to compile some local C++ executable for testing
48-
if (SymEngine_FOUND)
49-
add_executable(example.x example.cpp)
50-
target_compile_definitions(example.x PUBLIC HAVE_SYMENGINE)
51-
endif()
49+
# if (SymEngine_FOUND)
50+
# add_executable(example.x example.cpp)
51+
# target_compile_definitions(example.x PUBLIC HAVE_SYMENGINE)
52+
# endif()
5253
endif()
5354

0 commit comments

Comments
 (0)