Skip to content

Commit a8989ca

Browse files
committed
2 parents bb39c49 + 80bff4f commit a8989ca

40 files changed

+8115
-185
lines changed

.gitignore

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
node_modules/
12
build*/
2-
docs/public/
3-
docs/cache/
3+
public/
4+
cache/
45
*.bak
6+
jupyter/
57
# Prerequisites
68
*.d
79

@@ -34,3 +36,11 @@ docs/cache/
3436
*.exe
3537
*.out
3638
*.app
39+
40+
# Emacs files
41+
*~
42+
\#*\#
43+
*.elc
44+
auto-save-list
45+
tramp
46+
.\#*

CMakeLists.txt

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
44
# Date: 2020-06-03
55
#
6-
# Copyright (C) 2020 Cemosis
6+
# Copyright (C) 2020-present Cemosis
77
#
88
# Distributed under the GPL(GNU Public License):
99
# This program is free software; you can redistribute it and/or modify
@@ -21,20 +21,24 @@
2121
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2222
#
2323
#
24+
cmake_minimum_required(VERSION 3.21.0)
25+
project(feelpp-tutorial-dev VERSION 1.0.0)
26+
set(EXTRA_VERSION "-beta.1")
27+
set(PROJECT_SHORTNAME "ftd")
2428

25-
cmake_minimum_required(VERSION 3.12)
26-
project(feelpp-tutorial-dev VERSION 0.1.0)
27-
set(PROJECT_SHORTNAME "tut")
29+
include(GNUInstallDirs)
2830

31+
if (POLICY CMP0077)
32+
cmake_policy(SET CMP0077 NEW)
33+
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
34+
endif()
2935

30-
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
31-
#find_package(Feel++ COMPONENTS Toolboxes PATHS ${FEELPP_DIR}/share/feelpp/feel/cmake/modules $ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules /usr/share/feelpp/feel/cmake/modules /usr/local/share/feelpp/feel/cmake/modules )
32-
find_package(Feel++ PATHS ${FEELPP_DIR}/share/feelpp/feel/cmake/modules $ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules /usr/share/feelpp/feel/cmake/modules /usr/local/share/feelpp/feel/cmake/modules )
33-
if(NOT FEELPP_FOUND)
34-
message(FATAL_ERROR "Feel++ was not found on your system. Make sure to install it and specify the FEELPP_DIR to reference the installation directory.")
35-
endif()
36-
else()
37-
include_directories(${CMAKE_SOURCE_DIR}/toolboxes ${CMAKE_BINARY_DIR}/toolboxes)
36+
find_package(Feel++ COMPONENTS Toolboxes PATHS ${FEELPP_DIR}/share/feelpp/feel/cmake/modules $ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules /usr/share/feelpp/feel/cmake/modules /usr/local/share/feelpp/feel/cmake/modules )
37+
if(NOT FEELPP_FOUND)
38+
message(FATAL_ERROR "Feel++ was not found on your system. Make sure to install it and specify the FEELPP_DIR to reference the installation directory.")
39+
endif()
40+
if ( NOT FEELPP_TOOLBOXES_FOUND )
41+
message(WARNING "Feel++ Toolboxes SDK is not found on your system. The toolbox application is now disabled.")
3842
endif()
3943

4044
enable_testing()
@@ -44,6 +48,7 @@ if ( NOT TARGET check )
4448
endif()
4549

4650

51+
add_subdirectory( src )
4752
add_subdirectory( docs )
4853

4954
# extra ignored files
@@ -53,7 +58,38 @@ list(APPEND CPACK_SOURCE_IGNORE_FILES
5358
.travis.yml
5459
.appveyor.yml
5560
)
56-
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
57-
set(CPACK_GENERATOR "TGZ")
61+
62+
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}")
63+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}")
64+
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}")
65+
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets")
66+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cemosis feelpp-tutorial-dev applications")
67+
set(CPACK_PACKAGE_DESCRIPTION "Cemosis provides a Feel++ programming tutorial.")
68+
set(CPACK_PACKAGE_VENDOR "Cemosis")
69+
set(CPACK_PACKAGE_CONTACT "Christophe Prud'homme <christophe.prudhomme@cemosis.fr>")
70+
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
71+
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
72+
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
73+
74+
75+
set(CPACK_GENERATOR "TGZ;DEB")
5876
set(CPACK_SOURCE_GENERATOR "TGZ")
77+
78+
79+
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}")
80+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
81+
if ( USE_FEELPP_TOOLBOXES )
82+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libfeelpp1 (>= 0.109)") # add depends with relevant toolbox lib
83+
else()
84+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libfeelpp1 (>= 0.109)")
85+
endif()
86+
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
87+
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
88+
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
89+
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
90+
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${EXTRA_VERSION}")
91+
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
92+
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/debian/postinst")
93+
5994
include(CPack)
95+

CMakePresets.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"version": 3,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 21,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "default",
11+
"displayName": "Default Config",
12+
"description": "Default config",
13+
"generator": "Unix Makefiles",
14+
"binaryDir": "${sourceDir}/build/default",
15+
"cacheVariables": {
16+
"CMAKE_CXX_COMPILER": "clang++",
17+
"CMAKE_C_COMPILER": "clang",
18+
"CMAKE_INSTALL_PREFIX" : "${sourceDir}/build/default/install/",
19+
"CMAKE_BUILD_TYPE": "Release"
20+
},
21+
"vendor": {
22+
"example.com/ExampleIDE/1.0": {
23+
"autoFormat": true
24+
}
25+
}
26+
},
27+
{
28+
"name": "install-local",
29+
"inherits": "default",
30+
"displayName": "Build and Install system",
31+
"description": "Build and Install in /usr/local",
32+
"generator": "Unix Makefiles",
33+
"binaryDir": "${sourceDir}/build/install-local",
34+
"cacheVariables": {
35+
"CMAKE_INSTALL_PREFIX": "/usr/local"
36+
},
37+
"vendor": {
38+
"example.com/ExampleIDE/1.0": {
39+
"autoFormat": true
40+
}
41+
}
42+
}
43+
],
44+
"buildPresets": [
45+
{
46+
"name": "default",
47+
"configurePreset": "default",
48+
"jobs": 10
49+
},
50+
{
51+
"name": "install-local",
52+
"configurePreset": "install-local",
53+
"inherits": "default",
54+
"targets": [
55+
"all","install","package"
56+
]
57+
}
58+
],
59+
"testPresets": [
60+
{
61+
"name": "default",
62+
"configurePreset": "default",
63+
"output": {
64+
"outputOnFailure": true
65+
},
66+
"execution": {
67+
"noTestsAction": "error",
68+
"stopOnFailure": true
69+
}
70+
}
71+
],
72+
"vendor": {
73+
"example.com/ExampleIDE/1.0": {
74+
"autoFormat": false
75+
}
76+
}
77+
}

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- mode: Dockerfile -*-
2+
3+
FROM ghcr.io/feelpp/feelpp:jammy
4+
5+
USER root
6+
COPY . /home/feelpp/
7+
RUN ls -lrtR /home/feelpp
8+
9+
RUN dpkg -i /home/feelpp/*.deb
10+
11+
USER feelpp
12+

README.adoc

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
11
:feelpp: Feel++
2-
= {feelpp} tutorial-dev
2+
:cpp: C++
3+
:project: feelpp-tutorial-dev
4+
5+
= Programming {feelpp} Tutorial
6+
Christophe Prud'homme <https://github.com/prudhomm[@prudhomm]>
7+
v2:
38

49
image:https://github.com/feelpp/feelpp-tutorial-dev/workflows/CI/badge.svg[CI]
510

6-
This is a {feelpp} Dev Tutorial Project.
11+
This repository provides a {feelpp} programming tutorial.
12+
13+
It includes
14+
15+
- [x] {feelpp} applications in {cpp} to use {feelpp} and {feelpp} toolboxes in `src`
16+
- [x] documentation using asciidoc and antora
17+
- [x] python {feelpp} notebooks that can be downloaded from the documentation
18+
- [x] continuous integration including tests for the {cpp} applications
19+
- [x] docker image generation for the project
20+
- [x] a set of {cpp} examples using the {feelpp} library
21+
22+
The documentation for feelpp-project is available at link:https://feelpp.github.io/feelpp-project[here] and you can build on it for your project by enabling the link:https://docs.github.com/en/pages[github pages] for your repository.
23+
24+
== Renaming the project
25+
26+
By default the project is named `feelpp-project` if you cloned the repository `feelpp/feelpp-project`.
27+
However if you used the previous repository as a template, then the project is renamed using the name of the repository using the script `rename.sh` at the initialization of the repository.
28+
If the name does not suit you, you can change it again using the script `rename.sh` and providing the new name as argument.
29+
30+
WARNING: the script `rename.sh` will rename the project however some url might be set properly if you rename the project yourself. You need to check the following files: `docs/site.yml` and `docs/package.json` and fix the urls after the rename process is done.
31+
32+
== Updating the {project} version
33+
34+
The version of the project is defined in the files `CMakeLists.txt`, `docs/antora.yml` and `docs/package.json`.
35+
You need to update with the same version in all files.
36+
37+
== Release process
738

8-
The Repository is organized using Antora.
39+
{project} uses semver versioning. The release process is the following:
940

10-
The code samples are compiled using {feelpp} and are stored in docs/modules/ROOT/examples.
41+
- [x] update the version in CMakeLists.txt
42+
- [x] update the version in docs/antora.yml
43+
- [x] commit the changes with the tag `vX.Y.Z` and push the tag to github, this will trigger the CI to build the documentation and the docker image as well as the release of the software on github.

docs/CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11

22
add_subdirectory( modules/ROOT/examples )
33

4-
set(APPLICATION_DOC_DIR "${CMAKE_INSTALL_DOCDIR}")
4+
# set(APPLICATION_DOC_DIR "${CMAKE_INSTALL_DOCDIR}")
55

6-
set(ANTORA_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/public")
6+
# set(ANTORA_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/public")
77

8-
find_program (npm NAMES npm)
8+
#find_program (npm NAMES npm)
9+
#
10+
# add_custom_command(OUTPUT "${ANTORA_OUTPUT_DIR}" ALL
11+
# COMMENT "Building documentation... "
12+
# COMMAND "${npm}" run install
13+
# COMMAND "${npm}" run antora
14+
# WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
15+
# )
16+
#
17+
# add_custom_target(doc ALL DEPENDS "${ANTORA_OUTPUT_DIR}")
918

10-
add_custom_command(OUTPUT "${ANTORA_OUTPUT_DIR}" ALL
11-
COMMENT "Building documentation... "
12-
COMMAND "${npm}" run antora
13-
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
14-
)
15-
16-
add_custom_target(doc ALL DEPENDS "${ANTORA_OUTPUT_DIR}")
17-
18-
install(DIRECTORY "${ANTORA_OUTPUT_DIR}/" DESTINATION ${APPLICATION_DOC_DIR} OPTIONAL)
19+
#install(DIRECTORY "${ANTORA_OUTPUT_DIR}/" DESTINATION ${APPLICATION_DOC_DIR} OPTIONAL)

docs/Testing/Temporary/CTestCostData.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/Testing/Temporary/LastTest.log

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

docs/antora.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
name: tutorial-dev
2-
title: Feel++ Tutorial Dev
3-
version: 'latest'
1+
name: feelpp-tutorial-dev
2+
title: Feel++ Programming Tutorial
3+
version: ~
4+
start_page: index.adoc
45
nav:
56
- modules/ROOT/nav.adoc
7+
ext:
8+
collector:
9+
- run:
10+
command: ./generate-jupyter.sh docs/modules/ROOT
11+
scan:
12+
dir: jupyter/
13+
files: '**/*.ipynb'
14+
base: modules/ROOT/attachments/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<footer class="footer" style="border-top: 2px solid #e9e9e9; background-color: #fafafa; padding-bottom: 2em; padding-top: 2em;">
2+
<div class="container" style="display: flex; flex-direction: column; align-items: center; gap: 0.5em;">
3+
<div>
4+
<a href="https://www.cemosis.fr">
5+
<img src="{{{uiRootPath}}}/img/cemosis-logo.svg" alt="Cemosis logo" height="50">
6+
</a>
7+
</div>
8+
<span style="font-size: 0.8rem; color: #9e9e9e"{{{year}}} <a href="https://www.cemosis.fr" style="text-decoration: underline;">Cemosis</a>, Université de Strasbourg</span>
9+
</div>
10+
</footer>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<header class="header">
2+
<nav class="navbar navbar-expand-sm bg-dark navbar-dark navbar-template-project" style="border-top: 4px solid #9E9E9E">
3+
<div class="navbar-brand">
4+
<div class="navbar-item feelpp-logo">
5+
<a href="{{{site.url}}}">{{site.title}}</a>
6+
</div>
7+
<button class="navbar-burger" data-target="topbar-nav">
8+
<span></span>
9+
<span></span>
10+
<span></span>
11+
</button>
12+
</div>
13+
14+
<div id="topbar-nav" class="navbar-menu">
15+
<div class="navbar-end">
16+
<div class="navbar-item">
17+
<a href="https://docs.feelpp.org/">Documentation Reference</a>
18+
</div>
19+
<div class="navbar-item">
20+
<a class="navbar-brand" href="https://www.cemosis.fr">
21+
<img class="cemosis-logo" src="{{{uiRootPath}}}/img/cemosis-logo.svg" alt="Cemosis logo"/>
22+
</a>
23+
</div>
24+
</div>
25+
</div>
26+
</nav>
27+
</header>

docs/modules/ROOT/examples/04-myexpression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main(int argc, char**argv )
6969
#endif
7070
// tag::grad[]
7171
auto grad_g=grad<2>(g);
72-
auto grad_f=grad(f);
72+
auto grad_f=grad<2>(f);
7373
Feel::cout << "grad(g)=" << grad_g << std::endl;
7474
Feel::cout << "grad(f)=" << grad_f << std::endl;
7575
// end::grad[]

0 commit comments

Comments
 (0)