Skip to content

Commit 57425fc

Browse files
committed
Remove C++ support and cpp2py dependency
C++ code has been completely removed from the codebase. This commit removes all related CMake configuration: - Remove PythonSupport option (Python is now always built) - Remove cpp2py dependency from deps/CMakeLists.txt - Remove cpp2py module building logic from python/triqs_dft_tools/ - Remove wrap_generators handling (no *_desc.py files exist) - Update project description to remove cpp2py reference The project now builds Python-only components without conditional C++ support checks.
1 parent 872edfe commit 57425fc

File tree

5 files changed

+8
-47
lines changed

5 files changed

+8
-47
lines changed

CMakeLists.txt

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ##############################################################################
22
#
3-
# triqs_dft_tools - An example application using triqs and cpp2py
3+
# triqs_dft_tools - An example application using triqs
44
#
55
# Copyright (C) ...
66
#
@@ -28,7 +28,7 @@ project(triqs_dft_tools VERSION 3.3.1 LANGUAGES C CXX Fortran)
2828
get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)
2929

3030
# ############
31-
# Load TRIQS and CPP2PY
31+
# Load TRIQS
3232
find_package(TRIQS 3.3 REQUIRED)
3333

3434
# Get the git hash & print status
@@ -66,17 +66,8 @@ if(NOT IS_SUBPROJECT)
6666
message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
6767
endif()
6868

69-
# Python Support
70-
option(PythonSupport "Build with Python support" ON)
71-
if(PythonSupport AND NOT TRIQS_WITH_PYTHON_SUPPORT)
72-
message(FATAL_ERROR "TRIQS was installed without Python support. Cannot build the Python Interface. Disable the build with -DPythonSupport=OFF")
73-
endif()
74-
7569
# Documentation
7670
option(Build_Documentation "Build documentation" OFF)
77-
if(NOT IS_SUBPROJECT AND (Build_Documentation AND NOT PythonSupport))
78-
message(FATAL_ERROR "Build_Documentation=ON requires PythonSupport to be enabled")
79-
endif()
8071

8172
# Testing
8273
option(Build_Tests "Build tests" ON)
@@ -140,9 +131,7 @@ if(Build_Tests)
140131
endif()
141132

142133
# Python
143-
if(PythonSupport)
144-
add_subdirectory(python/${PROJECT_NAME})
145-
endif()
134+
add_subdirectory(python/${PROJECT_NAME})
146135

147136
# Docs
148137
if(NOT IS_SUBPROJECT AND Build_Documentation)

deps/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ else()
4747
endif()
4848
endif()
4949

50-
# -- Cpp2Py --
51-
if(PythonSupport OR (NOT IS_SUBPROJECT AND Build_Documentation))
52-
external_dependency(Cpp2Py
53-
GIT_REPO https://github.com/TRIQS/cpp2py
54-
VERSION 3.3
55-
GIT_TAG main
56-
BUILD_ALWAYS
57-
EXCLUDE_FROM_ALL
58-
)
59-
endif()
60-
6150
# -- GTest --
6251
external_dependency(GTest
6352
GIT_REPO https://github.com/google/googletest

python/triqs_dft_tools/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ configure_file(version.py.in version.py)
33

44
# All Python files. Copy them in the build dir to have a complete package for the tests.
55
file(GLOB_RECURSE python_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
6-
list(REMOVE_ITEM python_sources "${wrap_generators}")
76
foreach(file ${python_sources})
87
configure_file(${file} ${file} COPYONLY)
98
endforeach()
@@ -12,14 +11,3 @@ endforeach()
1211
set(PYTHON_LIB_DEST ${TRIQS_PYTHON_LIB_DEST_ROOT}/${PROJECT_NAME})
1312
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST})
1413
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${TRIQS_PYTHON_LIB_DEST_ROOT} FILES_MATCHING PATTERN "*.py" PATTERN "*_desc.py" EXCLUDE)
15-
16-
# Build and install any python modules
17-
foreach(gen ${wrap_generators})
18-
string(REPLACE "_desc.py" "" gen ${gen})
19-
get_filename_component(module_name ${gen} NAME_WE)
20-
get_filename_component(module_dir ${gen} DIRECTORY)
21-
add_cpp2py_module(NAME ${module_name} DIRECTORY ${module_dir})
22-
add_library(${PROJECT_NAME}::${module_name} ALIAS ${module_name})
23-
target_link_libraries(${module_name} ${PROJECT_NAME}_c triqs_py)
24-
install(TARGETS ${module_name} DESTINATION ${PYTHON_LIB_DEST}/${module_dir})
25-
endforeach()

share/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ if(NOT IS_SUBPROJECT
66
AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr/local"
77
)
88

9-
if(PythonSupport)
10-
set(EXPORT_PYTHON_PATH "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CPP2PY_PYTHON_LIB_DEST_ROOT}:$PYTHONPATH")
11-
set(MODFILE_PYTHON_PATH "prepend-path PYTHONPATH $root/${CPP2PY_PYTHON_LIB_DEST_ROOT}")
12-
endif()
9+
set(EXPORT_PYTHON_PATH "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CPP2PY_PYTHON_LIB_DEST_ROOT}:$PYTHONPATH")
10+
set(MODFILE_PYTHON_PATH "prepend-path PYTHONPATH $root/${CPP2PY_PYTHON_LIB_DEST_ROOT}")
1311

1412
configure_file(${PROJECT_NAME}.modulefile.in ${PROJECT_NAME}.modulefile @ONLY)
1513
configure_file(${PROJECT_NAME}vars.sh.in ${PROJECT_NAME}vars.sh @ONLY)

test/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
if(PythonSupport)
3-
add_subdirectory(python)
4-
add_subdirectory(python/plovasp)
5-
add_subdirectory(python/elk)
6-
endif()
1+
add_subdirectory(python)
2+
add_subdirectory(python/plovasp)
3+
add_subdirectory(python/elk)

0 commit comments

Comments
 (0)