Commit 01995f16 authored by Marco Govoni's avatar Marco Govoni
Browse files

Added forpy to modules, updated svn to git revision number (script)

parent 3f31f364
......@@ -5,6 +5,7 @@ include ../../make.inc
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Forpy \
$(MOD_FLAG).
IFLAGS=
......@@ -14,7 +15,7 @@ west_version.o \
westcom.o
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Forpy/libforpy.a
TLDEPS= bindir mods libs pw
......@@ -22,6 +23,7 @@ all : title tldeps libmodules.a
tldeps:
test -n "$(TLDEPS)" && ( cd ../.. ; $(MAKE) $(MFLAGS) $(TLDEPS) || exit 1) || :
./update_west_version ${TOPDIR}
libmodules.a : $(MODULES_OBJS)
$(AR) $(ARFLAGS) $@ $?
......
#!/bin/sh
top_dir=$1
echo "TOPDIR = " $top_dir
# check if svn info available (do not write anything)
svn info 2> /dev/null > /dev/null
git remote -v 2> /dev/null > /dev/null
if [ $? = 0 ] ; then
# svn info available: get svn revision
svn_rev=$(svnversion -n)
git_rev=$(git describe)
else
# svn info available: revert to no info
svn_rev=unknown
git_rev=unknown
fi
echo "GITREV = " $git_rev
# write svn into file version_tmp.f90
cat west_version.f90.in | sed 's/unknown/'$svn_rev'/' > west_version.f90.tmp
cat west_version.f90.in | sed "s/unknown/$git_rev/;s&unset&$top_dir&" > west_version.f90.tmp
# check if a previous version.f90 file exists
if test -f west_version.f90 ; then
......
......@@ -12,11 +12,39 @@
MODULE west_version
!-----------------------------------------------------------------------
!
USE forpy_mod, ONLY: list
!
IMPLICIT NONE
!
SAVE
!
CHARACTER (LEN=6) :: west_version_number = '3.1.1'
CHARACTER (LEN=12) :: west_svn_revision = 'unknown'
CHARACTER (LEN=512) :: west_git_revision = 'unknown'
CHARACTER (LEN=512) :: west_forpy_path = 'unset'
TYPE(list) :: paths
!
CONTAINS
!
SUBROUTINE start_forpy()
USE forpy_mod, ONLY: forpy_initialize, get_sys_path
IMPLICIT NONE
INTEGER :: IERR
!
IERR = forpy_initialize()
IF(IERR/=0) CALL errore('forpy','Err: cannot init forpy',1)
!
IERR = get_sys_path(paths)
IF(IERR/=0) CALL errore('forpy','Err: cannot get_sys_path',1)
!
IERR = paths%append(TRIM(ADJUSTL(west_forpy_path))//"West/Tools")
IF(IERR/=0) CALL errore('forpy','Err: cannot append paths',1)
END SUBROUTINE
!
SUBROUTINE end_forpy()
USE forpy_mod, ONLY: forpy_finalize
IMPLICIT NONE
CALL paths%destroy()
CALL forpy_finalize()
END SUBROUTINE
!
END MODULE
......@@ -192,7 +192,7 @@ CONTAINS
USE json_module, ONLY : json_file
USE io_global, ONLY : stdout
USE global_version, ONLY : version_number, svn_revision
USE west_version, ONLY : west_version_number, west_svn_revision
USE west_version, ONLY : west_version_number, west_git_revision
USE mp_world, ONLY : mpime,root
USE westcom, ONLY : logfile
USE base64_module, ONLY : islittleendian
......@@ -209,9 +209,9 @@ CONTAINS
!
CALL date_and_tim( cdate, ctime )
!
IF ( TRIM (west_svn_revision) /= "unknown" ) THEN
WRITE( stdout, '(/5X,"Program ",A," v. ",A," svn rev. ",A," starts on ",A9," at ",A9)' ) &
& TRIM(code), TRIM(west_version_number), TRIM (west_svn_revision), cdate, ctime
IF ( TRIM (west_git_revision) /= "unknown" ) THEN
WRITE( stdout, '(/5X,"Program ",A," v. ",A," git rev. ",A," starts on ",A9," at ",A9)' ) &
& TRIM(code), TRIM(west_version_number), TRIM (west_git_revision), cdate, ctime
ELSE
WRITE( stdout, '(/5X,"Program ",A," v. ",A," starts on ",A9," at ",A9)' ) &
& TRIM(code), TRIM(west_version_number), cdate, ctime
......@@ -245,7 +245,7 @@ CONTAINS
CALL json%add('software.package', "WEST" )
CALL json%add('software.program', TRIM(code) )
CALL json%add('software.version', TRIM(west_version_number) )
IF( TRIM (west_svn_revision) /= "unknown" ) CALL json%add('software.westsvn', TRIM(west_svn_revision) )
IF( TRIM (west_git_revision) /= "unknown" ) CALL json%add('software.westgit', TRIM(west_git_revision) )
CALL json%add('software.website',"http://www.west-code.org")
CALL json%add('software.citation',"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015).")
CALL json%add('software.qeversion', TRIM(version_number) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment