diff --git a/.github/workflows/merge-gate.yml b/.github/workflows/merge-gate.yml
index 93b30a59db..fdeb4e3c3f 100644
--- a/.github/workflows/merge-gate.yml
+++ b/.github/workflows/merge-gate.yml
@@ -97,9 +97,9 @@ jobs:
fi
if [ "$USE_CMAKE" = "1" ]; then
- curl -OL https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz
- tar -zxf v4.9.2.tar.gz
- cd netcdf-c-4.9.2
+ curl -OL https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.3.tar.gz
+ tar -zxf v4.9.3.tar.gz
+ cd netcdf-c-4.9.3
./configure --disable-byterange --disable-libxml2 --disable-netcdf-4 --disable-dap --disable-doxygen --prefix=$HOME
make -j2
make install
@@ -119,7 +119,7 @@ jobs:
export PATH=$installdir/bin:$PATH
else
export LD_LIBRARY_PATH=$HOME/lib:${LD_LIBRARY_PATH}
- ./configure --buildlibs ${BUILD_FLAGS} ${COMPILER}
+ ./configure -makeblas --buildlibs ${BUILD_FLAGS} ${COMPILER}
source cpptraj.sh
make -j2 install
fi
@@ -159,7 +159,7 @@ jobs:
echo $LD_LIBRARY_PATH
ls $CONDA/lib
export MAKE_COMMAND="make -j2"
- ./configure --buildlibs -openmp -shared --with-zlib=$CONDA --with-bzlib=$CONDA --with-hdf5=$CONDA --with-netcdf=$CONDA --with-fftw3=$CONDA gnu
+ ./configure -makeblas --buildlibs -openmp -shared --with-zlib=$CONDA --with-bzlib=$CONDA --with-hdf5=$CONDA --with-netcdf=$CONDA --with-fftw3=$CONDA gnu
source cpptraj.sh
make -j2 libcpptraj
- name: Install pytraj
diff --git a/configure b/configure
index c5bea5a1a0..b8c720763c 100755
--- a/configure
+++ b/configure
@@ -52,6 +52,7 @@ UsageFull() {
echo " --nobuildlibs : Do not asking about building enabled libraries."
echo " -makenetcdf : Have cpptraj build its own NetCDF."
echo " -makeblas : Have cpptraj build its own LAPACK/BLAS."
+ echo " -makerl : Have cpptraj build its own readline."
echo " --libdir=
: Look for libraries in (useful to point to e.g. a previous CPPTRAJ install."
echo " Libraries: netcdf pnetcdf zlib bzlib blas lapack arpack fftw3 readline sanderlib xdrfile tng openmm"
echo " Note: pnetcdf is needed for writing NetCDF trajectories with MPI."
@@ -134,8 +135,8 @@ COMPERR='cpptrajcfg.compile.err'
COMPOUT='cpptrajcfg.compile.out'
# ----- Variables for downloading libraries ------
-NETCDF_SRCTAR='v4.9.2.tar.gz'
-NETCDF_SRCDIR='netcdf-c-4.9.2'
+NETCDF_SRCTAR='v4.9.3.tar.gz'
+NETCDF_SRCDIR='netcdf-c-4.9.3'
NETCDF_URL="https://github.com/Unidata/netcdf-c/archive/refs/tags/$NETCDF_SRCTAR"
NETCDF_OPTS=" --disable-byterange --disable-libxml2 --disable-netcdf-4 --disable-dap --disable-nczarr $windows_hostflag --disable-shared --disable-doxygen"
NETCDF4_OPTS=" --disable-byterange --disable-libxml2 --disable-dap --disable-nczarr $windows_hostflag --disable-shared --disable-doxygen"
@@ -165,7 +166,7 @@ LAPACK_SRCDIR='lapack-3.9.0'
LAPACK_URL="https://github.com/Reference-LAPACK/lapack/archive/$LAPACK_SRCTAR"
LAPACK_OPTS=''
-PNETCDF_SRCTAR='pnetcdf-1.12.2.tar.gz'
+PNETCDF_SRCTAR='pnetcdf-1.14.1.tar.gz'
PNETCDF_SRCDIR=''
PNETCDF_URL="https://parallel-netcdf.github.io/Release/$PNETCDF_SRCTAR"
PNETCDF_OPTS='--disable-fortran --disable-cxx'
@@ -200,6 +201,7 @@ USE_AMBERLIB=0 # 1 = Use AMBERHOME to fill in NetCDF/BLAS/LAPACK/ARPACK as ne
BUILD_LIBS=0 # 1 = Means automatically say yes to building enabled libs when not present.
BUILD_MPI='' # If not empty, attempt to download and build specified mpi dist.
icpp=0 # Used to count cmake_prefix_paths
+use_bundled_readline=0 # 1 = use bundled readline no matter what
USE_SINGLEENSEMBLE=0 # Enable support for single ensemble trajectories
USE_CPPTRAJDEBUG=0 # Enable internal cpptraj debug flags
@@ -1121,6 +1123,13 @@ EOF
}
TestReadline() {
+ if [ $use_bundled_readline -eq 1 ] ; then
+ echo " Will build bundled readline."
+ LIB_STAT[$LREADLINE]='bundled'
+ LIB_FLAG[$LREADLINE]='readline/libreadline.a'
+ LIB_INCL[$LREADLINE]='-I.'
+ return 0
+ fi
cat > testp.cpp <
#include
@@ -2844,6 +2853,7 @@ while [ ! -z "$1" ] ; do
'-noc++11' ) C11_SUPPORT='no' ;;
'-windows' ) PLATFORM='windows' ;;
'-pubfft' ) LIB_STAT[$LFFTW3]='off' ;;
+ '-makerl' ) use_bundled_readline=1 ;;
# Cpptraj options
'-nolfs' ) LFS='' ;;
'-single-ensemble' ) USE_SINGLEENSEMBLE=1 ;;
diff --git a/src/readline/histlib.h b/src/readline/histlib.h
index c39af71814..5c4b7d25fb 100644
--- a/src/readline/histlib.h
+++ b/src/readline/histlib.h
@@ -52,7 +52,7 @@
#ifndef member
# ifndef strchr
-extern char *strchr ();
+extern char *strchr (const char*, int);
# endif
#define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
#endif
diff --git a/src/readline/signals.c b/src/readline/signals.c
index 54f2a64284..c161c2e1b3 100644
--- a/src/readline/signals.c
+++ b/src/readline/signals.c
@@ -63,7 +63,7 @@
/* This typedef is equivalent to the one for Function; it allows us
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
-typedef RETSIGTYPE SigHandler ();
+typedef RETSIGTYPE SigHandler (int);
#if defined (HAVE_POSIX_SIGNALS)
typedef struct sigaction sighandler_cxt;
@@ -113,8 +113,7 @@ static sighandler_cxt old_winch;
/* Readline signal handler functions. */
static RETSIGTYPE
-rl_signal_handler (sig)
- int sig;
+rl_signal_handler (int sig)
{
#if defined (HAVE_POSIX_SIGNALS)
sigset_t set;
@@ -197,8 +196,7 @@ rl_signal_handler (sig)
#if defined (SIGWINCH)
static RETSIGTYPE
-rl_sigwinch_handler (sig)
- int sig;
+rl_sigwinch_handler (int sig)
{
SigHandler *oh;
@@ -242,10 +240,7 @@ rl_sigaction (sig, nh, oh)
information in OHANDLER. Return the old signal handler, like
signal(). */
static SigHandler *
-rl_set_sighandler (sig, handler, ohandler)
- int sig;
- SigHandler *handler;
- sighandler_cxt *ohandler;
+rl_set_sighandler (int sig, SigHandler* handler, sighandler_cxt* ohandler)
{
sighandler_cxt old_handler;
#if defined (HAVE_POSIX_SIGNALS)
@@ -270,10 +265,7 @@ rl_set_sighandler (sig, handler, ohandler)
}
static void
-rl_maybe_set_sighandler (sig, handler, ohandler)
- int sig;
- SigHandler *handler;
- sighandler_cxt *ohandler;
+rl_maybe_set_sighandler (int sig, SigHandler* handler, sighandler_cxt* ohandler)
{
sighandler_cxt dummy;
SigHandler *oh;
diff --git a/src/readline/termcap.c b/src/readline/termcap.c
index 1a90751291..00ad060ad6 100644
--- a/src/readline/termcap.c
+++ b/src/readline/termcap.c
@@ -126,7 +126,7 @@ xrealloc (ptr, size)
for tgetnum, tgetflag and tgetstr to find. */
static char *term_entry;
-static char *tgetst1 ();
+static char* tgetst1 (char* ptr, char** area);
/* Search entry BP for capability CAP.
Return a pointer to the capability (in BP) if found,
@@ -208,9 +208,7 @@ static char esctab[]
or NULL if PTR is NULL. */
static char *
-tgetst1 (ptr, area)
- char *ptr;
- char **area;
+tgetst1 (char* ptr, char** area)
{
register char *p, *r;
register int c;
@@ -314,10 +312,7 @@ static int speeds[] =
#endif /* not emacs */
void
-tputs (str, nlines, outfun)
- register char *str;
- int nlines;
- register int (*outfun) ();
+tputs (register char* str, int nlines, register int (*outfun)(char))
{
register int padcount = 0;
register int speed;
@@ -389,10 +384,10 @@ struct termcap_buffer
/* Forward declarations of static functions. */
-static int scan_file ();
-static char *gobble_line ();
-static int compare_contin ();
-static int name_match ();
+static int scan_file (char* str, int fd, register struct termcap_buffer* bufp);
+static char *gobble_line (int fd, register struct termcap_buffer* bufp, char* append_end);
+static int compare_contin (register char* str1, register char* str2);
+static int name_match(char* line, char* name);
#ifdef VMS
@@ -446,8 +441,7 @@ valid_filename_p (fn)
in it, and some other value otherwise. */
int
-tgetent (bp, name)
- char *bp, *name;
+tgetent (char* bp, char* name)
{
register char *termcap_name;
register int fd;
@@ -611,10 +605,7 @@ tgetent (bp, name)
or 0 if no entry is found in the file. */
static int
-scan_file (str, fd, bufp)
- char *str;
- int fd;
- register struct termcap_buffer *bufp;
+scan_file (char* str, int fd, register struct termcap_buffer* bufp)
{
register char *end;
@@ -651,8 +642,7 @@ scan_file (str, fd, bufp)
by termcap entry LINE. */
static int
-name_match (line, name)
- char *line, *name;
+name_match (char* line, char* name)
{
register char *tem;
@@ -667,8 +657,7 @@ name_match (line, name)
}
static int
-compare_contin (str1, str2)
- register char *str1, *str2;
+compare_contin (register char* str1, register char* str2)
{
register int c1, c2;
while (1)
@@ -708,10 +697,7 @@ compare_contin (str1, str2)
thing as one line. The caller decides when a line is continued. */
static char *
-gobble_line (fd, bufp, append_end)
- int fd;
- register struct termcap_buffer *bufp;
- char *append_end;
+gobble_line (int fd, register struct termcap_buffer* bufp, char* append_end)
{
register char *end;
register int nread;
diff --git a/src/readline/tparam.c b/src/readline/tparam.c
index 7722586eb7..1efdfb70a3 100644
--- a/src/readline/tparam.c
+++ b/src/readline/tparam.c
@@ -92,15 +92,11 @@ xrealloc (ptr, size)
The fourth and following args to tparam serve as the parameter values. */
-static char *tparam1 ();
+static char* tparam1 (char* string, char* outstring, int len, char* up, char* left, register int* argp);
/* VARARGS 2 */
-char *
-tparam (string, outstring, len, arg0, arg1, arg2, arg3)
- char *string;
- char *outstring;
- int len;
- int arg0, arg1, arg2, arg3;
+static char *
+tparam (char* string, char* outstring, int len, int arg0, int arg1, int arg2, int arg3)
{
int arg[4];
@@ -130,12 +126,7 @@ tgoto (cm, hpos, vpos)
}
static char *
-tparam1 (string, outstring, len, up, left, argp)
- char *string;
- char *outstring;
- int len;
- char *up, *left;
- register int *argp;
+tparam1 (char* string, char* outstring, int len, char* up, char* left, register int* argp)
{
register int c;
register char *p = string;