Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Aug 2, 2024
2 parents a53d896 + c0005ef commit 07cf82c
Show file tree
Hide file tree
Showing 12 changed files with 495 additions and 35 deletions.
4 changes: 0 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ SILENCE_SHELL_DEBUGGING := @SILENCE_SHELL_DEBUGGING@
SYS_LD_LIB_PATH := @SYS_LD_LIB_PATH@
SYS_LD_PRELOAD := @SYS_LD_PRELOAD@
CASE_INDEPENDENT_SORTING := @CASE_INDEPENDENT_SORTING@
ORIG_ZSH_VERSION := @ORIG_ZSH_VERSION@
ZSH_SITE_FUNCTIONS_DIRS := @ZSH_SITE_FUNCTIONS_DIRS@
ZSH_FPATH := @ZSH_FPATH@
SPIDER_CACHE_DESCRIPT_FN := @SPIDER_CACHE_DESCRIPT_FN@
ANCIENT := @ANCIENT@
ALLOW_TCL_MFILES := @ALLOW_TCL_MFILES@
Expand Down Expand Up @@ -315,8 +313,6 @@ __installMe:
-e 's|@redirect@|$(REDIRECT)|g' \
-e 's|@basename@|$(BASENAME)|g' \
-e 's|@support_ksh@|$(SUPPORT_KSH)|g' \
-e 's|@zsh_fpath@|$(ZSH_FPATH)|g' \
-e 's|@orig_zsh_version@|$(ORIG_ZSH_VERSION)|g' \
-e 's|@cached_loads@|$(CACHED_LOADS)|g' \
-e 's|@avail_extensions@|$(LMOD_AVAIL_EXTENSIONS)|g' \
-e 's|@ps@|$(PS)|g' \
Expand Down
4 changes: 4 additions & 0 deletions README.new
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,7 @@ Lmod 8.7+
* Issue #714: Adding "=encoding UTF-8" to pod generation
(8.7.46) * Issue #716: Must only add KSH_SUPPORT to zsh when both $orig_zsh_version and $zsh_fpath have non-null values
(8.7.47) * Issue #716: Use correct shell foo
W.I.P:
(8.7.48) * Issue #717: Keep previous varT when restoring a collection. Otherwise the previous modules env vars.
are lost and therefore not purged.
* Issue #718: use __build_FPATH_for_zsh_ksh to build FPATH for both shells
41 changes: 33 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,8 @@ FOLLOW_READLINK ()
echo $myprog
}
ERR_MSG=""
FOUND_ERROR=
Expand Down Expand Up @@ -4385,7 +4387,8 @@ if test ${with_lua+y}
then :
withval=$with_lua; PATH_TO_LUA="$withval"
if test ${PATH_TO_LUA:0:1} != '/' ; then
echo "Path to lua must be absolute"
echo
echo "ERROR: Path to lua must be absolute!"
exit 1
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: PATH_TO_LUA=$with_lua" >&5
Expand All @@ -4408,7 +4411,8 @@ if test ${with_luac+y}
then :
withval=$with_luac; PATH_TO_LUAC="$withval"
if test ${PATH_TO_LUAC:0:1} != '/' ; then
echo "Path to luac must be absolute"
echo
echo "ERROR: Path to luac must be absolute"
exit 1
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: PATH_TO_LUAC=$with_luac" >&5
Expand Down Expand Up @@ -4565,7 +4569,11 @@ fi
if test "$ac_cv_header_tcl_h" != yes ; then
rm -f makefile
as_fn_error $? "Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h" "$LINENO" 5
FOUND_ERROR=yes
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h"
ERR_MSG="$ERR_MSG||$MSG"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: $MSG" >&5
printf "%s\n" "$as_me: $MSG" >&6;}
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing Tcl_CreateInterp" >&5
printf %s "checking for library containing Tcl_CreateInterp... " >&6; }
Expand Down Expand Up @@ -4658,14 +4666,17 @@ PATH_TO_SRC=$SRCDIR
if test $MODE != "user_default" ; then
mode=0$MODE
if test $MODE == "user_default" ; then
mode=0755
EXEC_BITS=$(( 0111 & $mode ));
if test $EXEC_BITS = 0; then
MSG="MODE must have at least one executable bit set (Not MODE=$MODE)
Please try setting mode to 755 or 750 or 700 or similar."
echo "$MSG"
echo
echo "MODE must have at least one executable bit set (Not MODE=$MODE)"
echo "Please try setting mode to 755 or 750 or 700 or similar."
echo
ERR_MSG="$ERR_MSG
$MSG"
rm -f makefile
exit 1
fi
Expand Down Expand Up @@ -5667,6 +5678,20 @@ fi
##### LUA configuration -- end
if test "$FOUND_ERROR" = yes; then
echo
echo One or more errors found:
echo
echo Error Messages:
echo "------------------------------------------------------------"
echo $ERR_MSG | tr '|' '\n' | while read item; do
echo $item
done
echo "------------------------------------------------------------"
rm -f makefile
exit 1;
fi
# Extract the first word of "zsh", so it can be a program name with args.
Expand Down
40 changes: 32 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ FOLLOW_READLINK ()
echo $myprog
}

ERR_MSG=""
FOUND_ERROR=

AC_SUBST(DUPLICATE_PATHS)
AC_ARG_WITH(duplicatePaths,
Expand Down Expand Up @@ -651,7 +653,8 @@ AC_ARG_WITH(lua,
AS_HELP_STRING([--with-lua=ans],[absolute path to the lua interpreter to use [[lua]]]),
PATH_TO_LUA="$withval"
if test ${PATH_TO_LUA:0:1} != '/' ; then
echo "Path to lua must be absolute"
echo
echo "ERROR: Path to lua must be absolute!"
exit 1
fi
AC_MSG_RESULT([PATH_TO_LUA=$with_lua])
Expand All @@ -667,7 +670,8 @@ AC_ARG_WITH(luac,
AS_HELP_STRING([--with-luac=ans],[absolute path to the luac interpreter to use [[luac]]]),
PATH_TO_LUAC="$withval"
if test ${PATH_TO_LUAC:0:1} != '/' ; then
echo "Path to luac must be absolute"
echo
echo "ERROR: Path to luac must be absolute"
exit 1
fi
AC_MSG_RESULT([PATH_TO_LUAC=$with_luac])
Expand Down Expand Up @@ -731,7 +735,10 @@ if test "$FAST_TCL_INTERP" = yes ; then

if test "$ac_cv_header_tcl_h" != yes ; then
rm -f makefile
AC_MSG_ERROR([Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h])
FOUND_ERROR=yes
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h"
ERR_MSG="$ERR_MSG||$MSG"
AC_MSG_NOTICE([$MSG])
fi
AC_SEARCH_LIBS(Tcl_CreateInterp, [tcl] [tcl8.8] [tcl8.7] [tcl8.6] [tcl8.5],[],
[rm -f makefile; AC_MSG_ERROR([Unable to build Lmod with -ltcl Please install the tcl devel package or configure --with-fastTCLInterp=no to not require the tcl library])], [$TCL_LIBS])
Expand Down Expand Up @@ -763,14 +770,17 @@ AC_SUBST(PATH_TO_HASHSUM)
AC_SUBST(PATH_TO_PAGER)
AC_SUBST(PATH_TO_TCLSH)

if test $MODE != "user_default" ; then
mode=0$MODE
if test $MODE == "user_default" ; then
mode=0755
EXEC_BITS=$(( 0111 & $mode ));
if test $EXEC_BITS = 0; then
MSG="MODE must have at least one executable bit set (Not MODE=$MODE)
Please try setting mode to 755 or 750 or 700 or similar."

echo "$MSG"
echo
echo "MODE must have at least one executable bit set (Not MODE=$MODE)"
echo "Please try setting mode to 755 or 750 or 700 or similar."
echo
ERR_MSG="$ERR_MSG
$MSG"
rm -f makefile
exit 1
fi
Expand Down Expand Up @@ -1060,6 +1070,20 @@ fi

##### LUA configuration -- end

if test "$FOUND_ERROR" = yes; then
echo
echo One or more errors found:
echo
echo Error Messages:
echo "------------------------------------------------------------"
echo $ERR_MSG | tr '|' '\n' | while read item; do
echo $item
done
echo "------------------------------------------------------------"

rm -f makefile
exit 1;
fi

AC_SUBST(ZSH_SITE_FUNCTIONS_DIRS)
AC_PATH_PROG(ZSH, zsh)
Expand Down
26 changes: 15 additions & 11 deletions init/bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,32 @@ fi
# Prepend the FPATH variable for ksh functions when ssh is being used,
# except for zsh as it breaks things there.

__build_FPATH_for_zsh_ksh()
{
zsh_fpath=$(unset FPATH; zsh -f -c 'echo $FPATH')
export FPATH=$(@PKGV@/libexec/addto --append FPATH ${zsh_fpath} @PKGV@/init/ksh_funcs)
unset zsh_fpath
}

if [ -n "${ZSH_VERSION+x}" -a -z "${__LMOD_SET_ZSH_FPATH+x}" ]; then
export __LMOD_SET_ZSH_FPATH=1
zv=${ZSH_VERSION}
orig_zsh_version=@orig_zsh_version@
zsh_fpath=@zsh_fpath@
if [ -n "${orig_zsh_version:-}" -a -n "${zsh_fpath:-}" ]; then
zsh_fpath=$(echo $zsh_fpath | sed -e "s|/$orig_zsh_version/|/$zv/|g" )
export FPATH=$(@PKGV@/libexec/addto --append FPATH $zsh_fpath @PKGV@/init/ksh_funcs)
fi
unset zv
unset orig_zsh_version
unset zsh_fpath
__build_FPATH_for_zsh_ksh
fi

if [ -n "${KSH_VERSION+x}" -o -n "${BASH_VERSION+x}" ]; then
if [ -z "${__LMOD_SET_KSH_FPATH:-}" ]; then
type zsh > /dev/null 2>&1
if [ "$?" = 0 ]; then
__build_FPATH_for_zsh_ksh
else
export FPATH=$(@PKGV@/libexec/addto --append FPATH ${FPATH:-} @PKGV@/init/ksh_funcs)
fi
export __LMOD_SET_KSH_FPATH=1
export FPATH=$(@PKGV@/libexec/addto --append FPATH $FPATH @PKGV@/init/ksh_funcs)
fi
fi

unset -f __build_FPATH_for_zsh_ksh

export LMOD_ROOT=@lmod_root@
export LMOD_PKG=@PKGV@
export LMOD_DIR=$LMOD_PKG/libexec
Expand Down
41 changes: 41 additions & 0 deletions rt/restore_reset/err.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
===========================
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.47 2024-07-22 10:04 -04:00
by Robert McLay [email protected]
===========================
step 2
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load git
===========================
===========================
step 3
lua ProjectDIR/src/lmod.in.lua shell --regression_testing save
===========================
Saved current collection of modules to: "default"
===========================
step 4
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
===========================
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing restore
===========================
Restoring modules from user's default
===========================
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
===========================
step 8
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load gcc
===========================
===========================
step 9
lua ProjectDIR/src/lmod.in.lua shell --regression_testing reset
===========================
Running "module reset". Resetting modules to system default. The following $MODULEPATH directories have been removed: None
43 changes: 43 additions & 0 deletions rt/restore_reset/mf/Core/gcc/13.2.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--[[ lmod for gcc 13.2.0
Installed as:
wget https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz
tar -xf gcc-13.2.0.tar.xz
cd gcc-13.2.0
./contrib/download_prerequisites
mkdir build-gcc-13.2.0 && cd build-gcc-13.2.0
../configure --prefix=/ford1/share/gmao_SIteam/gcc/gcc-13.2.0 \
--enable-languages=c,c++,fortran --disable-multilib |& tee configure.log
make -j 6 |& tee make.log
make install |& tee makeinstall.log
--]]

family("Compiler")

local compilername = "gcc"
local version = "13.2.0"
local versioned_compiler = compilername .. "-" .. version
local siteamdir = "/ford1/share/gmao_SIteam"
local installdir = pathJoin(siteamdir,compilername,versioned_compiler)

-- Setup Modulepath for packages built by this compiler
local mroot = "/ford1/share/gmao_SIteam/lmodulefiles"
local mdir = pathJoin(mroot,"Compiler/gcc-13.2.0")
prepend_path("MODULEPATH", mdir)

prepend_path("PATH",pathJoin(installdir,"bin"))
prepend_path("LD_LIBRARY_PATH",pathJoin(installdir,"lib64"))
prepend_path("LIBRARY_PATH",pathJoin(installdir,"lib64"))
prepend_path("INCLUDE",pathJoin(installdir,"include"))
prepend_path("INCLUDE",pathJoin(installdir,"include/c++",version))
prepend_path("MANPATH",pathJoin(installdir,"share/man"))

setenv("CC",pathJoin(installdir,"bin","gcc"))
setenv("CXX",pathJoin(installdir,"bin","g++"))
setenv("FC",pathJoin(installdir,"bin","gfortran"))
setenv("F90",pathJoin(installdir,"bin","gfortran"))
32 changes: 32 additions & 0 deletions rt/restore_reset/mf/Core/git/2.40.1.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--[[ File for git
Built as:
./configure --prefix=/ford1/share/gmao_SIteam/git/git-2.40.1 |& tee configure.log
Then:
make -j4 all |& tee make.log
make install |& tee makeinstall.log
To get the man pages, download the:
git-manpages-2.40.1.tar.xz
tarball from:
https://mirrors.edge.kernel.org/pub/software/scm/git/
and then do:
mkdir -p /ford1/share/gmao_SIteam/git/git-2.40.1/share/man
tar xf git-manpages-2.40.1.tar.xz -C /ford1/share/gmao_SIteam/git/git-2.40.1/share/man/
--]]

local version = "git-2.40.1"
local installdir = "/ford1/share/gmao_SIteam/git"

local pkgdir = pathJoin(installdir,version)

prepend_path("PATH",pathJoin(pkgdir,"bin"))
prepend_path("MANPATH",pathJoin(pkgdir,"share/man"))
Loading

0 comments on commit 07cf82c

Please sign in to comment.