Skip to content
Snippets Groups Projects
Commit 099e62b0 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Require at least CMake 3.16 and clang-10

The CMake change is now explicit. It was implicitly required by later
versions of Kokkos.

clang-9 was failing to build the code for quite a while since it did
not compile some proper C++17 code.
parent be8df395
No related branches found
No related tags found
1 merge request!129Require at least CMake 3.16 and clang-10
cmake_minimum_required (VERSION 3.10)
cmake_minimum_required (VERSION 3.16)
# CMake utils
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -90,8 +90,8 @@ endif()
#------------------------------------------------------
# Checks if compiler version is compatible with Pugs sources
set(GNU_CXX_MIN_VERSION "8.0.0")
set(CLANG_CXX_MIN_VERSION "8.0.0")
set(GNU_CXX_MIN_VERSION "9.0.0")
set(CLANG_CXX_MIN_VERSION "10.0.0")
# Pugs default compiler flags
set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -Wall -Wextra -pedantic")
......@@ -107,11 +107,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(PUGS_CXX_FLAGS "${PUGS_CXX_FLAGS} -Wsign-compare -Wunused -Wunused-member-function -Wunused-private-field")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0")
set(PUGS_STD_LINK_FLAGS "-lstdc++fs")
endif()
endif()
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0")
# set(PUGS_STD_LINK_FLAGS "-lstdc++fs")
# endif()
# endif()
#------------------------------------------------------
......@@ -600,20 +600,29 @@ target_link_libraries(
include(PugsDoxygen)
# ------------------- Installation --------------------
# temporary version workaround
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
install(TARGETS pugs
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
else()
install(TARGETS pugs PugsAlgebra PugsAnalysis PugsUtils PugsLanguage PugsLanguageAST PugsLanguageModules PugsLanguageAlgorithms PugsLanguageUtils PugsMesh PugsScheme PugsOutput
install(TARGETS
pugs
PugsMesh
PugsAlgebra
PugsAnalysis
PugsUtils
PugsLanguage
PugsLanguageAST
PugsLanguageModules
PugsLanguageAlgorithms
PugsMesh
PugsAlgebra
PugsScheme
PugsUtils
PugsOutput
PugsLanguageUtils
kokkos
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
# ------------------- Build options -------------------
message("")
message("====== pugs build options ======")
message(" version: ${PUGS_VERSION}")
......
......@@ -3,10 +3,16 @@
----
## Branches
`develop` and `master` branches are protected. This means that one cannot `push` on them, so **before** to do any code change one has to create a working branch. The following conventions are greatly encouraged:
`develop` and `master` branches are protected. This means that one
cannot `push` on them, so **before** to do any code change one has to
create a working branch. The following conventions are greatly
encouraged:
* `feature/my_outstanding_feature`
* `issue/issue-number` (if no number is related to the issue please consider [opening an issue](https://gitlab.delpinux.fr/code/pugs/issues) and assign it to yourself)
* `issue/issue-number` (if no number is related to the issue please
consider [opening an
issue](https://gitlab.delpinux.fr/code/pugs/issues) and assign it to
yourself)
----
## Tests and coverage
......@@ -18,21 +24,24 @@ Tests are built automatically and are run typing
**all tests should be running correctly before any merge request**
### Unit tests
Unit tests are defined in the `tests` directory. New unit tests should be written or updated when needed.
Unit tests are defined in the `tests` directory. New unit tests should
be written or updated when needed.
### Coverage
Preferably, one should install [gcovr](http://www.gcovr.com) and build `pugs` specifying the `Coverage` build type
> `cmake -DCMAKE_BUILD_TYPE=Coverage [...]`
Preferably, one should install [gcovr](http://www.gcovr.com) and build
`pugs` specifying the `Coverage` build type > `cmake
-DCMAKE_BUILD_TYPE=Coverage [...]`
However coverage is computed at each `push` by the `gitlab-ci`.
----
## Update build environment using [Docker](http://www.docker.com)
This is the easiest way to keep your environment update to build `pugs`.
## Up to date build environment using [Docker](http://www.docker.com)
This is the easiest way to keep your environment up to date in order
to build `pugs`.
Running the [docker-pugs.sh](tools/docker-pugs.sh) script creates the image and
runs it in interactive mode. The image will runs the user's permissions and his
home directory is mounted.
Running the [docker-pugs.sh](tools/docker-pugs.sh) script creates the
image and runs it in interactive mode. The image will runs the user's
permissions and his home directory is mounted.
**keep in mind that the produced executable will only run inside docker**
......@@ -40,21 +49,26 @@ home directory is mounted.
## Coding
### `packages` directory
Do not make **any** change in the `packages` directory. This directory contains *third party libraries* that are are mandatory to minimal builds or `pugs`.
Do not make **any** change in the `packages` directory. This directory
contains *third party libraries* that are are mandatory to minimal
builds or `pugs`.
For any changes in this directory
(bug report, suggestion of new library, library upgrades or downgrades) **open an issue**.
For any changes in this directory (bug report, suggestion of new
library, library upgrades or downgrades) **open an issue**.
### Warnings
Try to avoid publishing sources that generates compilation warnings.
Also, avoid the use of `#warning` directives and prefer opening an issue.
Also, avoid the use of `#warning` directives and prefer opening an
issue.
`C++` `[[deprecated]]` directive should also be avoid as much as possible.
`C++` `[[deprecated]]` directive should also be avoid as much as
possible.
### Comments
**Do not** comment deprecated code. It is `git`'s job to keep track of old versions.
**Do not** comment deprecated code. It is `git`'s job to keep track of
old versions.
Avoid commenting functions bodies:
......@@ -68,7 +82,10 @@ Avoid commenting functions bodies:
`clang-format` is used in `pugs`, so install it and run
> `make clang-format` before any commit
A better solution is to configure your favored editor to perform formatting automatically. For instance `emacs` users should copy-past the following code to their `.emacs.el` init file.
A better solution is to configure your favored editor to perform
formatting automatically. For instance `emacs` users should copy-past
the following code to their `.emacs.el` init file.
```lisp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clang-format
......
......@@ -18,12 +18,3 @@ add_dependencies(PugsLanguage
PugsLanguageModules
PugsLanguageUtils
PugsUtils)
# ------------------- Installation --------------------
# temporary version workaround
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
install(TARGETS PugsLanguage
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
......@@ -30,15 +30,3 @@ add_library(
MeshRandomizer.cpp
MeshTransformer.cpp
SynchronizerManager.cpp)
# Additional dependencies
#add_dependencies(PugsMesh)
# ------------------- Installation --------------------
# temporary version workaround
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
install(TARGETS PugsMesh
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
......@@ -6,12 +6,3 @@ add_library(
GnuplotWriter1D.cpp
VTKWriter.cpp
WriterBase.cpp)
# ------------------- Installation --------------------
# temporary version workaround
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
install(TARGETS PugsMesh
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
......@@ -112,12 +112,3 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pugs_config.hpp.in"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pugs_build_info.hpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/pugs_build_info.hpp"
@ONLY)
# ------------------- Installation --------------------
# temporary version workaround
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
install(TARGETS PugsUtils
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment