Skip to content
Snippets Groups Projects
Commit 9d18cc09 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Storing MPIEXEC in Makefile.conf and config.txt

Can be retrieved with

plumed config mpiexec
parent ed0af63c
No related branches found
No related tags found
No related merge requests found
...@@ -32,3 +32,4 @@ datarootdir=@datarootdir@ ...@@ -32,3 +32,4 @@ datarootdir=@datarootdir@
datadir=@datadir@ datadir=@datadir@
docdir=@docdir@ docdir=@docdir@
htmldir=@htmldir@ htmldir=@htmldir@
mpiexec=@MPIEXEC@
...@@ -651,6 +651,7 @@ CPPFLAGS ...@@ -651,6 +651,7 @@ CPPFLAGS
LDFLAGS LDFLAGS
CXXFLAGS CXXFLAGS
CXX CXX
MPIEXEC
LDSHARED LDSHARED
STATIC_LIBS STATIC_LIBS
SOEXT SOEXT
...@@ -735,6 +736,7 @@ target_alias ...@@ -735,6 +736,7 @@ target_alias
SOEXT SOEXT
STATIC_LIBS STATIC_LIBS
LDSHARED LDSHARED
MPIEXEC
CXX CXX
CXXFLAGS CXXFLAGS
LDFLAGS LDFLAGS
...@@ -1409,6 +1411,9 @@ Some influential environment variables: ...@@ -1409,6 +1411,9 @@ Some influential environment variables:
configure will add here -ldl if necessary configure will add here -ldl if necessary
LDSHARED command for linking shared library - configure will use CXX plus LDSHARED command for linking shared library - configure will use CXX plus
the proper flags the proper flags
MPIEXEC command to run mpi programs in tests - default not specified,
which means use PLUMED_MPIRUN env var at runtime for backward
compatibility
CXX C++ compiler command CXX C++ compiler command
CXXFLAGS C++ compiler flags CXXFLAGS C++ compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
...@@ -3009,6 +3014,7 @@ fi ...@@ -3009,6 +3014,7 @@ fi
# by default use -O flag # by default use -O flag
# we override the autoconf default (-g) because in release build we do not want to # we override the autoconf default (-g) because in release build we do not want to
# include symbol information (obj files are huge) # include symbol information (obj files are huge)
...@@ -8365,6 +8371,8 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h ...@@ -8365,6 +8371,8 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
# these are libraries that should be linked also to MD engines # these are libraries that should be linked also to MD engines
if test "$shared" == true ; then if test "$shared" == true ; then
case `(uname)` in case `(uname)` in
(Darwin) (Darwin)
...@@ -8755,6 +8763,16 @@ fi ...@@ -8755,6 +8763,16 @@ fi
fi fi
if test $mpi_found == ok ; then
if test -n "$MPIEXEC" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Regtest suite will use $MPIEXEC command to run MPI tests" >&5
$as_echo "$as_me: Regtest suite will use $MPIEXEC command to run MPI tests" >&6;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Regtest suite will use env var PLUMED_MPIRUN to run MPI tests (default: mpirun)" >&5
$as_echo "$as_me: Regtest suite will use env var PLUMED_MPIRUN to run MPI tests (default: mpirun)" >&6;}
fi
fi
#### This further tests are required to allow linking with non c++ compiler #### This further tests are required to allow linking with non c++ compiler
{ $as_echo "$as_me:${as_lineno-$LINENO}: PLUMED seems to be configured properly!" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: PLUMED seems to be configured properly!" >&5
$as_echo "$as_me: PLUMED seems to be configured properly!" >&6;} $as_echo "$as_me: PLUMED seems to be configured properly!" >&6;}
......
...@@ -260,6 +260,7 @@ PLUMED_CONFIG_ENABLE([fftw],[search for fftw],[no]) ...@@ -260,6 +260,7 @@ PLUMED_CONFIG_ENABLE([fftw],[search for fftw],[no])
AC_ARG_VAR(SOEXT,[extension of dynamic libraries (so/dylib)]) AC_ARG_VAR(SOEXT,[extension of dynamic libraries (so/dylib)])
AC_ARG_VAR(STATIC_LIBS,[variables that should be linked statically directly to MD code - configure will add here -ldl if necessary ]) AC_ARG_VAR(STATIC_LIBS,[variables that should be linked statically directly to MD code - configure will add here -ldl if necessary ])
AC_ARG_VAR(LDSHARED,[command for linking shared library - configure will use CXX plus the proper flags ]) AC_ARG_VAR(LDSHARED,[command for linking shared library - configure will use CXX plus the proper flags ])
AC_ARG_VAR(MPIEXEC,[command to run mpi programs in tests - default not specified, which means use PLUMED_MPIRUN env var at runtime for backward compatibility])
# by default use -O flag # by default use -O flag
...@@ -673,6 +674,8 @@ AC_SUBST(LDSHARED) ...@@ -673,6 +674,8 @@ AC_SUBST(LDSHARED)
# these are libraries that should be linked also to MD engines # these are libraries that should be linked also to MD engines
AC_SUBST(STATIC_LIBS) AC_SUBST(STATIC_LIBS)
AC_SUBST(MPIEXEC)
if test "$shared" == true ; then if test "$shared" == true ; then
case `(uname)` in case `(uname)` in
(Darwin) (Darwin)
...@@ -839,6 +842,14 @@ int main(int argc,char*argv[[]]){ ...@@ -839,6 +842,14 @@ int main(int argc,char*argv[[]]){
) )
fi fi
if test $mpi_found == ok ; then
if test -n "$MPIEXEC" ; then
AC_MSG_NOTICE([Regtest suite will use $MPIEXEC command to run MPI tests])
else
AC_MSG_NOTICE([Regtest suite will use env var PLUMED_MPIRUN to run MPI tests (default: mpirun)])
fi
fi
#### This further tests are required to allow linking with non c++ compiler #### This further tests are required to allow linking with non c++ compiler
AC_MSG_NOTICE([PLUMED seems to be configured properly!]) AC_MSG_NOTICE([PLUMED seems to be configured properly!])
AC_MSG_NOTICE([**************************]) AC_MSG_NOTICE([**************************])
......
...@@ -50,6 +50,7 @@ do ...@@ -50,6 +50,7 @@ do
;; ;;
(has) action=has ;; (has) action=has ;;
(module) action=module ;; (module) action=module ;;
(mpiexec) action=mpiexec ;;
(makefile_conf) (makefile_conf)
echo "$configfile" | awk '{if($1=="makefile_conf") { gsub("^makefile_conf ",""); print} }' echo "$configfile" | awk '{if($1=="makefile_conf") { gsub("^makefile_conf ",""); print} }'
exit 0 exit 0
...@@ -95,5 +96,15 @@ case $action in ...@@ -95,5 +96,15 @@ case $action in
git=$(echo "$configfile" | grep -v \# | awk '{ if($1=="version" && $2=="git") print $3 }') git=$(echo "$configfile" | grep -v \# | awk '{ if($1=="version" && $2=="git") print $3 }')
echo "Version: $long (git: $git)" echo "Version: $long (git: $git)"
;; ;;
(mpiexec)
mpi=$(echo "$configfile" | grep -v \# | awk '{ if($1=="mpiexec") print $2 }')
if test -n "$mpi" ; then
retval=0
test "$quiet" = no && echo "$mpi"
else
retval=1
test "$quiet" = no && echo "mpiexec not found"
fi
exit $retval
esac esac
...@@ -23,7 +23,9 @@ obj: all ...@@ -23,7 +23,9 @@ obj: all
config.txt: ../../Makefile.conf config.txt: ../../Makefile.conf
@echo "Updating config.txt file" @echo "Updating config.txt file"
@makefile_conf="$(realpath ../../Makefile.conf)" ../maketools/update-config-txt.sh config.txt $(CPPFLAGS) @makefile_conf="$(realpath ../../Makefile.conf)" \
mpiexec="$(mpiexec)" \
../maketools/update-config-txt.sh config.txt $(CPPFLAGS)
version.h: version.h:
@echo "Updating version.h" @echo "Updating version.h"
......
...@@ -101,6 +101,8 @@ echo "# version strings" ...@@ -101,6 +101,8 @@ echo "# version strings"
echo "# syntax: version short/long/git number" echo "# syntax: version short/long/git number"
echo "$version" echo "$version"
echo echo
echo "mpiexec $mpiexec"
echo
echo "# list of 'has' options" echo "# list of 'has' options"
echo "# syntax: has name on/of" echo "# syntax: has name on/of"
echo "# if option xx is on then plumed has beeen compiled with -D__PLUMED_HAS_XX" echo "# if option xx is on then plumed has beeen compiled with -D__PLUMED_HAS_XX"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment