Skip to content

Commit 0e85e29

Browse files
committed
Merge branch 'develop' into feature/macOS_M1_support
2 parents 07ee5d8 + 3d07376 commit 0e85e29

File tree

8 files changed

+30
-4
lines changed

8 files changed

+30
-4
lines changed

.github/workflows/build_and_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
UBUNTU_VERSION: [noble, jammy, focal]
30+
UBUNTU_VERSION: [noble, jammy]
3131
steps:
3232
- name: Checkout code
3333
uses: actions/checkout@v4

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build-and-push:
77
strategy:
88
matrix:
9-
ubuntu-version: [noble, jammy, focal]
9+
ubuntu-version: [noble, jammy]
1010

1111
runs-on: ubuntu-latest
1212

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## latest
44

5+
- Remove Ubuntu 20.04 from testing and Docker support https://github.com/DataAnalyticsEngineering/FANS/pull/51
6+
- Add support for `--version` command line argument for checking the version of FANS
57
- Modify way to provide micro structure in JSON input https://github.com/DataAnalyticsEngineering/FANS/pull/43
68
- Add conda package for FANS https://github.com/DataAnalyticsEngineering/FANS/pull/39
79
- Introduce system for checking compiler flags: `avx2` & `fma` https://github.com/DataAnalyticsEngineering/FANS/pull/34

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ set_property(TARGET FANS_FANS PROPERTY PUBLIC_HEADER
187187
include/material_models/J2Plasticity.h
188188
)
189189

190+
# version.h is generated and added to the build include directory
191+
configure_file(
192+
"${PROJECT_SOURCE_DIR}/include/version.h.in"
193+
"${PROJECT_BINARY_DIR}/include/version.h" @ONLY
194+
)
195+
target_include_directories(FANS_main PRIVATE "${PROJECT_BINARY_DIR}/include")
196+
190197
# ##############################################################################
191198
# SOURCES
192199
# ##############################################################################

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ FANS is also available as a conda-package on [conda-forge](https://anaconda.org/
167167
It can be installed via
168168
169169
```bash
170-
conda install fans
170+
conda install conda-forge::fans
171171
```
172172
173173
exposing the executable `FANS`.

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ We provide a set of docker images for different use cases on our [Dockerhub prof
55
- **fans-ci**: Contains the minimum tools to build FANS (including dev packages of dependencies with the required headers), but does not include FANS itself. Meant for a CI workflow.
66
- **fans-dev**: Based upon fans-ci, but offers a non-root user (`fans`) and handling of UID and GID to not mess up permissions when volume mounting into the container. Meant as an quick to setup build environment for FANS.
77

8-
Both images are built for linux/amd64 and linux/arm64 as well as for the three most recent Ubuntu LTS versions (focal, jammy, noble). The Ubuntu version can be selected through tags, e.g. `fans-dev:focal`; `noble` is equivalent to the `latest` tag. The architecture is selected automatically depending on your host platform.
8+
Both images are built for linux/amd64 and linux/arm64 as well as for the three most recent Ubuntu LTS versions (jammy and noble). The Ubuntu version can be selected through tags, e.g. `fans-dev:jammy`; `noble` is equivalent to the `latest` tag. The architecture is selected automatically depending on your host platform.
99

1010
## Set up a Container
1111

include/version.h.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef VERSION_H
2+
#define VERSION_H
3+
4+
#define PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
5+
#define PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@
6+
#define PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@
7+
#define PROJECT_VERSION "@PROJECT_VERSION@"
8+
9+
#endif // VERSION_H

src/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#include "setup.h"
44
#include "solver.h"
55

6+
// Version
7+
#include "version.h"
8+
69
template <int howmany>
710
void runSolver(Reader &reader, const char *output_file_basename)
811
{
@@ -32,6 +35,11 @@ void runSolver(Reader &reader, const char *output_file_basename)
3235

3336
int main(int argc, char *argv[])
3437
{
38+
if (argc > 1 && string(argv[1]) == "--version") {
39+
cout << "FANS version " << PROJECT_VERSION << endl;
40+
return 0;
41+
}
42+
3543
if (argc != 3) {
3644
fprintf(stderr, "USAGE: %s [input file basename] [output file basename]\n", argv[0]);
3745
return 10;

0 commit comments

Comments
 (0)