Skip to content

Commit 58f3172

Browse files
committed
Merge branch 'develop' of gitlab.euclid-sgs.uk:ST-TOOLS/Elements into develop
2 parents 0c7a257 + 7ef6bf1 commit 58f3172

48 files changed

Lines changed: 400 additions & 571 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.clang-format-ignore‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Ignore SWIG interfaces files
2-
./ElementsExamples/ElementsExamples/NumPyExample.i
3-
./ElementsExamples/ElementsExamples/SwigExample.i
2+
./**/*.i

‎.github/workflows/dependencies.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
$NUMPY
22
$PYTHON-devel
3+
$PYTHON-setuptools
34
$PYTHON-numpy
45
$PYTHON-pytest
56
$PYTHON-sphinx
7+
$PYTHON-lxml
68
CCfits-devel
79
$BOOST-$PYTHON-devel
810
$BOOST-devel
911
doxygen
1012
graphviz
1113
log4cpp-devel
1214
which
15+
git-core

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: check-added-large-files
1212
- id: check-merge-conflict
1313
- repo: https://github.com/pre-commit/mirrors-clang-format
14-
rev: v18.1.3
14+
rev: v18.1.5
1515
hooks:
1616
- id: clang-format
1717
exclude_types: [javascript]

‎CHANGELOG.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [6.3.1] - 2024-05-22
12+
This release essentially fixes problems met on the MacOS platform
13+
14+
### Fixed
15+
- Fix the include for the `boost::filesystem`
16+
- Revert from find_file to find_program for executables, in CMake. This former is apparently
17+
not supported on the conda builds
18+
- Fix the include for the HOST_NAME_MAX constant. Use unistd.h.
19+
- Readd the sstream include for `std::basic_ostringstream`
20+
21+
22+
## [6.3.0] - 2024-04-23
23+
24+
### Added
25+
- Add an option to configure the auxiliary files.
26+
- They were just installed in the past and now they are interpolated in the build directory and then installed.
27+
- Add a `<PROJECT>_PROJECT_VERSION` CMake cache variable
28+
- The `elements_install_aux_files` gets a `WITH_CONFIGURE` option to enable the configure phase
29+
- Add the support for `include-what-you-use` (IWYU, https://github.com/include-what-you-use/include-what-you-use)
30+
- A new `iwyu` gmake target has been added
31+
- Alernatively, the IWYU can also be run at compile time by using the `-DUSE_IWYU=ON` CMake option
32+
- Add a CMake option to print the test command lines
33+
- the option name is PRINT_TEST_COMMANDS
34+
- it is set to OFF by default
35+
- Implement the indirection for the DataSync workspace location
36+
- the name of the variable pointing to the name of the variable containing the location is DATASYNC_WORKDIR_VAR (e.g. export DATASYNC_WORKDIR_VAR=MY_WORKSPACE).
37+
- By default, if DATASYNC_WORKDIR_VAR is not set or is empty, the content the WORKSPACE (the default name) variable is used for the workspace location.
38+
- Add the .clang-format-ignore file to ignore the SWIG interface files recursively
39+
- add this file also in the createProject script
40+
- Add sphinx-programoutput to default [[sphinx]] extensions
41+
- Add the `-fno-omit-frame-pointer` compiler option for all non-optimized builds
42+
43+
### Changed
44+
- Improve the creation of the source tarball
45+
- Added the `--exclude-vcs-ignores` to the Tar command
46+
- Update the Doxyfile template for Doxygen 1.9.6
47+
48+
### Fixed
49+
- Fix the target of the elements_add_python_program CMake function
50+
- it is now `{elements_module}_{executable}`. Instead of the original
51+
python module name with the "." replaced by "_"
52+
- it allows to generate several executable with the same python module
53+
and different option (like NO_CONFIG_FILE)
54+
```cmake
55+
elements_add_python_program(PythonProgramExample ElementsExamples.PythonProgramExample)
56+
elements_add_python_program(PythonProgramExampleNoConfigFile ElementsExamples.PythonProgramExample NO_CONFIG_FILE)
57+
```
58+
- Prevent the addition of the `--config-file` option to the generated C++ executable
59+
- It was already done for python by passing a NO_CONFIG_FILE CMake option to the elements_add_python_program function
60+
- For C++, a `-DNO_CONFIG_FILE` compile option seems to be the best candidate
61+
- Fix a lot of warnings when the `-Wno-dev` CMake option is not passed
62+
- Fix the the recursive globbing of python files in Elements
63+
- It was also picking up the `__pycache__` directory and the CMake glob cross-check was failing
64+
- Fix the compilation against the Gnuastro library
65+
- Its behavior has changed and it requires an extra arg in the examples
66+
- use CMake to test the compilation
67+
- Fix lcov execution for lcov 2.0
68+
1169
1270
## [6.2.4] - 2024-02-12
1371

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ find_package(ElementsProject)
1616
include(ElementsDefaults)
1717

1818
# Declare project name and version
19-
elements_project(Elements 6.3 DESCRIPTION "A C++ base framework for the Euclid Software.")
19+
elements_project(Elements 6.4 DESCRIPTION "A C++ base framework for the Euclid Software.")
2020

2121
# This test does not really fit in a subdirectory.
2222

‎ElementsExamples/CMakeLists.txt‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ find_package(Boost REQUIRED COMPONENTS unit_test_framework)
1515
find_package(CppUnit)
1616
find_package(GMock)
1717

18-
cmake_policy(PUSH)
19-
if(POLICY CMP0148)
20-
cmake_policy(SET CMP0148 OLD)
21-
endif()
22-
find_package(PythonLibs ${PYTHON_EXPLICIT_VERSION})
23-
cmake_policy(POP)
24-
18+
find_package(Python ${PYTHON_EXPLICIT_VERSION} COMPONENTS Interpreter Development NumPy)
2519

2620
#===== Libraries ===============================================================
2721
# Instruction for creating a C++ library
@@ -53,6 +47,10 @@ elements_add_executable(CppProgramExampleNoConfigFile src/program/Program.cpp
5347
LINK_LIBRARIES ElementsExamples ElementsOther
5448
NO_CONFIG_FILE)
5549

50+
elements_add_executable(CppProgramExampleNoDefaultConf src/program/Program.cpp
51+
INCLUDE_DIRS ElementsExamples ElementsOther
52+
LINK_LIBRARIES ElementsExamples ElementsOther
53+
NO_DEFAULT_CONF)
5654

5755
elements_add_executable(CppExtProgramExample src/program/ExtProgram.cpp
5856
INCLUDE_DIRS ElementsExamples ElementsOther
@@ -79,7 +77,8 @@ elements_add_executable(CProgramExample src/CProgram/*.c
7977
#===== Test that the executables do run ========================================
8078

8179
elements_add_test(CppProgramExampleRun COMMAND CppProgramExample)
82-
elements_add_test(CppProgramExampleNoConfigFileRun COMMAND CppProgramExample --config-file=toto.conf FAILS)
80+
elements_add_test(CppProgramExampleNoConfigFileRun COMMAND CppProgramExampleNoConfigFile --config-file=toto.conf FAILS)
81+
elements_add_test(CppProgramExampleNoDefaultConfRun COMMAND CppProgramExampleNoDefaultConf)
8382
elements_add_test(CppProgramExampleWrongArgument COMMAND CppProgramExample --toto FAILS)
8483
elements_add_test(CppProgramExampleWrongLevel COMMAND CppProgramExample --log-level dddsc FAILS)
8584
elements_add_test(CProgramExampleRun COMMAND CProgramExample)
@@ -303,23 +302,22 @@ elements_add_test(OpenMPWorks COMMAND OpenMPExample LABELS OpenMP Build)
303302

304303

305304
find_package(SWIG QUIET)
306-
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
305+
if(SWIG_FOUND AND Python_Development_FOUND)
307306
elements_add_swig_binding(SwigExample ElementsExamples/SwigExample.i
308307
LINK_LIBRARIES ElementsExamples
309308
INCLUDE_DIRS ElementsExamples
310309
PUBLIC_HEADERS ElementsExamples)
311310

312-
find_package(NumPy)
313-
if(NUMPY_FOUND)
311+
if(Python_NumPy_FOUND)
312+
314313
elements_add_swig_binding(NumPyExample ElementsExamples/NumPyExample.i
315-
INCLUDE_DIRS NumPy
316314
NO_PUBLIC_HEADERS)
317315
endif()
318316

319317
endif()
320318

321319
find_package(Cython QUIET)
322-
if(CYTHON_FOUND AND PYTHONLIBS_FOUND)
320+
if(CYTHON_FOUND AND Python_Development_FOUND)
323321
elements_add_cython_module(src/Cython/lib/PiCalculator.pyx
324322
LINK_LIBRARIES ElementsExamples
325323
INCLUDE_DIRS ElementsExamples
@@ -331,7 +329,7 @@ elements_add_cython_module(src/Cython/lib/Rect.pyx
331329
endif()
332330

333331
find_package(pybind11)
334-
if(pybind11_FOUND AND PYTHONLIBS_FOUND)
332+
if(pybind11_FOUND AND Python_Development_FOUND)
335333
elements_add_pybind11_module(testCallBack src/pybind11/callback.cpp
336334
INCLUDE_DIRS ElementsExamples
337335
LINK_LIBRARIES ElementsExamples)
@@ -347,15 +345,17 @@ elements_install_python_modules(TEST_TIMEOUT 60)
347345
# ElementsExamples.PythonProgramExample is the source file
348346
elements_add_python_program(PythonProgramExample ElementsExamples.PythonProgramExample)
349347
elements_add_python_program(PythonProgramExampleNoConfigFile ElementsExamples.PythonProgramExample NO_CONFIG_FILE)
350-
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
348+
elements_add_python_program(PythonProgramExampleNoDefaultConf ElementsExamples.PythonProgramExample NO_DEFAULT_CONF)
349+
if(SWIG_FOUND AND Python_Development_FOUND)
351350
elements_add_python_program(SwigProgramExample ElementsExamples.SwigProgramExample)
352351
endif()
353352

354353

355354
#===== Test that the python program does run ========================================
356355
elements_add_test(PythonProgramExampleRun COMMAND PythonProgramExample)
357-
elements_add_test(PythonProgramExampleNoConfigFileRun COMMAND PythonProgramExample --config-file=toto.conf FAILS)
358-
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
356+
elements_add_test(PythonProgramExampleNoConfigFileRun COMMAND PythonProgramExampleNoConfigFile --config-file=toto.conf FAILS)
357+
elements_add_test(PythonProgramExampleNoDefaultConfRun COMMAND PythonProgramExampleNoDefaultConf)
358+
if(SWIG_FOUND AND Python_Development_FOUND)
359359
elements_add_test(SwigProgramExampleRun COMMAND SwigProgramExample LABELS Swig Build)
360360
endif()
361361

‎ElementsExamples/src/program/SimpleProgram.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "ElementsKernel/Sleep.h" // for nanoSleep
2929
#include "ElementsKernel/Unused.h" // for ELEMENTS_UNUSED
3030

31+
#include "ElementsExamples/TemplateFunction.h" // for templateFunction
32+
3133
using std::map;
3234
using std::string;
3335

@@ -67,6 +69,9 @@ class SimpleProgram : public Program {
6769

6870
std::cout << "This Works too!" << std::endl;
6971

72+
templateFunction<int>();
73+
templateFunction<double>();
74+
7075
return ExitCode::OK;
7176
}
7277
};

‎ElementsKernel/CMakeLists.txt‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,17 @@ elements_add_test(MissingElementsProjectVersion
253253
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
254254
elements_add_test(SqueezedInstall COMMAND squeezedInstall_test
255255
ENVIRONMENT ELEMENTS_SOURCE_DIR=${CMAKE_SOURCE_DIR}
256-
LABELS Creation Meta)
256+
LABELS Creation Meta Squeezed)
257+
258+
find_package(Ninja)
259+
if(NINJA_FOUND)
260+
elements_add_test(SqueezedInstallWithNinja COMMAND squeezedInstall_test
261+
ENVIRONMENT ELEMENTS_SOURCE_DIR=${CMAKE_SOURCE_DIR} CMAKE_GENERATOR=Ninja
262+
LABELS Creation Meta Ninja Squeezed)
263+
endif()
264+
265+
elements_add_test(CMakeIncludeGuards COMMAND squeezedInstall_test
266+
ENVIRONMENT ELEMENTS_SOURCE_DIR=${CMAKE_SOURCE_DIR} TESTCMAKEFLAGS=-DUSE_DEBUG_PRINT=ON
267+
LABELS Creation Meta Squeezed)
268+
257269
endif()

‎ElementsKernel/ElementsKernel/Main.h‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@
4141
#define ELEMENTS_DEFAULT_LOGLEVEL DEBUG
4242
#endif
4343

44+
#ifdef NO_CONFIG_FILE
45+
#define HAS_NO_CONFIG_FILE true
46+
#else
47+
#define HAS_NO_CONFIG_FILE false
48+
#endif
49+
50+
#ifdef NO_DEFAULT_CONF
51+
#define HAS_NO_DEFAULT_CONF true
52+
#else
53+
#define HAS_NO_DEFAULT_CONF false
54+
#endif
55+
4456
/**
4557
* @def CREATE_MANAGER_WITH_ARGS(ELEMENTS_PROGRAM, MANAGER)
4658
* Macro that declares a program manager with custom constructor arguments. It is
@@ -49,22 +61,13 @@
4961
* the class Elements::Program class.
5062
* @param MANAGER name of the manager variable to be created.
5163
*/
52-
#ifndef NO_CONFIG_FILE
53-
#define CREATE_MANAGER_WITH_ARGS(MANAGER, ELEMENTS_PROGRAM, ...) \
54-
Elements::ProgramManager MANAGER { \
55-
std::unique_ptr<Elements::Program>{new ELEMENTS_PROGRAM{__VA_ARGS__}}, Elements::Project::versionString(), \
56-
Elements::Project::name(), Elements::Project::vcsVersion(), Elements::Module::versionString(), \
57-
Elements::Module::name(), Elements::Project::searchDirectories(), log4cpp::Priority::ELEMENTS_DEFAULT_LOGLEVEL \
58-
}
59-
#else
6064
#define CREATE_MANAGER_WITH_ARGS(MANAGER, ELEMENTS_PROGRAM, ...) \
6165
Elements::ProgramManager MANAGER { \
6266
std::unique_ptr<Elements::Program>{new ELEMENTS_PROGRAM{__VA_ARGS__}}, Elements::Project::versionString(), \
6367
Elements::Project::name(), Elements::Project::vcsVersion(), Elements::Module::versionString(), \
6468
Elements::Module::name(), Elements::Project::searchDirectories(), \
65-
log4cpp::Priority::ELEMENTS_DEFAULT_LOGLEVEL, true \
69+
log4cpp::Priority::ELEMENTS_DEFAULT_LOGLEVEL, HAS_NO_CONFIG_FILE, HAS_NO_DEFAULT_CONF \
6670
}
67-
#endif
6871

6972
/**
7073
* @def CREATE_MANAGER(ELEMENTS_PROGRAM_NAME, MANAGER)

‎ElementsKernel/ElementsKernel/ProgramManager.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ELEMENTS_API ProgramManager {
6969
const std::string& parent_module_version = "", const std::string& parent_module_name = "",
7070
const std::vector<std::string>& search_dirs = {},
7171
const log4cpp::Priority::Value& elements_loglevel = log4cpp::Priority::DEBUG,
72-
bool no_config_file = false);
72+
bool no_config_file = false, bool no_default_conf = false);
7373

7474
/**
7575
* @brief Destructor
@@ -281,6 +281,11 @@ class ELEMENTS_API ProgramManager {
281281
* prevent the --config-file option to be added
282282
*/
283283
bool m_no_config_file;
284+
285+
/**
286+
* prevent the location of default configuration files
287+
*/
288+
bool m_no_default_conf;
284289
};
285290

286291
} // namespace Elements

0 commit comments

Comments
 (0)