From bc18d20d90ba1fd6efc894558bef2fdacaac28a8 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 13 Dec 2023 10:39:35 -0800 Subject: [PATCH 1/5] more python updates --- src/python/nw_inp_from_string.c | 2 -- src/python/nwchem_wrap.c | 6 ------ src/python/task_python.c | 2 ++ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/python/nw_inp_from_string.c b/src/python/nw_inp_from_string.c index 010f1c1f04..47204b383c 100644 --- a/src/python/nw_inp_from_string.c +++ b/src/python/nw_inp_from_string.c @@ -29,8 +29,6 @@ int nw_inp_from_string(Integer rtdb, const char *input) FILE *file; #if (defined(USE_FCD) || defined(WIN32)) && !defined(__MINGW32__) _fcd fstring; -#else - char fstring[255]; #endif int status; const char base[] = "temp"; diff --git a/src/python/nwchem_wrap.c b/src/python/nwchem_wrap.c index 4aac5ea9b6..a407d0d72c 100644 --- a/src/python/nwchem_wrap.c +++ b/src/python/nwchem_wrap.c @@ -1797,12 +1797,6 @@ struct module_state { static struct module_state _state; #endif -static PyObject* error_out(PyObject *m) { - struct module_state *st = GETSTATE(m); - PyErr_SetString(st->error, "something bad happened"); - return NULL; -} - #if PY_MAJOR_VERSION >= 3 static int nwchem_traverse(PyObject *m, visitproc visit, void *arg) { diff --git a/src/python/task_python.c b/src/python/task_python.c index 6091ab2c3e..01d0862be9 100644 --- a/src/python/task_python.c +++ b/src/python/task_python.c @@ -42,7 +42,9 @@ int FATR task_python_(Integer *rtdb_ptr) wchar_t nwprogram[20]; mbstowcs(nwprogram, "NWChem", strlen("NWChem") + 1); #else +#if PY_VERSION_HEX < 0x03080000 wchar_t *nwprogram = Py_DecodeLocale("NWChem", NULL); +#endif #endif #if PY_VERSION_HEX < 0x03080000 Py_SetProgramName(nwprogram); From a5a95288c2f629b466747536e3446e401f383024 Mon Sep 17 00:00:00 2001 From: edoapra Date: Thu, 14 Dec 2023 13:16:43 -0800 Subject: [PATCH 2/5] env --- src/config/oblas_ompcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/oblas_ompcheck.sh b/src/config/oblas_ompcheck.sh index d965c3f272..fd2888ae25 100755 --- a/src/config/oblas_ompcheck.sh +++ b/src/config/oblas_ompcheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # oblas_dir directory where libopenblas is located # oblas_name "openblas" suffix in lib"openblas". # e.g. for debian pkg libopenblas64-pthread-dev From 02c1d2b2b9e3b4f45fcc0e40dfbf5fae1ec1220c Mon Sep 17 00:00:00 2001 From: edoapra Date: Thu, 14 Dec 2023 13:17:38 -0800 Subject: [PATCH 3/5] added caching of MPI_INCLUDE --- src/config/makefile.h | 4 ++-- src/tools/check_mpi_inc.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 src/tools/check_mpi_inc.sh diff --git a/src/config/makefile.h b/src/config/makefile.h index 1bd9e4e5d0..1d73a2bcd5 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -3893,7 +3893,7 @@ ifdef USE_MPI endif endif # check if mpif90 is present - MPIF90YN = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include) + MPIF90YN=$(shell $(NWCHEM_TOP)/src/tools/check_mpi_inc.sh) ifeq ($(MPIF90YN),mpif90notfound) errormpif90: $(info ) @@ -3902,7 +3902,7 @@ ifdef USE_MPI $(info ) $(error ) endif - NWMPI_INCLUDE = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include) + NWMPI_INCLUDE = $(shell $(NWCHEM_TOP)/src/tools/check_mpi_inc.sh) NWMPI_LIB = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib) NWLIBMPI = $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi) endif diff --git a/src/tools/check_mpi_inc.sh b/src/tools/check_mpi_inc.sh new file mode 100755 index 0000000000..f1bfb629f1 --- /dev/null +++ b/src/tools/check_mpi_inc.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +echo `date` >> /tmp/edo/log +if [ ! -f ${NWCHEM_TOP}/src/mpi_include.txt ]; then + ${NWCHEM_TOP}/src/tools/guess-mpidefs --mpi_include > ${NWCHEM_TOP}/src/mpi_include.txt + echo created file >> /tmp/edo/log +fi +/usr/bin/cat ${NWCHEM_TOP}/src/mpi_include.txt >> /tmp/edo/log +/usr/bin/cat ${NWCHEM_TOP}/src/mpi_include.txt From 68fb3546e6d013539108ed884ed87d92928ea0f1 Mon Sep 17 00:00:00 2001 From: edoapra Date: Thu, 14 Dec 2023 16:42:19 -0800 Subject: [PATCH 4/5] fix cat --- src/tools/check_mpi_inc.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/check_mpi_inc.sh b/src/tools/check_mpi_inc.sh index f1bfb629f1..fdaebcc1ab 100755 --- a/src/tools/check_mpi_inc.sh +++ b/src/tools/check_mpi_inc.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -echo `date` >> /tmp/edo/log if [ ! -f ${NWCHEM_TOP}/src/mpi_include.txt ]; then ${NWCHEM_TOP}/src/tools/guess-mpidefs --mpi_include > ${NWCHEM_TOP}/src/mpi_include.txt - echo created file >> /tmp/edo/log fi -/usr/bin/cat ${NWCHEM_TOP}/src/mpi_include.txt >> /tmp/edo/log -/usr/bin/cat ${NWCHEM_TOP}/src/mpi_include.txt +cat ${NWCHEM_TOP}/src/mpi_include.txt From 05df1d4f6955b64b1ce18cd7c727b880055166e1 Mon Sep 17 00:00:00 2001 From: edoapra Date: Thu, 14 Dec 2023 16:42:40 -0800 Subject: [PATCH 5/5] clean mpi_include.txt --- src/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GNUmakefile b/src/GNUmakefile index 10701e7150..180eb43f6f 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -129,7 +129,7 @@ realclean: -$(RM) $(LIBDIR)/*.a $(BINDIR)/* -$(RM) *.db movecs fort.41 fort.44 -$(RM) util/util_version.F - @# -$(RM) 64_to_32 32_to_64 deps_stamp # This conversion is such a hassle that realclean should not force it. + @# -$(RM) 64_to_32 32_to_64 deps_stamp mpi_include.txt # This conversion is such a hassle that realclean should not force it. .PHONY: cleanF cleanF: