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 7978951 commit c745380
Show file tree
Hide file tree
Showing 24 changed files with 162 additions and 285 deletions.
4 changes: 2 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: [ unstable, '[0-9]+.[0-9]+.x' ]
branches: [ cpp_only, '[0-9]+.[0-9]+.x' ]
pull_request:
branches: [ unstable, '[0-9]+.[0-9]+.x' ]
branches: [ cpp_only, '[0-9]+.[0-9]+.x' ]
workflow_call:
workflow_dispatch:

Expand Down
14 changes: 0 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,8 @@ if(NOT IS_SUBPROJECT)
message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
endif()

# Python Support
option(PythonSupport "Build with Python support" ON)
if(PythonSupport AND NOT TRIQS_WITH_PYTHON_SUPPORT)
message(FATAL_ERROR "TRIQS was installed without Python support. Cannot build the Python Interface. Disable the build with -DPythonSupport=OFF")
endif()

# 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 @@ -142,11 +133,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 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 -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 @@ -56,17 +56,11 @@ endif()
add_custom_target(${PROJECT_NAME}_docs_sphinx ALL)
add_custom_command(
TARGET ${PROJECT_NAME}_docs_sphinx
COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -j auto -c . -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
32 changes: 32 additions & 0 deletions doc/_autosummary/app4triqs.app4triqs_module.Toto.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
app4triqs.app4triqs\_module.Toto
================================

.. currentmodule:: app4triqs.app4triqs_module

.. autoclass:: Toto
:members:
:show-inheritance:
:inherited-members:


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~Toto.__init__
~Toto.f
~Toto.hdf5_format





.. rubric:: Attributes

.. autosummary::

~Toto.i

6 changes: 6 additions & 0 deletions doc/_autosummary/app4triqs.app4triqs_module.chain.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app4triqs.app4triqs\_module.chain
=================================

.. currentmodule:: app4triqs.app4triqs_module

.. autofunction:: chain
39 changes: 39 additions & 0 deletions doc/_autosummary/app4triqs.app4triqs_module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
app4triqs.app4triqs\_module
===========================

.. automodule:: app4triqs.app4triqs_module



.. rubric:: Functions

.. autosummary::
:toctree:

chain









.. rubric:: Classes

.. autosummary::
:toctree:
:template: autosummary_class_template.rst

Toto










35 changes: 35 additions & 0 deletions doc/_autosummary/app4triqs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
app4triqs
=========

.. automodule:: app4triqs



















.. rubric:: Modules

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


app4triqs.app4triqs_module
app4triqs.version


32 changes: 32 additions & 0 deletions doc/_autosummary/app4triqs.version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
app4triqs.version
=================

.. automodule:: app4triqs.version



.. rubric:: Functions

.. autosummary::
:toctree:

show_git_hash
show_version


















6 changes: 6 additions & 0 deletions doc/_autosummary/app4triqs.version.show_git_hash.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app4triqs.version.show\_git\_hash
=================================

.. currentmodule:: app4triqs.version

.. autofunction:: show_git_hash
6 changes: 6 additions & 0 deletions doc/_autosummary/app4triqs.version.show_version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app4triqs.version.show\_version
===============================

.. currentmodule:: app4triqs.version

.. autofunction:: show_version
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.

Loading

0 comments on commit c745380

Please sign in to comment.