From f85db0105e33ab925aadd859b07ab17361221c97 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Sun, 15 Nov 2026 15:53:03 -0500 Subject: [PATCH 1/4] Add -makerl flag to force using internal readline --- configure | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index c5bea5a1a0..c86e58e835 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." @@ -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 ;; From a781477d666ff934fec914d611061639d95776ff Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Sun, 15 Nov 2026 16:13:19 -0500 Subject: [PATCH 2/4] Update some old-style function definitions to fix compilation with gcc 15 --- src/readline/histlib.h | 2 +- src/readline/signals.c | 18 +++++------------- src/readline/termcap.c | 38 ++++++++++++-------------------------- src/readline/tparam.c | 17 ++++------------- 4 files changed, 22 insertions(+), 53 deletions(-) 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; From 9931bcdcb80417dec10a01a0b5e6ce18ee9dbe30 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Sun, 15 Nov 2026 19:07:53 -0500 Subject: [PATCH 3/4] Try to fix the merge gate by using more up to date packages and compiling blas/lapack directly --- .github/workflows/merge-gate.yml | 11 +++++------ configure | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/merge-gate.yml b/.github/workflows/merge-gate.yml index 93b30a59db..a3fa930357 100644 --- a/.github/workflows/merge-gate.yml +++ b/.github/workflows/merge-gate.yml @@ -48,7 +48,6 @@ jobs: sudo apt-get update sudo apt-get install -y --fix-missing gfortran sudo apt-get install -y --fix-missing libbz2-dev - sudo apt-get install -y --fix-missing libblas-dev liblapack-dev sudo apt-get install -y --fix-missing libfftw3-dev sudo apt-get install -y --fix-missing clang sudo apt-get install -y --fix-missing cmake-data cmake @@ -97,9 +96,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 +118,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 +158,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 c86e58e835..b8c720763c 100755 --- a/configure +++ b/configure @@ -135,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" @@ -166,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' From 08eaa511562ce5a1d31af87cfaefe6d3bc418b74 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Sun, 15 Nov 2026 19:48:02 -0500 Subject: [PATCH 4/4] The cmake builds still require blas/lapack --- .github/workflows/merge-gate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge-gate.yml b/.github/workflows/merge-gate.yml index a3fa930357..fdeb4e3c3f 100644 --- a/.github/workflows/merge-gate.yml +++ b/.github/workflows/merge-gate.yml @@ -48,6 +48,7 @@ jobs: sudo apt-get update sudo apt-get install -y --fix-missing gfortran sudo apt-get install -y --fix-missing libbz2-dev + sudo apt-get install -y --fix-missing libblas-dev liblapack-dev sudo apt-get install -y --fix-missing libfftw3-dev sudo apt-get install -y --fix-missing clang sudo apt-get install -y --fix-missing cmake-data cmake