From fae6c68442e742e81188058d4f6323104d71beba Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:11:50 +0100 Subject: [PATCH 1/5] Now cregex "appears" to be included (for backward compatibility) --- src/config/Config.inc.in | 6 +----- src/maketools/update-config-txt.sh | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/config/Config.inc.in b/src/config/Config.inc.in index 39ff6f0989..82e96761bc 100644 --- a/src/config/Config.inc.in +++ b/src/config/Config.inc.in @@ -154,13 +154,9 @@ bool hasDlopen() { return false; #endif } - +/// This will always return true for backward compatibility bool hasCregex() { -#ifdef __PLUMED_HAS_CREGEX return true; -#else - return false; -#endif } bool hasMolfile() { diff --git a/src/maketools/update-config-txt.sh b/src/maketools/update-config-txt.sh index 198750e188..a55a863a60 100755 --- a/src/maketools/update-config-txt.sh +++ b/src/maketools/update-config-txt.sh @@ -132,6 +132,8 @@ echo "# if option xx is on then plumed has beeen compiled with -D__PLUMED_HAS_XX echo "has $u off" fi done + #this is here for backward compatibility (since we are using c++17 that has ) + echo "has cregex on" } | sort echo echo "# other defines" From 28f719428d811a04404429a60fa715f04d8a160a Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:25:28 +0100 Subject: [PATCH 2/5] with constexpr --- src/config/Config.h | 3 ++- src/config/Config.inc.in | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/config/Config.h b/src/config/Config.h index 1604c5bab6..0db2785f26 100644 --- a/src/config/Config.h +++ b/src/config/Config.h @@ -99,7 +99,8 @@ bool hasDlopen(); bool isInstalled(); -bool hasCregex(); +/// This will always return true for backward compatibility +constexpr bool hasCregex(){return true;} bool hasMolfile(); diff --git a/src/config/Config.inc.in b/src/config/Config.inc.in index 82e96761bc..cb821b217e 100644 --- a/src/config/Config.inc.in +++ b/src/config/Config.inc.in @@ -154,10 +154,6 @@ bool hasDlopen() { return false; #endif } -/// This will always return true for backward compatibility -bool hasCregex() { - return true; -} bool hasMolfile() { #ifdef __PLUMED_HAS_MOLFILE_PLUGINS From 272e2cb88ac6a4c2141fc24742a714860b3586c8 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:34:07 +0100 Subject: [PATCH 3/5] added a test for "config has cregex" backward compatibility --- regtest/basic/rt-cregex-backward-compatibility/Makefile | 1 + regtest/basic/rt-cregex-backward-compatibility/config | 3 +++ regtest/basic/rt-cregex-backward-compatibility/out.reference | 1 + 3 files changed, 5 insertions(+) create mode 100644 regtest/basic/rt-cregex-backward-compatibility/Makefile create mode 100644 regtest/basic/rt-cregex-backward-compatibility/config create mode 100644 regtest/basic/rt-cregex-backward-compatibility/out.reference diff --git a/regtest/basic/rt-cregex-backward-compatibility/Makefile b/regtest/basic/rt-cregex-backward-compatibility/Makefile new file mode 100644 index 0000000000..3703b27cea --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/basic/rt-cregex-backward-compatibility/config b/regtest/basic/rt-cregex-backward-compatibility/config new file mode 100644 index 0000000000..6db62fcce2 --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/config @@ -0,0 +1,3 @@ +type=plumed +#this just tests that config will always return cregex as existing, for backward compatibility +arg="config has cregex" diff --git a/regtest/basic/rt-cregex-backward-compatibility/out.reference b/regtest/basic/rt-cregex-backward-compatibility/out.reference new file mode 100644 index 0000000000..092a566f04 --- /dev/null +++ b/regtest/basic/rt-cregex-backward-compatibility/out.reference @@ -0,0 +1 @@ +cregex on From cc37cedbb8076abc73b70e888db63a58fabf2f36 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:42:02 +0100 Subject: [PATCH 4/5] removing the old `plumed_needs="cregex"` from the regtest requirements --- regtest/isdb/rt-Metainference-averaging/config | 1 - regtest/isdb/rt-jcoupling-string-type/config | 1 - regtest/isdb/rt-metainference-mc-chunksize/config | 1 - regtest/isdb/rt-metainference-optisigmamean-sem-max/config | 1 - regtest/isdb/rt-metainference-optisigmamean-sem/config | 1 - regtest/isdb/rt-metainference-regres-zero/config | 1 - regtest/isdb/rt-metainferencebase-averaging/config | 1 - regtest/isdb/rt-metainferencebase-regres-zero/config | 1 - regtest/isdb/rt-metainferencebase-sem-max/config | 1 - 9 files changed, 9 deletions(-) diff --git a/regtest/isdb/rt-Metainference-averaging/config b/regtest/isdb/rt-Metainference-averaging/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-Metainference-averaging/config +++ b/regtest/isdb/rt-Metainference-averaging/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-jcoupling-string-type/config b/regtest/isdb/rt-jcoupling-string-type/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-jcoupling-string-type/config +++ b/regtest/isdb/rt-jcoupling-string-type/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-mc-chunksize/config b/regtest/isdb/rt-metainference-mc-chunksize/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-mc-chunksize/config +++ b/regtest/isdb/rt-metainference-mc-chunksize/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-optisigmamean-sem-max/config b/regtest/isdb/rt-metainference-optisigmamean-sem-max/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-optisigmamean-sem-max/config +++ b/regtest/isdb/rt-metainference-optisigmamean-sem-max/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-optisigmamean-sem/config b/regtest/isdb/rt-metainference-optisigmamean-sem/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-optisigmamean-sem/config +++ b/regtest/isdb/rt-metainference-optisigmamean-sem/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainference-regres-zero/config b/regtest/isdb/rt-metainference-regres-zero/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainference-regres-zero/config +++ b/regtest/isdb/rt-metainference-regres-zero/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainferencebase-averaging/config b/regtest/isdb/rt-metainferencebase-averaging/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainferencebase-averaging/config +++ b/regtest/isdb/rt-metainferencebase-averaging/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainferencebase-regres-zero/config b/regtest/isdb/rt-metainferencebase-regres-zero/config index dec4ec0c0d..147b050b4a 100644 --- a/regtest/isdb/rt-metainferencebase-regres-zero/config +++ b/regtest/isdb/rt-metainferencebase-regres-zero/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" diff --git a/regtest/isdb/rt-metainferencebase-sem-max/config b/regtest/isdb/rt-metainferencebase-sem-max/config index ecf9c90e84..bf6f932c83 100644 --- a/regtest/isdb/rt-metainferencebase-sem-max/config +++ b/regtest/isdb/rt-metainferencebase-sem-max/config @@ -1,4 +1,3 @@ -plumed_needs="cregex" type=driver # this is to test a different name arg="--plumed plumed.dat --trajectory-stride 2 --timestep 0.002 --mf_xtc trajectory.xtc --dump-forces atom_forces --dump-forces-fmt=%7.3f" From 06c2cbd40d9bb56687a9c7717d424cd94866ef0c Mon Sep 17 00:00:00 2001 From: Daniele Rapetti <5535617+Iximiel@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:25:26 +0100 Subject: [PATCH 5/5] run astyle --- src/config/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/Config.h b/src/config/Config.h index 0db2785f26..4f225200b9 100644 --- a/src/config/Config.h +++ b/src/config/Config.h @@ -100,7 +100,7 @@ bool hasDlopen(); bool isInstalled(); /// This will always return true for backward compatibility -constexpr bool hasCregex(){return true;} +constexpr bool hasCregex() {return true;} bool hasMolfile();