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 Jul 26, 2023
1 parent f23ebdf commit 83193a4
Show file tree
Hide file tree
Showing 24 changed files with 163 additions and 283 deletions.
6 changes: 3 additions & 3 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 ]
branches: [ unstable, cpp_only ]
pull_request:
branches: [ unstable ]
branches: [ unstable, cpp_only ]

jobs:
build:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
run: |
git clone https://github.com/TRIQS/triqs --branch unstable
mkdir triqs/build && cd triqs/build
cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$HOME/install
cmake .. -DBuild_Tests=OFF -DPythonSupport=OFF -DCMAKE_INSTALL_PREFIX=$HOME/install
make -j1 install VERBOSE=1
cd ../
Expand Down
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ 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(Build_Documentation AND NOT PythonSupport)
Expand Down Expand Up @@ -139,11 +133,6 @@ if(Build_Tests)
add_subdirectory(test)
endif()

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

# Docs
if(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 -m "Merge latest app4triqs skeleton changes"
git merge app4triqs_remote/cpp_only -m "Merge latest app4triqs skeleton changes"
```

If you should encounter any conflicts resolve them and `git commit`.
Expand All @@ -56,9 +56,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 Build_Documentation)
if(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 83193a4

Please sign in to comment.