Skip to content

Commit

Permalink
Create a C++-only version of the app4triqs skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed May 31, 2024
1 parent 865df64 commit 41f7b4b
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 268 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build

on:
push:
branches: [ notriqs, '[0-9]+.[0-9]+.x' ]
branches: [ cpp_only_notriqs, '[0-9]+.[0-9]+.x' ]
pull_request:
branches: [ notriqs, '[0-9]+.[0-9]+.x' ]
branches: [ cpp_only_notriqs, '[0-9]+.[0-9]+.x' ]
workflow_call:
workflow_dispatch:

Expand Down Expand Up @@ -72,6 +72,7 @@ jobs:
python3-clang-15
python3-dev
python3-mako
python3-matplotlib
python3-mpi4py
python3-numpy
python3-pip
Expand Down
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,8 @@ if(NOT IS_SUBPROJECT)
message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
endif()

# Python Support
option(PythonSupport "Build with Python support" ON)

# Documentation
option(Build_Documentation "Build documentation" OFF)
if(NOT IS_SUBPROJECT AND (Build_Documentation AND NOT PythonSupport))
message(FATAL_ERROR "Build_Documentation=ON requires PythonSupport to be enabled")
endif()

# Testing
option(Build_Tests "Build tests" ON)
Expand Down Expand Up @@ -152,11 +146,6 @@ if(Build_Tests)
add_subdirectory(test)
endif()

# Python
if(PythonSupport)
add_subdirectory(python/${PROJECT_NAME})
endif()

# Docs
if(NOT IS_SUBPROJECT AND Build_Documentation)
add_subdirectory(doc)
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To adapt this skeleton for a new TRIQS application, the following steps are nece
* Run the following commands in order after replacing **appname** accordingly

```bash
git clone https://github.com/triqs/app4triqs --branch unstable appname
git clone https://github.com/triqs/app4triqs --branch cpp_only_notriqs appname
cd appname
./share/squash_history.sh
./share/replace_and_rename.py appname
Expand All @@ -36,7 +36,7 @@ You can merge future changes to the app4triqs skeleton into your project with th

```bash
git remote update
git merge app4triqs_remote/unstable -X ours -m "Merge latest app4triqs skeleton changes"
git merge app4triqs_remote/cpp_only_notriqs -X ours -m "Merge latest app4triqs skeleton changes"
```

If you should encounter any conflicts resolve them and `git commit`.
Expand All @@ -61,9 +61,6 @@ according to your needs (replace app4triqs in the following by the name of your
* Adjust or remove the `README.md` and `doc/ChangeLog.md` file
* In the `c++/app4triqs` subdirectory adjust the example files `app4triqs.hpp` and `app4triqs.cpp` or add your own source files.
* In the `test/c++` subdirectory adjust the example test `basic.cpp` or add your own tests.
* In the `python/app4triqs` subdirectory add your Python source files.
Be sure to remove the `app4triqs_module_desc.py` file unless you want to generate a Python module from your C++ source code.
* In the `test/python` subdirectory adjust the example test `Basic.py` or add your own tests.
* Adjust any documentation examples given as `*.rst` files in the doc directory.
* Adjust the sphinx configuration in `doc/conf.py.in` as necessary.
* The build and install process is identical to the one outline [here](https://triqs.github.io/app4triqs/unstable/install.html).
Expand Down
2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else()
endif()

# -- Cpp2Py --
if(PythonSupport OR (NOT IS_SUBPROJECT AND Build_Documentation))
if(NOT IS_SUBPROJECT AND Build_Documentation)
external_dependency(Cpp2Py
GIT_REPO https://github.com/TRIQS/cpp2py
VERSION 2.0
Expand Down
8 changes: 1 addition & 7 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,11 @@ endif()
add_custom_target(${PROJECT_NAME}_docs_sphinx ALL)
add_custom_command(
TARGET ${PROJECT_NAME}_docs_sphinx
COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:${h5_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -c . -j auto -b html ${CMAKE_CURRENT_SOURCE_DIR} html
COMMAND ${SPHINXBUILD_EXECUTABLE} -j auto -c . -b html ${CMAKE_CURRENT_SOURCE_DIR} html
)

option(Sphinx_Only "When building the documentation, skip the Python Modules and the generation of C++ Api and example outputs" OFF)
if(NOT Sphinx_Only)
# Autodoc usage requires the python modules to be built first
get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
if(CPP2PY_MODULES_LIST)
add_dependencies(${PROJECT_NAME}_docs_sphinx ${CPP2PY_MODULES_LIST})
endif()

# Generation of C++ Api and Example Outputs
add_dependencies(${PROJECT_NAME}_docs_sphinx ${PROJECT_NAME}_docs_cpp2rst ${PROJECT_NAME}_docs_example_output)
endif()
Expand Down
10 changes: 0 additions & 10 deletions doc/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,3 @@ C++ reference manual
:maxdepth: 5

cpp2rst_generated/contents

Python reference manual
=======================

.. autosummary::
:toctree: _autosummary
:template: autosummary_module_template.rst
:recursive:

app4triqs
26 changes: 0 additions & 26 deletions python/app4triqs/CMakeLists.txt

This file was deleted.

30 changes: 0 additions & 30 deletions python/app4triqs/__init__.py

This file was deleted.

76 changes: 0 additions & 76 deletions python/app4triqs/app4triqs_module_desc.py

This file was deleted.

31 changes: 0 additions & 31 deletions python/app4triqs/version.py.in

This file was deleted.

5 changes: 0 additions & 5 deletions share/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ if(NOT IS_SUBPROJECT
AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr/local"
)

if(PythonSupport)
set(EXPORT_PYTHON_PATH "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CPP2PY_PYTHON_LIB_DEST_ROOT}:$PYTHONPATH")
set(MODFILE_PYTHON_PATH "prepend-path PYTHONPATH $root/${CPP2PY_PYTHON_LIB_DEST_ROOT}")
endif()

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

Expand Down
1 change: 0 additions & 1 deletion share/app4triqs.modulefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ prepend-path CPLUS_INCLUDE_PATH $root/include
prepend-path LIBRARY_PATH $root/lib
prepend-path LD_LIBRARY_PATH $root/lib
prepend-path CMAKE_PREFIX_PATH $root
@MODFILE_PYTHON_PATH@
1 change: 0 additions & 1 deletion share/app4triqsvars.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
export LIBRARY_PATH=@CMAKE_INSTALL_FULL_LIBDIR@:$LIBRARY_PATH
export LD_LIBRARY_PATH=@CMAKE_INSTALL_FULL_LIBDIR@:$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@:$CMAKE_PREFIX_PATH
@EXPORT_PYTHON_PATH@
6 changes: 0 additions & 6 deletions share/cmake/app4triqs-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,4 @@ message(STATUS "Found @PROJECT_NAME@-config.cmake with version @PROJECT_VERSION@
# Was the Project built with Documentation?
set(@PROJECT_NAME@_WITH_DOCUMENTATION @Build_Documentation@ CACHE BOOL "Was @PROJECT_NAME@ build with documentation?")

# Was the Project built with PythonSupport?
set(@PROJECT_NAME@_WITH_PYTHON_SUPPORT @PythonSupport@ CACHE BOOL "Was @PROJECT_NAME@ build with python support?")
if(@PythonSupport@)
set(@PROJECT_NAME@_MODULE_DIR @CMAKE_INSTALL_PREFIX@/@CPP2PY_PYTHON_LIB_DEST_ROOT@ CACHE BOOL "The @PROJECT_NAME@ python module directory")
endif()

endif()
4 changes: 0 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
add_subdirectory(c++)

if(PythonSupport)
add_subdirectory(python)
endif()
37 changes: 0 additions & 37 deletions test/python/Basic.py

This file was deleted.

15 changes: 0 additions & 15 deletions test/python/CMakeLists.txt

This file was deleted.

0 comments on commit 41f7b4b

Please sign in to comment.