Skip to content

Commit 511d673

Browse files
ares201005nicolasbock
authored andcommitted
Print progress and bml version numbers
1 parent 41fb378 commit 511d673

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ else()
3030
add_definitions(-DGLOBAL_DEBUG=PROGRESS_LOG_INFO)
3131
endif()
3232

33+
set(PROGRESS_VERSION "${PROJECT_VERSION}")
34+
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
35+
add_definitions(-DPROGRESS_VERSION=${PROGRESS_VERSION})
36+
message(STATUS "Setting PROGRESS_VERSION to '${PROGRESS_VERSION}'")
37+
3338
set(GNU_C_FLAGS_DEBUG -O0 -g -Wall -Wimplicit -Wno-unknown-pragmas --coverage
3439
-save-temps -std=c99)
3540
set(GNU_C_FLAGS_RELEASE -O3 -g -std=c99)

src/prg_progress_mod.F90

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
!
44
!
55

6+
#ifdef __GFORTRAN__
7+
# define STRINGIFY_START(X) "&
8+
# define STRINGIFY_END(X) &X"
9+
#else /* default stringification */
10+
# define STRINGIFY_(X) #X
11+
# define STRINGIFY_START(X) &
12+
# define STRINGIFY_END(X) STRINGIFY_(X)
13+
#endif
14+
615
module prg_progress_mod
716

817
use bml
@@ -15,11 +24,24 @@ module prg_progress_mod
1524

1625
integer, parameter :: dp = kind(1.0d0)
1726

27+
public :: prg_version
1828
public :: prg_progress_init
1929
public :: prg_progress_shutdown
2030

2131
contains
2232

33+
!> Print PROGRESS and BML versions
34+
subroutine prg_version()
35+
character (len=:), allocatable :: astring
36+
astring = STRINGIFY_START(PROGRESS_VERSION)
37+
STRINGIFY_END(PROGRESS_VERSION)
38+
write(6,*) 'QMD-PROGRESS and BML are used!'
39+
write(6,*) 'QMD-PROGRESS VERSION: ', astring
40+
call bml_print_version()
41+
write(6,*)
42+
43+
end subroutine prg_version
44+
2345
!> Initialize progress.
2446
subroutine prg_progress_init()
2547

0 commit comments

Comments
 (0)