Skip to content

Commit

Permalink
Print progress and bml version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
ares201005 authored and nicolasbock committed Mar 6, 2023
1 parent 41fb378 commit 511d673
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ else()
add_definitions(-DGLOBAL_DEBUG=PROGRESS_LOG_INFO)
endif()

set(PROGRESS_VERSION "${PROJECT_VERSION}")
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
add_definitions(-DPROGRESS_VERSION=${PROGRESS_VERSION})
message(STATUS "Setting PROGRESS_VERSION to '${PROGRESS_VERSION}'")

set(GNU_C_FLAGS_DEBUG -O0 -g -Wall -Wimplicit -Wno-unknown-pragmas --coverage
-save-temps -std=c99)
set(GNU_C_FLAGS_RELEASE -O3 -g -std=c99)
Expand Down
22 changes: 22 additions & 0 deletions src/prg_progress_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
!
!

#ifdef __GFORTRAN__
# define STRINGIFY_START(X) "&
# define STRINGIFY_END(X) &X"
#else /* default stringification */
# define STRINGIFY_(X) #X
# define STRINGIFY_START(X) &
# define STRINGIFY_END(X) STRINGIFY_(X)
#endif

module prg_progress_mod

use bml
Expand All @@ -15,11 +24,24 @@ module prg_progress_mod

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

public :: prg_version
public :: prg_progress_init
public :: prg_progress_shutdown

contains

!> Print PROGRESS and BML versions
subroutine prg_version()
character (len=:), allocatable :: astring
astring = STRINGIFY_START(PROGRESS_VERSION)
STRINGIFY_END(PROGRESS_VERSION)
write(6,*) 'QMD-PROGRESS and BML are used!'
write(6,*) 'QMD-PROGRESS VERSION: ', astring
call bml_print_version()
write(6,*)

end subroutine prg_version

!> Initialize progress.
subroutine prg_progress_init()

Expand Down

0 comments on commit 511d673

Please sign in to comment.