diff --git a/cmake/scripts/create_lcg_view_setup_csh.in b/cmake/scripts/create_lcg_view_setup_csh.in
index e00e060377052cae126a4d7a9c03b72aa8588256..08d11ffb66d870dac1ea805cde7aa50388155857 100644
--- a/cmake/scripts/create_lcg_view_setup_csh.in
+++ b/cmake/scripts/create_lcg_view_setup_csh.in
@@ -250,7 +250,9 @@ if ( -e $thisdir/bin/R && $?FC ) then
 endif
 
 #---then Valgrind
-if ( -e $thisdir/bin/valgrind ) then
+if ( -e $thisdir/libexec/valgrind/vgpreload_memcheck-amd64-linux.so ) then
+    setenv VALGRIND_LIB ${thisdir}/libexec/valgrind
+else if ( -e $thisdir/lib/valgrind/vgpreload_memcheck-amd64-linux.so ) then
     setenv VALGRIND_LIB ${thisdir}/lib/valgrind
 endif
 
diff --git a/cmake/scripts/create_lcg_view_setup_sh.in b/cmake/scripts/create_lcg_view_setup_sh.in
index 891772365a71ff62ae6dc8426bba2e99f01f6d53..8830514c468dd6d24c153b9c67a65b84782b6b22 100644
--- a/cmake/scripts/create_lcg_view_setup_sh.in
+++ b/cmake/scripts/create_lcg_view_setup_sh.in
@@ -227,7 +227,9 @@ if [ -x $thisdir/bin/R ] && [ -n "$FC" ]; then
 fi
 
 #---then Valgrind
-if [ -x $thisdir/bin/valgrind ]; then
+if [ -x $thisdir/libexec/valgrind/vgpreload_memcheck-amd64-linux.so ]; then
+    VALGRIND_LIB=$thisdir/libexec/valgrind; export VALGRIND_LIB
+elif [ -x $thisdir/lib/valgrind/vgpreload_memcheck-amd64-linux.so ]; then
     VALGRIND_LIB=$thisdir/lib/valgrind; export VALGRIND_LIB
 fi