diff --git a/.travis.yml b/.travis.yml index 20ee9d858b1e1241a9d9aee732d6083fde40fea9..eb1c7c288e59e35d7e90d0fa1dbda2d698371c97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -176,9 +176,9 @@ script: # this is done only if PLUMED_CXX is defined - if test "$PLUMED_CXX" ; then ccache -s ; - ./configure CXX="ccache $(which $PLUMED_CXX)" CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $CONFIG_FLAGS ; + ./configure CXX="ccache $(which $PLUMED_CXX)" CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $CONFIG_FLAGS --prefix="$HOME/opt" ; make -j 4 ; - make install prefix="$HOME/opt" ; + make install ; ccache -s ; fi diff --git a/CHANGES/v2.5.md b/CHANGES/v2.5.md index 109bbfd188737639e7d5c563956285031792ee54..af6576b1ac8c3b432980ad243f735954e0a9380d 100644 --- a/CHANGES/v2.5.md +++ b/CHANGES/v2.5.md @@ -49,4 +49,5 @@ Changes from version 2.4 which are relevant for developers: it should not be needed. - Coverage scan is not anymore contained in developer manual. It can be found in a separate repository `github.com/coverage-branch` (see \issue{348}). +- It is not possible anymore to use `make install prefix=/path`. Prefix can only be changed during `./configure` (see \issue{332}). diff --git a/Makefile.conf.in b/Makefile.conf.in index 43fffaee04a4cfbf632188c70210b716178c4faa..93e2e5511656da22c8dad5485164bdf5bdd39065 100644 --- a/Makefile.conf.in +++ b/Makefile.conf.in @@ -15,6 +15,9 @@ LDSHARED=@LDSHARED@ GCCDEP=@CXX@ disable_dependency_tracking=@disable_dependency_tracking@ prefix=@prefix@ +# use this variable to double check that prefix is not changed after configure +# (new in v2.5) +prefix_double_check=@prefix@ program_name=@program_name@ program_transform_name=@program_transform_name@ program_can_run_mpi=@program_can_run_mpi@ diff --git a/configure b/configure index 60db89bf8f0042414c53f5f16189f727569423f3..bf8b34efd90650a1f6dba5c807238bdc637ce667 100755 --- a/configure +++ b/configure @@ -9014,10 +9014,10 @@ $as_echo "$as_me: **** docdir: ${datarootdir}/doc/$program_name" >&6;} $as_echo "$as_me: **** htmldir: $htmldir" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: **** Executable will be named $program_name" >&5 $as_echo "$as_me: **** Executable will be named $program_name" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: **** You can change paths later using options to \"make install\"" >&5 -$as_echo "$as_me: **** You can change paths later using options to \"make install\"" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: **** e.g. with \"make install prefix=/path\"" >&5 -$as_echo "$as_me: **** e.g. with \"make install prefix=/path\"" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: **** As of PLUMED 2.5, you cannot change paths anymore during \"make install\"" >&5 +$as_echo "$as_me: **** As of PLUMED 2.5, you cannot change paths anymore during \"make install\"" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: **** Please configure and make clean to change the prefix" >&5 +$as_echo "$as_me: **** Please configure and make clean to change the prefix" >&6;} if test $mpi == true; then if test $mpi_found == ok; then diff --git a/configure.ac b/configure.ac index 81b794cdd08199de82e005231a1939a577fc6440..fcfa917bb31880d4b4a13fbcc27c19fba5376f57 100644 --- a/configure.ac +++ b/configure.ac @@ -1133,8 +1133,8 @@ AC_MSG_NOTICE([**** datadir: $datadir]) AC_MSG_NOTICE([**** docdir: ${datarootdir}/doc/$program_name]) AC_MSG_NOTICE([**** htmldir: $htmldir]) AC_MSG_NOTICE([**** Executable will be named $program_name]) -AC_MSG_NOTICE([**** You can change paths later using options to "make install"]) -AC_MSG_NOTICE([**** e.g. with "make install prefix=/path"]) +AC_MSG_NOTICE([**** As of PLUMED 2.5, you cannot change paths anymore during "make install"]) +AC_MSG_NOTICE([**** Please configure and make clean to change the prefix]) if test $mpi == true; then if test $mpi_found == ok; then diff --git a/src/lib/Makefile b/src/lib/Makefile index 022e0b5b90b5a83d46c1d535cf6bd76810a67429..993ea2216dfbb25e3944e93781c3367e4e50246f 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -179,11 +179,9 @@ install: ifdef PLUMED_PREFIX @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @echo "WARNING: using PLUMED_PREFIX variable is not allowed anymore" - @echo " please use one of the following choices:" - @echo " (1) at configure time:" - @echo " ./configure --prefix=$(PLUMED_PREFIX)" - @echo " (2) or later, at install time:" - @echo " make install prefix=$(PLUMED_PREFIX)" + @echo " please use the following option at configure time" + @echo " ./configure --prefix='$(PLUMED_PREFIX)'" + @echo " there is no way to change the suffix at install time" @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" endif ifdef PLUMED_LIBSUFFIX @@ -208,6 +206,9 @@ ifndef includedir endif ifndef htmldir $(error "it seems Makefile.conf does not define htmldir - please configure again!") +endif +ifneq ($(prefix),$(prefix_double_check)) + $(error "with PLUMED 2.5 you cannot change anymore prefix during make install - please configure again!") endif cd ../config ; $(MAKE) # in principle we should uninstall before install diff --git a/user-doc/Installation.md b/user-doc/Installation.md index 8da57108aa1859cfa8cf153e2cf96abf87898fe9..6eaed2d8f7ba59dfb2b428830afecc672206af0d 100644 --- a/user-doc/Installation.md +++ b/user-doc/Installation.md @@ -414,22 +414,14 @@ This is done using This will allow you to remove the original compilation directory, or to recompile a different PLUMED version in the same place. -To install PLUMED one should first decide the location. -The standard way to do it is during the configure step: +To install PLUMED one should first decide the location: \verbatim > ./configure --prefix=$HOME/opt > make > make install \endverbatim -However, you can also change it after compilation setting -the variable `prefix`. -\verbatim -> ./configure -> make -> make install prefix=$HOME/opt -\endverbatim -If you didn't specify the `--prefix` option during configure, and you did not set the `prefix` -variable when installing, PLUMED will be installed in /usr/local. +As of PLUMED 2.5 you cannot anymore change the location during install. +If you didn't specify the `--prefix` option during configure PLUMED will be installed in /usr/local. The install command should be executed with root permissions (e.g. "sudo make install") if you want to install PLUMED on a system directory.