diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bee333f..e8c711499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ The format of this changelog is based on - Exposed configuration linear solver and eigen solver options for the wave port subproblem. These can now be specified as part of the `config["Boundaries"]["WavePort"]` configuration. The defaults align with the previously hardcoded values. + - Nonconformal adaptation is now supported for WavePort boundary conditions. This was + achieved through a patch applied to MFEM to support `mfem::ParSubMesh` on external + nonconformal surface subdomains. ## [0.13.0] - 2024-05-20 diff --git a/cmake/ExternalBLASLAPACK.cmake b/cmake/ExternalBLASLAPACK.cmake index 6c190e565..5346734f2 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -200,4 +200,4 @@ set(BLAS_LAPACK_LIBRARIES ${_BLAS_LAPACK_LIBRARIES} CACHE STRING ) set(BLAS_LAPACK_INCLUDE_DIRS ${_BLAS_LAPACK_INCLUDE_DIRS} CACHE STRING "Path to BLAS/LAPACK include directories" -) +) \ No newline at end of file diff --git a/cmake/ExternalGSLIB.cmake b/cmake/ExternalGSLIB.cmake index 258fe3cbe..6c496ed67 100644 --- a/cmake/ExternalGSLIB.cmake +++ b/cmake/ExternalGSLIB.cmake @@ -79,11 +79,6 @@ list(APPEND GSLIB_OPTIONS string(REPLACE ";" "; " GSLIB_OPTIONS_PRINT "${GSLIB_OPTIONS}") message(STATUS "GSLIB_OPTIONS: ${GSLIB_OPTIONS_PRINT}") -# Fix build -set(GSLIB_PATCH_FILES - "${CMAKE_SOURCE_DIR}/extern/patch/gslib/patch_build.diff" -) - include(ExternalProject) ExternalProject_Add(gslib DEPENDS ${GSLIB_DEPENDENCIES} @@ -94,7 +89,6 @@ ExternalProject_Add(gslib PREFIX ${CMAKE_BINARY_DIR}/extern/gslib-cmake BUILD_IN_SOURCE TRUE UPDATE_COMMAND "" - PATCH_COMMAND git apply "${GSLIB_PATCH_FILES}" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} ${GSLIB_OPTIONS} install diff --git a/cmake/ExternalGitTags.cmake b/cmake/ExternalGitTags.cmake index f536c0de7..eed1f23f5 100644 --- a/cmake/ExternalGitTags.cmake +++ b/cmake/ExternalGitTags.cmake @@ -20,7 +20,7 @@ set(EXTERN_ARPACK_GIT_BRANCH "Git branch for external ARPACK-NG build" ) set(EXTERN_ARPACK_GIT_TAG - "0b3038d139f874a423ba6a1cdf5098fc15336848" CACHE STRING + "804fa3149a0f773064198a8e883bd021832157ca" CACHE STRING "Git tag for external ARPACK-NG build" ) @@ -34,7 +34,7 @@ set(EXTERN_BUTTERFLYPACK_GIT_BRANCH "Git branch for external ButterflyPACK build" ) set(EXTERN_BUTTERFLYPACK_GIT_TAG - "36e1f4a1b98451df0f561349f899e0f5d0e0b6bc" CACHE STRING + "cbde1bb675a5bd74b778eb29f6b9dacc0607542c" CACHE STRING "Git tag for external ButterflyPACK build" ) @@ -48,7 +48,7 @@ set(EXTERN_GSLIB_GIT_BRANCH "Git branch for external GSLIB build" ) set(EXTERN_GSLIB_GIT_TAG - "dbab7c6f14ec4b3f9a6f93b25fd72a6be0651f34" CACHE STRING + "d5d4ee04ad4d32bebfef730a3608cbe988223dbd" CACHE STRING "Git tag for external GSLIB build" ) @@ -62,7 +62,7 @@ set(EXTERN_HYPRE_GIT_BRANCH "Git branch for external HYPRE build" ) set(EXTERN_HYPRE_GIT_TAG - "3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e" CACHE STRING + "aa1f66d633b144eae83edf89937d2316d2d63268" CACHE STRING "Git tag for external HYPRE build" ) @@ -76,7 +76,7 @@ set(EXTERN_LIBCEED_GIT_BRANCH "Git branch for external libCEED build" ) set(EXTERN_LIBCEED_GIT_TAG - "83862665467081d1f29e1ddefe74326356b818f0" CACHE STRING + "be8d6f551b0f7f956d1f45b9192fb65aa4e4d3da" CACHE STRING "Git tag for external libCEED build" ) @@ -90,7 +90,7 @@ set(EXTERN_LIBXSMM_GIT_BRANCH "Git branch for external LIBXSMM build" ) set(EXTERN_LIBXSMM_GIT_TAG - "d10cd5d59b03c04d1b0aa2aa44f28a21cd60a062" CACHE STRING + "bbc71343595f9b71664d0985b02e87e0654c8cdc" CACHE STRING "Git tag for external LIBXSMM build" ) @@ -104,7 +104,7 @@ set(EXTERN_MAGMA_GIT_BRANCH "Git branch for external MAGMA build" ) set(EXTERN_MAGMA_GIT_TAG - "6573c5a752da571b9c5a5c5f7cd68cc24d3c2c6d" CACHE STRING + "4917e80ca559d0e0d4fdb56abfca381639f9b821" CACHE STRING "Git tag for external MAGMA build" ) @@ -132,7 +132,7 @@ set(EXTERN_MFEM_GIT_BRANCH "Git branch for external MFEM build" ) set(EXTERN_MFEM_GIT_TAG - "957ca0d50089795b219e4701312355f875af6019" CACHE STRING + "7c1a0eb5e3f70ff9d161c9d6e3f228ba2513acca" CACHE STRING "Git tag for external MFEM build" ) @@ -146,7 +146,7 @@ set(EXTERN_MUMPS_GIT_BRANCH "Git branch for external MUMPS build" ) set(EXTERN_MUMPS_GIT_TAG - "8cfe473232bd45a660e247ea909a670ea9186ec3" CACHE STRING + "1324a3358aae44279b6af4630609956f06131d6f" CACHE STRING "Git tag for external MUMPS build" ) @@ -174,7 +174,7 @@ set(EXTERN_PETSC_GIT_BRANCH "Git branch for external PETSc build" ) set(EXTERN_PETSC_GIT_TAG - "4bbe91384854fec5c16b677958fdcd4ec4bdaf6b" CACHE STRING + "2ad7182b1093845a8c26c56c2f6611a55c3328ce" CACHE STRING "Git tag for external PETSc build" ) @@ -202,7 +202,7 @@ set(EXTERN_SLEPC_GIT_BRANCH "Git branch for external SLEPc build" ) set(EXTERN_SLEPC_GIT_TAG - "e93850835cc2843553d5b759b2277856d10dbc97" CACHE STRING + "89b995ba7ee626d15a64b368ee92d6d4a4f6d6fb" CACHE STRING "Git tag for external SLEPc build" ) @@ -216,7 +216,7 @@ set(EXTERN_STRUMPACK_GIT_BRANCH "Git branch for external STRUMPACK build" ) set(EXTERN_STRUMPACK_GIT_TAG - "b964011b77e1cf6bb087a6e049f61c1c77a8e256" CACHE STRING + "9a45f304f21e1d9c44c6fa50ac2f044ab15cf342" CACHE STRING "Git tag for external STRUMPACK build" ) @@ -230,7 +230,7 @@ set(EXTERN_SUPERLU_GIT_BRANCH "Git branch for external SuperLU_DIST build" ) set(EXTERN_SUPERLU_GIT_TAG - "a66f013e468524b0f1508447fa2c9e9ff605c3ec" CACHE STRING + "b3193e8615b5364f4e5650297d9e2aaf2e49c909" CACHE STRING "Git tag for external SuperLU_DIST build" ) @@ -244,7 +244,7 @@ set(EXTERN_ZFP_GIT_BRANCH "Git branch for external ZFP build" ) set(EXTERN_ZFP_GIT_TAG - "3b6eb55c775e8c22d89c2a584160e3fe81cf9f5a" CACHE STRING + "a46fa8b91bf2d69f4ffcf04af4f908383828ba79" CACHE STRING "Git tag for external ZFP build" ) diff --git a/extern/patch/PETSc/patch_install.diff b/extern/patch/PETSc/patch_install.diff new file mode 100644 index 000000000..6cc8abc36 --- /dev/null +++ b/extern/patch/PETSc/patch_install.diff @@ -0,0 +1,13 @@ +diff --git a/config/install.py b/config/install.py +index 50c868d1136..69b2b097512 100755 +--- a/config/install.py ++++ b/config/install.py +@@ -508,7 +508,7 @@ for file in files: + return + shutil.copy2(src, dst) + if self.setCompilers.getCompiler().find('win32fe') < 0 and os.path.splitext(dst)[1] == '.'+self.arLibSuffix: +- self.executeShellCommand([self.ranlib, dst]) ++ self.executeShellCommand(self.ranlib + " " + dst) + if os.path.splitext(dst)[1] == '.dylib' and shutil.which('otool') and shutil.which('install_name_tool'): + [output,err,flg] = self.executeShellCommand(['otool', '-D', src]) + oldname = output[output.find("\n")+1:] diff --git a/extern/patch/gslib/patch_build.diff b/extern/patch/gslib/patch_build.diff deleted file mode 100644 index 75559af66..000000000 --- a/extern/patch/gslib/patch_build.diff +++ /dev/null @@ -1,1963 +0,0 @@ -diff --git a/Makefile b/Makefile -index 3c3b435..d2e50ef 100644 ---- a/Makefile -+++ b/Makefile -@@ -2,127 +2,163 @@ MPI ?= 1 - ADDUS ?= 1 - USREXIT ?= 0 - NBC ?= 0 --LIBNAME ?= gs - BLAS ?= 0 --DEBUG ?= 0 -+MKL ?= 0 -+ - CFLAGS ?= -O2 - FFLAGS ?= -O2 -+ARFLAGS ?= cr -+ -+LIBNAME ?= gs - CPREFIX ?= gslib_ - FPREFIX ?= fgslib_ - --SRCROOT=. --TESTDIR=$(SRCROOT)/tests --FTESTDIR=$(TESTDIR)/fortran --SRCDIR=$(SRCROOT)/src --INCDIR=$(SRCROOT)/src --LIBDIR=$(SRCROOT)/lib -+STATIC ?= 1 -+SHARED ?= 0 -+ -+SRCROOT = . -+TESTDIR = $(SRCROOT)/tests -+FTESTDIR = $(TESTDIR)/fortran -+SRCDIR = $(SRCROOT)/src -+INCDIR = $(SRCROOT)/src -+LIBDIR = $(SRCROOT)/lib -+ -+DARWIN := $(filter Darwin,$(shell uname -s)) -+SO_EXT := $(if $(DARWIN),dylib,so) - - ifneq (,$(strip $(DESTDIR))) --INSTALL_ROOT = $(DESTDIR) -+ INSTALL_ROOT = $(DESTDIR) - else --INSTALL_ROOT = $(SRCROOT)/build -+ INSTALL_ROOT = $(SRCROOT)/build -+endif -+ -+ifneq (0,$(SHARED)) -+ ifneq (0,$(STATIC)) -+ $(warning Cannot build with both STATIC=1 and SHARED=1, setting SHARED=0) -+ override SHARED = 0 -+ endif -+endif -+ -+ifneq (0,$(SHARED)) -+ ifeq ($(filter -fPIC,$(CFLAGS)),) -+ override CFLAGS += -fPIC -+ endif -+ ifneq ($(DARWIN),) -+ override LDFLAGS += -install_name @rpath/lib$(LIBNAME).$(SO_EXT) -+ endif - endif - - $(shell >config.h) - ifneq (0,$(MPI)) -- SN=GSLIB_USE_MPI -- G:=$(G) -D$(SN) -+ SN = GSLIB_USE_MPI -+ G := $(G) -D$(SN) -+ $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) - ifeq ($(origin CC),default) - CC = mpicc - endif - ifeq ($(origin FC),default) - FC = mpif77 - endif -- $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) - endif - - ifneq (0,$(ADDUS)) -- SN=UNDERSCORE -- G:=$(G) -D$(SN) -+ SN = GSLIB_UNDERSCORE -+ G := $(G) -D$(SN) - $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) - endif - --SN=GLOBAL_LONG_LONG --G:=$(G) -D$(SN) --$(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) -- --SN=PREFIX --G:=$(G) -D$(SN)=$(CPREFIX) -+SN = GSLIB_PREFIX -+G := $(G) -D$(SN)=$(CPREFIX) - $(shell printf "#ifndef ${SN}\n#define ${SN} ${CPREFIX}\n#endif\n" >>config.h) - --SN=FPREFIX --G:=$(G) -D$(SN)=$(FPREFIX) -+SN = GSLIB_FPREFIX -+G := $(G) -D$(SN)=$(FPREFIX) - $(shell printf "#ifndef ${SN}\n#define ${SN} ${FPREFIX}\n#endif\n" >>config.h) - -+SN = GSLIB_USE_GLOBAL_LONG_LONG -+G := $(G) -D$(SN) -+$(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) -+ - ifneq (0,$(USREXIT)) -- G+=-DUSE_USR_EXIT -+ G += -DGSLIB_USE_USR_EXIT - endif - - ifneq (0,$(NBC)) -- G+=-DUSE_NBC -+ G += -DGSLIB_USE_NBC - endif - - ifeq (0,$(BLAS)) -- SN=USE_NAIVE_BLAS -- G:=$(G) -D$(SN) -+ SN = GSLIB_USE_NAIVE_BLAS -+ G := $(G) -D$(SN) - $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) - endif - - ifeq (1,$(BLAS)) -- G+=-DUSE_CBLAS -+ SN = GSLIB_USE_CBLAS -+ G := $(G) -D$(SN) -+ $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) -+ ifeq (1,$(MKL)) -+ SN = GSLIB_USE_MKL -+ G := $(G) -D$(SN) -+ $(shell printf "#ifndef ${SN}\n#define ${SN}\n#endif\n" >>config.h) -+ endif - endif - --ifneq (0,$(DEBUG)) -- G+=-DGSLIB_DEBUG -- CFLAGS+=-g --endif -+CCCMD = $(CC) $(CFLAGS) -I$(INCDIR) $(G) -+FCCMD = $(FC) $(FFLAGS) -I$(INCDIR) $(G) - --CCCMD=$(CC) $(CFLAGS) -I$(INCDIR) $(G) --FCCMD=$(FC) $(FFLAGS) -I$(INCDIR) $(G) -+TESTS = $(TESTDIR)/sort_test $(TESTDIR)/sort_test2 $(TESTDIR)/sarray_sort_test \ -+ $(TESTDIR)/comm_test $(TESTDIR)/crystal_test \ -+ $(TESTDIR)/sarray_transfer_test $(TESTDIR)/gs_test \ -+ $(TESTDIR)/gs_test_gop_blocking $(TESTDIR)/gs_test_gop_nonblocking \ -+ $(TESTDIR)/gs_unique_test \ -+ $(TESTDIR)/findpts_el_2_test \ -+ $(TESTDIR)/findpts_el_2_test2 $(TESTDIR)/findpts_el_3_test \ -+ $(TESTDIR)/findpts_el_3_test2 $(TESTDIR)/findpts_local_test \ -+ $(TESTDIR)/findpts_test $(TESTDIR)/findpts_test_ms $(TESTDIR)/poly_test \ -+ $(TESTDIR)/lob_bnd_test $(TESTDIR)/obbox_test - --TESTS=$(TESTDIR)/sort_test $(TESTDIR)/sort_test2 $(TESTDIR)/sarray_sort_test \ -- $(TESTDIR)/comm_test $(TESTDIR)/crystal_test \ -- $(TESTDIR)/sarray_transfer_test $(TESTDIR)/gs_test \ -- $(TESTDIR)/gs_test_gop_blocking $(TESTDIR)/gs_test_gop_nonblocking \ -- $(TESTDIR)/gs_unique_test \ -- $(TESTDIR)/findpts_el_2_test \ -- $(TESTDIR)/findpts_el_2_test2 $(TESTDIR)/findpts_el_3_test \ -- $(TESTDIR)/findpts_el_3_test2 $(TESTDIR)/findpts_local_test \ -- $(TESTDIR)/findpts_test $(TESTDIR)/findpts_test_ms $(TESTDIR)/poly_test \ -- $(TESTDIR)/lob_bnd_test $(TESTDIR)/obbox_test -+FTESTS = $(FTESTDIR)/f-igs - --FTESTS=$(FTESTDIR)/f-igs -+GS = $(SRCDIR)/gs.o $(SRCDIR)/sort.o $(SRCDIR)/sarray_transfer.o \ -+ $(SRCDIR)/sarray_sort.o $(SRCDIR)/gs_local.o $(SRCDIR)/fail.o \ -+ $(SRCDIR)/crystal.o $(SRCDIR)/comm.o $(SRCDIR)/tensor.o - --GS=$(SRCDIR)/gs.o $(SRCDIR)/sort.o $(SRCDIR)/sarray_transfer.o \ -- $(SRCDIR)/sarray_sort.o $(SRCDIR)/gs_local.o $(SRCDIR)/fail.o \ -- $(SRCDIR)/crystal.o $(SRCDIR)/comm.o $(SRCDIR)/tensor.o -+FWRAPPER = $(SRCDIR)/fcrystal.o $(SRCDIR)/findpts.o - --FWRAPPER=$(SRCDIR)/fcrystal.o $(SRCDIR)/findpts.o --INTP=$(SRCDIR)/findpts_local.o $(SRCDIR)/obbox.o $(SRCDIR)/poly.o \ -- $(SRCDIR)/lob_bnd.o $(SRCDIR)/findpts_el_3.o $(SRCDIR)/findpts_el_2.o -+INTP = $(SRCDIR)/findpts_local.o $(SRCDIR)/obbox.o $(SRCDIR)/poly.o \ -+ $(SRCDIR)/lob_bnd.o $(SRCDIR)/findpts_el_3.o $(SRCDIR)/findpts_el_2.o - - .PHONY: all lib install tests clean objects - - all : lib install - --lib: $(GS) $(FWRAPPER) $(INTP) -- @$(AR) cr $(SRCDIR)/lib$(LIBNAME).a $? -- @ranlib $(SRCDIR)/lib$(LIBNAME).a -+lib: $(if $(filter-out 0,$(STATIC)),$(SRCDIR)/lib$(LIBNAME).a) $(if $(filter-out 0,$(SHARED)),$(SRCDIR)/lib$(LIBNAME).$(SO_EXT)) -+ -+$(SRCDIR)/lib$(LIBNAME).a: $(GS) $(FWRAPPER) $(INTP) -+ $(AR) $(ARFLAGS) $@ $^ -+ ranlib $@ -+ -+$(SRCDIR)/lib$(LIBNAME).$(SO_EXT): $(GS) $(FWRAPPER) $(INTP) -+ $(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS) - - install: lib - @mkdir -p $(INSTALL_ROOT)/lib 2>/dev/null -- @cp -v $(SRCDIR)/lib$(LIBNAME).a $(INSTALL_ROOT)/lib 2>/dev/null -- @mkdir -p $(INSTALL_ROOT)/include 2>/dev/null -- @cp $(SRCDIR)/*.h $(INSTALL_ROOT)/include 2>/dev/null -- @cp $(SRCDIR)/*.h $(INSTALL_ROOT)/include 2>/dev/null -- @mv config.h $(INSTALL_ROOT)/include 2>/dev/null -+ $(if $(filter-out 0,$(STATIC)),cp $(SRCDIR)/lib$(LIBNAME).a $(INSTALL_ROOT)/lib) -+ $(if $(filter-out 0,$(SHARED)),cp $(SRCDIR)/lib$(LIBNAME).$(SO_EXT) $(INSTALL_ROOT)/lib) -+ @mkdir -p $(INSTALL_ROOT)/include/gslib 2>/dev/null -+ cp $(SRCDIR)/*.h $(INSTALL_ROOT)/include/gslib -+ mv config.h $(INSTALL_ROOT)/include/gslib -+ @printf '// Automatically generated file\n#include "gslib/gslib.h"\n' \ -+ > $(INSTALL_ROOT)/include/gslib.h && chmod 644 $(INSTALL_ROOT)/include/gslib.h - - tests: $(TESTS) - --clean: ; @$(RM) config.h $(SRCDIR)/*.o $(SRCDIR)/*.s $(SRCDIR)/*.a $(TESTDIR)/*.o $(FTESTDIR)/*.o $(TESTS) -+clean: -+ $(RM) config.h $(SRCDIR)/*.o $(SRCDIR)/*.s $(SRCDIR)/*.a $(SRCDIR)/*.$(SO_EXT) $(TESTDIR)/*.o $(FTESTDIR)/*.o $(TESTS) - - $(TESTS): % : %.c | lib install -- $(CC) $(CFLAGS) -I$(INSTALL_ROOT)/include $< -o $@ -L$(INSTALL_ROOT)/lib -l$(LIBNAME) -lm $(LDFLAGS) -+ $(CC) $(CFLAGS) -I$(INSTALL_ROOT)/include $< -o $@ -L$(INSTALL_ROOT)/lib -l$(LIBNAME) -lm $(LDFLAGS) - - $(FTESTS): % : %.o | lib install - $(FCCMD) $^ -o $@ -L$(SRCDIR) -l$(LIBNAME) -diff --git a/src/c99.h b/src/c99.h -index a5a44e3..62c3ced 100644 ---- a/src/c99.h -+++ b/src/c99.h -@@ -1,16 +1,16 @@ --#ifndef C99_H --#define C99_H -+#ifndef GS_C99_H -+#define GS_C99_H - - #ifndef __STDC_VERSION__ --# define NO_C99 -+# define GS_NO_C99 - #elif __STDC_VERSION__ < 199901L --# define NO_C99 -+# define GS_NO_C99 - #endif - --#ifdef NO_C99 -+#ifdef GS_NO_C99 - # define restrict - # define inline --# undef NO_C99 -+# undef GS_NO_C99 - #endif - - #endif -diff --git a/src/comm.c b/src/comm.c -index c5353fe..19507c0 100644 ---- a/src/comm.c -+++ b/src/comm.c -@@ -117,8 +117,8 @@ void comm_allreduce(const struct comm *com, gs_dom dom, gs_op op, - case gs_float: mpitype=MPI_FLOAT; break; \ - case gs_int: mpitype=MPI_INT; break; \ - case gs_long: mpitype=MPI_LONG; break; \ -- WHEN_LONG_LONG(case gs_long_long: mpitype=MPI_LONG_LONG; break;) \ -- default: goto comm_allreduce_byhand; \ -+ GS_WHEN_LONG_LONG(case gs_long_long: mpitype=MPI_LONG_LONG; break;) \ -+ default: goto comm_allreduce_byhand; \ - } \ - } while(0) - DOMAIN_SWITCH(); -@@ -153,8 +153,8 @@ void comm_iallreduce(comm_req *req, const struct comm *com, gs_dom dom, gs_op op - case gs_float: mpitype=MPI_FLOAT; break; \ - case gs_int: mpitype=MPI_INT; break; \ - case gs_long: mpitype=MPI_LONG; break; \ -- WHEN_LONG_LONG(case gs_long_long: mpitype=MPI_LONG_LONG; break;) \ -- default: goto comm_allreduce_byhand; \ -+ GS_WHEN_LONG_LONG(case gs_long_long: mpitype=MPI_LONG_LONG; break;) \ -+ default: goto comm_allreduce_byhand; \ - } \ - } while(0) - DOMAIN_SWITCH(); -@@ -165,7 +165,7 @@ void comm_iallreduce(comm_req *req, const struct comm *com, gs_dom dom, gs_op op - case gs_max: mpiop=MPI_MAX; break; - default: goto comm_allreduce_byhand; - } --#ifdef USE_NBC -+#ifdef GSLIB_USE_NBC - MPI_Iallreduce(v,buf,vn,mpitype,mpiop,com->c,req); - #else - fail(1,"comm_iallreduce",__LINE__,"Invalid call to MPI_Iallreduce!\n"); -@@ -197,7 +197,7 @@ double comm_dot(const struct comm *comm, double *v, double *w, uint n) - do { T v = *in++; GS_DO_##OP(accum,v); } while(--n) - - #define DEFINE_REDUCE(T) \ --T PREFIXED_NAME(comm_reduce__##T)( \ -+T GS_PREFIXED_NAME(comm_reduce__##T)( \ - const struct comm *comm, gs_op op, const T *in, uint n) \ - { \ - T accum = gs_identity_##T[op], buf; \ -diff --git a/src/comm.h b/src/comm.h -index b047cd5..72a54fe 100644 ---- a/src/comm.h -+++ b/src/comm.h -@@ -1,5 +1,5 @@ --#ifndef COMM_H --#define COMM_H -+#ifndef GS_COMM_H -+#define GS_COMM_H - - /* requires: - for size_t -@@ -10,7 +10,7 @@ - - #include - #include --#if !defined(FAIL_H) || !defined(TYPES_H) -+#if !defined(GS_FAIL_H) || !defined(GS_TYPES_H) - #warning "comm.h" requires "fail.h" and "types.h" - #endif - -@@ -72,15 +72,15 @@ typedef int comm_req; - typedef int MPI_Fint; - #endif - --#define comm_allreduce PREFIXED_NAME(comm_allreduce ) --#define comm_iallreduce PREFIXED_NAME(comm_iallreduce) --#define comm_scan PREFIXED_NAME(comm_scan ) --#define comm_dot PREFIXED_NAME(comm_dot ) -+#define comm_allreduce GS_PREFIXED_NAME(comm_allreduce ) -+#define comm_iallreduce GS_PREFIXED_NAME(comm_iallreduce) -+#define comm_scan GS_PREFIXED_NAME(comm_scan ) -+#define comm_dot GS_PREFIXED_NAME(comm_dot ) - - /* global id, np vars strictly for diagnostic messages (fail.c) */ - #ifndef comm_gbl_id --#define comm_gbl_id PREFIXED_NAME(comm_gbl_id) --#define comm_gbl_np PREFIXED_NAME(comm_gbl_np) -+#define comm_gbl_id GS_PREFIXED_NAME(comm_gbl_id) -+#define comm_gbl_np GS_PREFIXED_NAME(comm_gbl_np) - extern uint comm_gbl_id, comm_gbl_np; - #endif - -@@ -121,17 +121,17 @@ void comm_scan(void *scan, const struct comm *com, gs_dom dom, gs_op op, - const void *v, uint vn, void *buffer); - - #define DEFINE_REDUCE(T) \ --T PREFIXED_NAME(comm_reduce__##T)( \ -+T GS_PREFIXED_NAME(comm_reduce__##T)( \ - const struct comm *comm, gs_op op, const T *in, uint n); \ - static T comm_reduce_##T(const struct comm *c, gs_op op, const T *v, uint vn) \ --{ return PREFIXED_NAME(comm_reduce__##T)(c,op,v,vn); } -+{ return GS_PREFIXED_NAME(comm_reduce__##T)(c,op,v,vn); } - GS_FOR_EACH_DOMAIN(DEFINE_REDUCE) - #undef DEFINE_REDUCE - - #define comm_reduce_sint \ -- TYPE_LOCAL(comm_reduce_int,comm_reduce_long,comm_reduce_long_long) -+ GS_TYPE_LOCAL(comm_reduce_int,comm_reduce_long,comm_reduce_long_long) - #define comm_reduce_slong \ -- TYPE_GLOBAL(comm_reduce_int,comm_reduce_long,comm_reduce_long_long) -+ GS_TYPE_GLOBAL(comm_reduce_int,comm_reduce_long,comm_reduce_long_long) - - #endif - -diff --git a/src/crystal.c b/src/crystal.c -index 6381394..d7eab1f 100644 ---- a/src/crystal.c -+++ b/src/crystal.c -@@ -45,9 +45,9 @@ - #include "mem.h" - #include - --#define crystal_init PREFIXED_NAME(crystal_init ) --#define crystal_free PREFIXED_NAME(crystal_free ) --#define crystal_router PREFIXED_NAME(crystal_router) -+#define crystal_init GS_PREFIXED_NAME(crystal_init ) -+#define crystal_free GS_PREFIXED_NAME(crystal_free ) -+#define crystal_router GS_PREFIXED_NAME(crystal_router) - - struct crystal { - struct comm comm; -diff --git a/src/crystal.h b/src/crystal.h -index b6d4582..67d3c4e 100644 ---- a/src/crystal.h -+++ b/src/crystal.h -@@ -1,13 +1,13 @@ --#ifndef CRYSTAL_H --#define CRYSTAL_H -+#ifndef GS_CRYSTAL_H -+#define GS_CRYSTAL_H - --#if !defined(COMM_H) || !defined(MEM_H) -+#if !defined(GS_COMM_H) || !defined(GS_MEM_H) - #warning "crystal.h" requires "comm.h" and "mem.h" - #endif - --#define crystal_init PREFIXED_NAME(crystal_init ) --#define crystal_free PREFIXED_NAME(crystal_free ) --#define crystal_router PREFIXED_NAME(crystal_router) -+#define crystal_init GS_PREFIXED_NAME(crystal_init ) -+#define crystal_free GS_PREFIXED_NAME(crystal_free ) -+#define crystal_router GS_PREFIXED_NAME(crystal_router) - - struct crystal { - struct comm comm; -diff --git a/src/fail.c b/src/fail.c -index 9ac04bd..6d007a5 100644 ---- a/src/fail.c -+++ b/src/fail.c -@@ -7,8 +7,8 @@ - #include "types.h" - #include "comm.h" - --#ifdef USE_USR_EXIT --#define userExitHandler FORTRAN_NAME(userexithandler,USEREXITHANDLER) -+#ifdef GSLIB_USE_USR_EXIT -+#define userExitHandler GS_FORTRAN_NAME(userexithandler,USEREXITHANDLER) - #define USEREXIT 1 - extern void userExitHandler(int status); - #else -diff --git a/src/fail.h b/src/fail.h -index 0185110..1ce10b2 100644 ---- a/src/fail.h -+++ b/src/fail.h -@@ -1,15 +1,15 @@ --#ifndef FAIL_H --#define FAIL_H -+#ifndef GS_FAIL_H -+#define GS_FAIL_H - --#if !defined(NAME_H) -+#if !defined(GS_NAME_H) - #warning "fail.h" requires "name.h" - #endif - --#define die PREFIXED_NAME( die ) --#define vdiagnostic PREFIXED_NAME(vdiagnostic) --#define diagnostic PREFIXED_NAME( diagnostic) --#define vfail PREFIXED_NAME(vfail ) --#define fail PREFIXED_NAME( fail ) -+#define die GS_PREFIXED_NAME( die ) -+#define vdiagnostic GS_PREFIXED_NAME(vdiagnostic) -+#define diagnostic GS_PREFIXED_NAME( diagnostic) -+#define vfail GS_PREFIXED_NAME(vfail ) -+#define fail GS_PREFIXED_NAME( fail ) - - #ifdef __GNUC__ - # define ATTRBD __attribute__ ((noreturn)) -diff --git a/src/fcrystal.c b/src/fcrystal.c -index 3fe4c9a..44f96f5 100644 ---- a/src/fcrystal.c -+++ b/src/fcrystal.c -@@ -65,20 +65,20 @@ - --------------------------------------------------------------------------*/ - - #undef crystal_free --#define ccrystal_free PREFIXED_NAME(crystal_free) -+#define ccrystal_free GS_PREFIXED_NAME(crystal_free) - - #define fcrystal_setup \ -- FORTRAN_NAME(crystal_setup ,CRYSTAL_SETUP ) -+ GS_FORTRAN_NAME(crystal_setup ,CRYSTAL_SETUP ) - #define fcrystal_ituple_sort \ -- FORTRAN_NAME(crystal_ituple_sort ,CRYSTAL_ITUPLE_SORT ) -+ GS_FORTRAN_NAME(crystal_ituple_sort ,CRYSTAL_ITUPLE_SORT ) - #define fcrystal_tuple_sort \ -- FORTRAN_NAME(crystal_tuple_sort ,CRYSTAL_TUPLE_SORT ) -+ GS_FORTRAN_NAME(crystal_tuple_sort ,CRYSTAL_TUPLE_SORT ) - #define fcrystal_ituple_transfer \ -- FORTRAN_NAME(crystal_ituple_transfer,CRYSTAL_ITUPLE_TRANSFER) -+ GS_FORTRAN_NAME(crystal_ituple_transfer,CRYSTAL_ITUPLE_TRANSFER) - #define fcrystal_tuple_transfer \ -- FORTRAN_NAME(crystal_tuple_transfer ,CRYSTAL_TUPLE_TRANSFER ) -+ GS_FORTRAN_NAME(crystal_tuple_transfer ,CRYSTAL_TUPLE_TRANSFER ) - #define fcrystal_free \ -- FORTRAN_NAME(crystal_free ,CRYSTAL_FREE ) -+ GS_FORTRAN_NAME(crystal_free ,CRYSTAL_FREE ) - - static struct crystal **handle_array = 0; - static int handle_max = 0; -diff --git a/src/findpts.c b/src/findpts.c -index 86ac948..c708fda 100644 ---- a/src/findpts.c -+++ b/src/findpts.c -@@ -117,8 +117,8 @@ static uint count_bits(unsigned char *p, uint n) - approx number of cells per proc for the distributed - global geometric hash table - NOTE: gbl_hash_size*np needs to fit in a "global" integer -- (controlled by -DGLOBAL_LONG or -DGLOBAL_LONG_LONG; -- see "types.h") -+ (controlled by -DGSLIB_USE_GLOBAL_LONG or -+ -DGSLIB_USE_GLOBAL_LONG_LONG; see "types.h") - actual number of cells per proc will be greater by - ~ 3 gbl_hash_size^(2/3) / np^(1/3) - -@@ -227,17 +227,17 @@ static uint count_bits(unsigned char *p, uint n) - - --------------------------------------------------------------------------*/ - --#define ffindptsms_setup FORTRAN_NAME(findptsms_setup ,FINDPTSMS_SETUP ) --#define ffindptsms_free FORTRAN_NAME(findptsms_free ,FINDPTSMS_FREE ) --#define ffindptsms FORTRAN_NAME(findptsms ,FINDPTSMS ) --#define ffindptsms_eval FORTRAN_NAME(findptsms_eval ,FINDPTSMS_EVAL ) --#define ffindptsms_eval_local FORTRAN_NAME(findptsms_eval_local,FINDPTSMS_EVAL_LOCAL) -+#define ffindptsms_setup GS_FORTRAN_NAME(findptsms_setup ,FINDPTSMS_SETUP ) -+#define ffindptsms_free GS_FORTRAN_NAME(findptsms_free ,FINDPTSMS_FREE ) -+#define ffindptsms GS_FORTRAN_NAME(findptsms ,FINDPTSMS ) -+#define ffindptsms_eval GS_FORTRAN_NAME(findptsms_eval ,FINDPTSMS_EVAL ) -+#define ffindptsms_eval_local GS_FORTRAN_NAME(findptsms_eval_local,FINDPTSMS_EVAL_LOCAL) - --#define ffindpts_setup FORTRAN_NAME(findpts_setup ,FINDPTS_SETUP ) --#define ffindpts_free FORTRAN_NAME(findpts_free ,FINDPTS_FREE ) --#define ffindpts FORTRAN_NAME(findpts ,FINDPTS ) --#define ffindpts_eval FORTRAN_NAME(findpts_eval ,FINDPTS_EVAL ) --#define ffindpts_eval_local FORTRAN_NAME(findpts_eval_local,FINDPTS_EVAL_LOCAL) -+#define ffindpts_setup GS_FORTRAN_NAME(findpts_setup ,FINDPTS_SETUP ) -+#define ffindpts_free GS_FORTRAN_NAME(findpts_free ,FINDPTS_FREE ) -+#define ffindpts GS_FORTRAN_NAME(findpts ,FINDPTS ) -+#define ffindpts_eval GS_FORTRAN_NAME(findpts_eval ,FINDPTS_EVAL ) -+#define ffindpts_eval_local GS_FORTRAN_NAME(findpts_eval_local,FINDPTS_EVAL_LOCAL) - - struct handle { void *data; unsigned ndim; }; - static struct handle *handle_array = 0; -@@ -363,9 +363,9 @@ void ffindptsms_free(const sint *const handle) - { - CHECK_HANDLE("findptsms_free"); - if(h->ndim==2) -- PREFIXED_NAME(findptsms_free_2)(h->data); -+ GS_PREFIXED_NAME(findptsms_free_2)(h->data); - else -- PREFIXED_NAME(findptsms_free_3)(h->data); -+ GS_PREFIXED_NAME(findptsms_free_3)(h->data); - h->data = 0; - } - -@@ -373,9 +373,9 @@ void ffindpts_free(const sint *const handle) - { - CHECK_HANDLE("findpts_free"); - if(h->ndim==2) -- PREFIXED_NAME(findpts_free_2)(h->data); -+ GS_PREFIXED_NAME(findpts_free_2)(h->data); - else -- PREFIXED_NAME(findpts_free_3)(h->data); -+ GS_PREFIXED_NAME(findpts_free_3)(h->data); - h->data = 0; - } - -@@ -405,7 +405,7 @@ void ffindptsms(const sint *const handle, - sess_stride = *session_id_stride*sizeof(uint); - sess_match = session_id_match; - -- PREFIXED_NAME(findptsms_2)( -+ GS_PREFIXED_NAME(findptsms_2)( - (uint*) code_base,(* code_stride)*sizeof(sint ), - (uint*) proc_base,(* proc_stride)*sizeof(sint ), - (uint*) el_base,(* el_stride)*sizeof(sint ), -@@ -428,7 +428,7 @@ void ffindptsms(const sint *const handle, - sess_stride = *session_id_stride*sizeof(uint); - sess_match = session_id_match; - -- PREFIXED_NAME(findptsms_3)( -+ GS_PREFIXED_NAME(findptsms_3)( - (uint*) code_base,(* code_stride)*sizeof(sint ), - (uint*) proc_base,(* proc_stride)*sizeof(sint ), - (uint*) el_base,(* el_stride)*sizeof(sint ), -@@ -459,7 +459,7 @@ void ffindpts(const sint *const handle, - xv_stride[0] = *x_stride*sizeof(double), - xv_stride[1] = *y_stride*sizeof(double); - -- PREFIXED_NAME(findpts_2)( -+ GS_PREFIXED_NAME(findpts_2)( - (uint*) code_base,(* code_stride)*sizeof(sint ), - (uint*) proc_base,(* proc_stride)*sizeof(sint ), - (uint*) el_base,(* el_stride)*sizeof(sint ), -@@ -475,7 +475,7 @@ void ffindpts(const sint *const handle, - xv_stride[1] = *y_stride*sizeof(double), - xv_stride[2] = *z_stride*sizeof(double); - -- PREFIXED_NAME(findpts_3)( -+ GS_PREFIXED_NAME(findpts_3)( - (uint*) code_base,(* code_stride)*sizeof(sint ), - (uint*) proc_base,(* proc_stride)*sizeof(sint ), - (uint*) el_base,(* el_stride)*sizeof(sint ), -@@ -497,7 +497,7 @@ void ffindptsms_eval(const sint *const handle, - { - CHECK_HANDLE("findptsms_eval"); - if(h->ndim==2) -- PREFIXED_NAME(findptsms_eval_2)( -+ GS_PREFIXED_NAME(findptsms_eval_2)( - out_base,(* out_stride)*sizeof(double), - (uint*)code_base,(*code_stride)*sizeof(sint ), - (uint*)proc_base,(*proc_stride)*sizeof(sint ), -@@ -505,7 +505,7 @@ void ffindptsms_eval(const sint *const handle, - r_base,(* r_stride)*sizeof(double), - *npt, in, h->data); - else -- PREFIXED_NAME(findptsms_eval_3)( -+ GS_PREFIXED_NAME(findptsms_eval_3)( - out_base,(* out_stride)*sizeof(double), - (uint*)code_base,(*code_stride)*sizeof(sint ), - (uint*)proc_base,(*proc_stride)*sizeof(sint ), -@@ -524,7 +524,7 @@ void ffindpts_eval(const sint *const handle, - { - CHECK_HANDLE("findpts_eval"); - if(h->ndim==2) -- PREFIXED_NAME(findpts_eval_2)( -+ GS_PREFIXED_NAME(findpts_eval_2)( - out_base,(* out_stride)*sizeof(double), - (uint*)code_base,(*code_stride)*sizeof(sint ), - (uint*)proc_base,(*proc_stride)*sizeof(sint ), -@@ -532,7 +532,7 @@ void ffindpts_eval(const sint *const handle, - r_base,(* r_stride)*sizeof(double), - *npt, in, h->data); - else -- PREFIXED_NAME(findpts_eval_3)( -+ GS_PREFIXED_NAME(findpts_eval_3)( - out_base,(* out_stride)*sizeof(double), - (uint*)code_base,(*code_stride)*sizeof(sint ), - (uint*)proc_base,(*proc_stride)*sizeof(sint ), -diff --git a/src/findpts.h b/src/findpts.h -index c8a1ab3..af2071d 100644 ---- a/src/findpts.h -+++ b/src/findpts.h -@@ -1,27 +1,27 @@ --#ifndef FINDPTSMS_H --#define FINDPTSMS_H -+#ifndef GS_FINDPTSMS_H -+#define GS_FINDPTSMS_H - --#if !defined(COMM_H) -+#if !defined(GS_COMM_H) - #warning "findpts.h" requires "comm.h" - #endif - --#define findptsms_setup_2 PREFIXED_NAME(findptsms_setup_2) --#define findptsms_free_2 PREFIXED_NAME(findptsms_free_2 ) --#define findptsms_2 PREFIXED_NAME(findptsms_2 ) --#define findptsms_eval_2 PREFIXED_NAME(findptsms_eval_2 ) --#define findptsms_setup_3 PREFIXED_NAME(findptsms_setup_3) --#define findptsms_free_3 PREFIXED_NAME(findptsms_free_3 ) --#define findptsms_3 PREFIXED_NAME(findptsms_3 ) --#define findptsms_eval_3 PREFIXED_NAME(findptsms_eval_3 ) -- --#define findpts_setup_2 PREFIXED_NAME(findpts_setup_2) --#define findpts_free_2 PREFIXED_NAME(findpts_free_2 ) --#define findpts_2 PREFIXED_NAME(findpts_2 ) --#define findpts_eval_2 PREFIXED_NAME(findpts_eval_2 ) --#define findpts_setup_3 PREFIXED_NAME(findpts_setup_3) --#define findpts_free_3 PREFIXED_NAME(findpts_free_3 ) --#define findpts_3 PREFIXED_NAME(findpts_3 ) --#define findpts_eval_3 PREFIXED_NAME(findpts_eval_3 ) -+#define findptsms_setup_2 GS_PREFIXED_NAME(findptsms_setup_2) -+#define findptsms_free_2 GS_PREFIXED_NAME(findptsms_free_2 ) -+#define findptsms_2 GS_PREFIXED_NAME(findptsms_2 ) -+#define findptsms_eval_2 GS_PREFIXED_NAME(findptsms_eval_2 ) -+#define findptsms_setup_3 GS_PREFIXED_NAME(findptsms_setup_3) -+#define findptsms_free_3 GS_PREFIXED_NAME(findptsms_free_3 ) -+#define findptsms_3 GS_PREFIXED_NAME(findptsms_3 ) -+#define findptsms_eval_3 GS_PREFIXED_NAME(findptsms_eval_3 ) -+ -+#define findpts_setup_2 GS_PREFIXED_NAME(findpts_setup_2) -+#define findpts_free_2 GS_PREFIXED_NAME(findpts_free_2 ) -+#define findpts_2 GS_PREFIXED_NAME(findpts_2 ) -+#define findpts_eval_2 GS_PREFIXED_NAME(findpts_eval_2 ) -+#define findpts_setup_3 GS_PREFIXED_NAME(findpts_setup_3) -+#define findpts_free_3 GS_PREFIXED_NAME(findpts_free_3 ) -+#define findpts_3 GS_PREFIXED_NAME(findpts_3 ) -+#define findpts_eval_3 GS_PREFIXED_NAME(findpts_eval_3 ) - - struct findpts_data_2; - struct findpts_data_3; -diff --git a/src/findpts_el.h b/src/findpts_el.h -index 4ed119a..ba731cd 100644 ---- a/src/findpts_el.h -+++ b/src/findpts_el.h -@@ -1,14 +1,14 @@ --#ifndef FINDPTS_EL_H --#define FINDPTS_EL_H -+#ifndef GS_FINDPTS_EL_H -+#define GS_FINDPTS_EL_H - --#if !defined(NAME_H) || !defined(POLY_H) -+#if !defined(GS_NAME_H) || !defined(GS_POLY_H) - #warning "findpts_el.h" requires "name.h", "poly.h" - #endif - --#define findpts_el_setup_2 PREFIXED_NAME(findpts_el_setup_2) --#define findpts_el_free_2 PREFIXED_NAME(findpts_el_free_2 ) --#define findpts_el_2 PREFIXED_NAME(findpts_el_2 ) --#define findpts_el_eval_2 PREFIXED_NAME(findpts_el_eval_2 ) -+#define findpts_el_setup_2 GS_PREFIXED_NAME(findpts_el_setup_2) -+#define findpts_el_free_2 GS_PREFIXED_NAME(findpts_el_free_2 ) -+#define findpts_el_2 GS_PREFIXED_NAME(findpts_el_2 ) -+#define findpts_el_eval_2 GS_PREFIXED_NAME(findpts_el_eval_2 ) - - struct findpts_el_pt_2 { - double x[2],r[2],oldr[2],dist2,dist2p,tr; -@@ -60,10 +60,10 @@ static struct findpts_el_pt_2 *findpts_el_points_2( - return fd->p; - } - --#define findpts_el_setup_3 PREFIXED_NAME(findpts_el_setup_3) --#define findpts_el_free_3 PREFIXED_NAME(findpts_el_free_3 ) --#define findpts_el_3 PREFIXED_NAME(findpts_el_3 ) --#define findpts_el_eval_3 PREFIXED_NAME(findpts_el_eval_3 ) -+#define findpts_el_setup_3 GS_PREFIXED_NAME(findpts_el_setup_3) -+#define findpts_el_free_3 GS_PREFIXED_NAME(findpts_el_free_3 ) -+#define findpts_el_3 GS_PREFIXED_NAME(findpts_el_3 ) -+#define findpts_el_eval_3 GS_PREFIXED_NAME(findpts_el_eval_3 ) - - struct findpts_el_pt_3 { - double x[3],r[3],oldr[3],dist2,dist2p,tr; -diff --git a/src/findpts_el_2.c b/src/findpts_el_2.c -index b33f768..aad9aad 100644 ---- a/src/findpts_el_2.c -+++ b/src/findpts_el_2.c -@@ -13,10 +13,10 @@ - #include "tensor.h" - #include "poly.h" - --#define findpts_el_setup_2 PREFIXED_NAME(findpts_el_setup_2) --#define findpts_el_free_2 PREFIXED_NAME(findpts_el_free_2 ) --#define findpts_el_2 PREFIXED_NAME(findpts_el_2 ) --#define findpts_el_eval_2 PREFIXED_NAME(findpts_el_eval_2 ) -+#define findpts_el_setup_2 GS_PREFIXED_NAME(findpts_el_setup_2) -+#define findpts_el_free_2 GS_PREFIXED_NAME(findpts_el_free_2 ) -+#define findpts_el_2 GS_PREFIXED_NAME(findpts_el_2 ) -+#define findpts_el_eval_2 GS_PREFIXED_NAME(findpts_el_eval_2 ) - /* - #define DIAGNOSTICS_1 - #define DIAGNOSTICS_2 -diff --git a/src/findpts_el_3.c b/src/findpts_el_3.c -index 42c335c..62561ff 100644 ---- a/src/findpts_el_3.c -+++ b/src/findpts_el_3.c -@@ -11,10 +11,10 @@ - #include "tensor.h" - #include "poly.h" - --#define findpts_el_setup_3 PREFIXED_NAME(findpts_el_setup_3) --#define findpts_el_free_3 PREFIXED_NAME(findpts_el_free_3 ) --#define findpts_el_3 PREFIXED_NAME(findpts_el_3 ) --#define findpts_el_eval_3 PREFIXED_NAME(findpts_el_eval_3 ) -+#define findpts_el_setup_3 GS_PREFIXED_NAME(findpts_el_setup_3) -+#define findpts_el_free_3 GS_PREFIXED_NAME(findpts_el_free_3 ) -+#define findpts_el_3 GS_PREFIXED_NAME(findpts_el_3 ) -+#define findpts_el_eval_3 GS_PREFIXED_NAME(findpts_el_eval_3 ) - /* - #define DIAGNOSTICS_1 - #define DIAGNOSTICS_2 -diff --git a/src/findpts_imp.h b/src/findpts_imp.h -index b9759af..8c08479 100644 ---- a/src/findpts_imp.h -+++ b/src/findpts_imp.h -@@ -1,45 +1,44 @@ - #include - #include --#define obbox TOKEN_PASTE(obbox_,D) --#define local_hash_data TOKEN_PASTE(findpts_local_hash_data_,D) --#define hash_data TOKEN_PASTE(findpts_hash_data_,D) --#define hash_index TOKEN_PASTE(hash_index_ ,D) --#define hash_setfac TOKEN_PASTE(hash_setfac_ ,D) --#define hash_range TOKEN_PASTE(hash_range_ ,D) --#define hash_bb TOKEN_PASTE(hash_bb_ ,D) --#define set_local_mask TOKEN_PASTE(set_local_mask_ ,D) --#define fill_hash TOKEN_PASTE(fill_hash_ ,D) --#define table_from_hash TOKEN_PASTE(table_from_hash_ ,D) --#define hash_build TOKEN_PASTE(hash_build_ ,D) --#define hash_free TOKEN_PASTE(hash_free_ ,D) -- --#define findptsms_local_setup TOKEN_PASTE(PREFIXED_NAME(findptsms_local_setup_),D) --#define findptsms_local_free TOKEN_PASTE(PREFIXED_NAME(findptsms_local_free_ ),D) --#define findptsms_local TOKEN_PASTE(PREFIXED_NAME(findptsms_local_ ),D) --#define findptsms_local_eval TOKEN_PASTE(PREFIXED_NAME(findptsms_local_eval_ ),D) --#define findpts_dummy_ms_data TOKEN_PASTE(findpts_dummy_ms_data_,D) --#define findpts_data TOKEN_PASTE(findpts_data_,D) --#define src_pt TOKEN_PASTE(src_pt_ ,D) --#define out_pt TOKEN_PASTE(out_pt_ ,D) --#define eval_src_pt TOKEN_PASTE(eval_src_pt_ ,D) --#define eval_out_pt TOKEN_PASTE(eval_out_pt_ ,D) --#define setupms_aux TOKEN_PASTE(setupms_aux_,D) --#define findptsms_setup TOKEN_PASTE(PREFIXED_NAME(findptsms_setup_),D) --#define findptsms_free TOKEN_PASTE(PREFIXED_NAME(findptsms_free_ ),D) --#define findptsms TOKEN_PASTE(PREFIXED_NAME(findptsms_ ),D) --#define findptsms_eval TOKEN_PASTE(PREFIXED_NAME(findptsms_eval_ ),D) -- --#define findpts_local_data TOKEN_PASTE(findpts_local_data_,D) --#define findpts_local_setup TOKEN_PASTE(PREFIXED_NAME(findpts_local_setup_),D) --#define findpts_local_free TOKEN_PASTE(PREFIXED_NAME(findpts_local_free_ ),D) --#define findpts_local TOKEN_PASTE(PREFIXED_NAME(findpts_local_ ),D) --#define findpts_local_eval TOKEN_PASTE(PREFIXED_NAME(findpts_local_eval_ ),D) --#define findpts_setup TOKEN_PASTE(PREFIXED_NAME(findpts_setup_),D) --#define findpts_free TOKEN_PASTE(PREFIXED_NAME(findpts_free_ ),D) --#define findpts TOKEN_PASTE(PREFIXED_NAME(findpts_ ),D) --#define findpts_eval TOKEN_PASTE(PREFIXED_NAME(findpts_eval_ ),D) --#define findpts_local_eval TOKEN_PASTE(PREFIXED_NAME(findpts_local_eval_ ),D) --#define setup_fev_aux TOKEN_PASTE(setup_fev_aux_,D) -+#define obbox GS_TOKEN_PASTE(obbox_,D) -+#define local_hash_data GS_TOKEN_PASTE(findpts_local_hash_data_,D) -+#define hash_data GS_TOKEN_PASTE(findpts_hash_data_,D) -+#define hash_index GS_TOKEN_PASTE(hash_index_ ,D) -+#define hash_setfac GS_TOKEN_PASTE(hash_setfac_ ,D) -+#define hash_range GS_TOKEN_PASTE(hash_range_ ,D) -+#define hash_bb GS_TOKEN_PASTE(hash_bb_ ,D) -+#define set_local_mask GS_TOKEN_PASTE(set_local_mask_ ,D) -+#define fill_hash GS_TOKEN_PASTE(fill_hash_ ,D) -+#define table_from_hash GS_TOKEN_PASTE(table_from_hash_ ,D) -+#define hash_build GS_TOKEN_PASTE(hash_build_ ,D) -+#define hash_free GS_TOKEN_PASTE(hash_free_ ,D) -+ -+#define findptsms_local_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_setup_),D) -+#define findptsms_local_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_free_ ),D) -+#define findptsms_local GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_ ),D) -+#define findptsms_local_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_eval_ ),D) -+#define findpts_dummy_ms_data GS_TOKEN_PASTE(findpts_dummy_ms_data_,D) -+#define findpts_data GS_TOKEN_PASTE(findpts_data_,D) -+#define src_pt GS_TOKEN_PASTE(src_pt_ ,D) -+#define out_pt GS_TOKEN_PASTE(out_pt_ ,D) -+#define eval_src_pt GS_TOKEN_PASTE(eval_src_pt_ ,D) -+#define eval_out_pt GS_TOKEN_PASTE(eval_out_pt_ ,D) -+#define setupms_aux GS_TOKEN_PASTE(setupms_aux_,D) -+#define findptsms_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_setup_),D) -+#define findptsms_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_free_ ),D) -+#define findptsms GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_ ),D) -+#define findptsms_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_eval_ ),D) -+ -+#define findpts_local_data GS_TOKEN_PASTE(findpts_local_data_,D) -+#define findpts_local_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_setup_),D) -+#define findpts_local_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_free_ ),D) -+#define findpts_local GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_ ),D) -+#define findpts_local_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_eval_ ),D) -+#define findpts_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_setup_),D) -+#define findpts_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_free_ ),D) -+#define findpts GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_ ),D) -+#define findpts_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_eval_ ),D) -+#define setup_fev_aux GS_TOKEN_PASTE(setup_fev_aux_,D) - - struct hash_data { - ulong hash_n; -@@ -279,7 +278,10 @@ void findptsms( uint *const code_base, const unsigned code - const uint *const session_id_match, const uint npt, - struct findpts_data *const fd) - { -- if (fd->fevsetup==1) array_free(&fd->savpt); fd->fevsetup=0; -+ if (fd->fevsetup==1) { -+ array_free(&fd->savpt); -+ fd->fevsetup=0; -+ } - const uint np = fd->cr.comm.np, id=fd->cr.comm.id; - struct array hash_pt, src_pt, out_pt; - double *distv = tmalloc(double,npt); -diff --git a/src/findpts_local.h b/src/findpts_local.h -index 2a9d9da..30be675 100644 ---- a/src/findpts_local.h -+++ b/src/findpts_local.h -@@ -1,19 +1,19 @@ --#ifndef FINDPTS_LOCAL_H --#define FINDPTS_LOCAL_H -+#ifndef GS_FINDPTS_LOCAL_H -+#define GS_FINDPTS_LOCAL_H - --#if !defined(MEM_H) || !defined(FINDPTS_EL_H) || !defined(OBBOX_H) -+#if !defined(GS_MEM_H) || !defined(GS_FINDPTS_EL_H) || !defined(GS_OBBOX_H) - #warning "findpts_local.h" requires "mem.h", "findpts_el.h", "obbox.h" - #endif - --#define findptsms_local_setup_2 PREFIXED_NAME(findptsms_local_setup_2) --#define findptsms_local_free_2 PREFIXED_NAME(findptsms_local_free_2 ) --#define findptsms_local_2 PREFIXED_NAME(findptsms_local_2 ) --#define findptsms_local_eval_2 PREFIXED_NAME(findptsms_local_eval_2 ) -+#define findptsms_local_setup_2 GS_PREFIXED_NAME(findptsms_local_setup_2) -+#define findptsms_local_free_2 GS_PREFIXED_NAME(findptsms_local_free_2 ) -+#define findptsms_local_2 GS_PREFIXED_NAME(findptsms_local_2 ) -+#define findptsms_local_eval_2 GS_PREFIXED_NAME(findptsms_local_eval_2 ) - --#define findpts_local_setup_2 PREFIXED_NAME(findpts_local_setup_2) --#define findpts_local_free_2 PREFIXED_NAME(findpts_local_free_2 ) --#define findpts_local_2 PREFIXED_NAME(findpts_local_2 ) --#define findpts_local_eval_2 PREFIXED_NAME(findpts_local_eval_2 ) -+#define findpts_local_setup_2 GS_PREFIXED_NAME(findpts_local_setup_2) -+#define findpts_local_free_2 GS_PREFIXED_NAME(findpts_local_free_2 ) -+#define findpts_local_2 GS_PREFIXED_NAME(findpts_local_2 ) -+#define findpts_local_eval_2 GS_PREFIXED_NAME(findpts_local_eval_2 ) - - struct findpts_local_hash_data_2 { - uint hash_n; -@@ -85,15 +85,15 @@ void findpts_local_eval_2( - const uint npt, - const double *const in, struct findpts_local_data_2 *const fd); - --#define findptsms_local_setup_3 PREFIXED_NAME(findptsms_local_setup_3) --#define findptsms_local_free_3 PREFIXED_NAME(findptsms_local_free_3 ) --#define findptsms_local_3 PREFIXED_NAME(findptsms_local_3 ) --#define findptsms_local_eval_3 PREFIXED_NAME(findptsms_local_eval_3 ) -+#define findptsms_local_setup_3 GS_PREFIXED_NAME(findptsms_local_setup_3) -+#define findptsms_local_free_3 GS_PREFIXED_NAME(findptsms_local_free_3 ) -+#define findptsms_local_3 GS_PREFIXED_NAME(findptsms_local_3 ) -+#define findptsms_local_eval_3 GS_PREFIXED_NAME(findptsms_local_eval_3 ) - --#define findpts_local_setup_3 PREFIXED_NAME(findpts_local_setup_3) --#define findpts_local_free_3 PREFIXED_NAME(findpts_local_free_3 ) --#define findpts_local_3 PREFIXED_NAME(findpts_local_3 ) --#define findpts_local_eval_3 PREFIXED_NAME(findpts_local_eval_3 ) -+#define findpts_local_setup_3 GS_PREFIXED_NAME(findpts_local_setup_3) -+#define findpts_local_free_3 GS_PREFIXED_NAME(findpts_local_free_3 ) -+#define findpts_local_3 GS_PREFIXED_NAME(findpts_local_3 ) -+#define findpts_local_eval_3 GS_PREFIXED_NAME(findpts_local_eval_3 ) - struct findpts_local_hash_data_3 { - uint hash_n; - struct dbl_range bnd[3]; -diff --git a/src/findpts_local_imp.h b/src/findpts_local_imp.h -index e5310b1..401089d 100644 ---- a/src/findpts_local_imp.h -+++ b/src/findpts_local_imp.h -@@ -1,36 +1,36 @@ - #include --#define obbox TOKEN_PASTE(obbox_ ,D) --#define obbox_calc TOKEN_PASTE(PREFIXED_NAME(obbox_calc_),D) --#define obbox_test TOKEN_PASTE(obbox_test_ ,D) --#define hash_data TOKEN_PASTE(findpts_local_hash_data_,D) --#define hash_index TOKEN_PASTE(hash_index_ ,D) --#define hash_setfac TOKEN_PASTE(hash_setfac_ ,D) --#define hash_range TOKEN_PASTE(hash_range_ ,D) --#define hash_count TOKEN_PASTE(hash_count_ ,D) --#define hash_opt_size TOKEN_PASTE(hash_opt_size_ ,D) --#define hash_bb TOKEN_PASTE(hash_bb_ ,D) --#define hash_build TOKEN_PASTE(hash_build_ ,D) --#define hash_free TOKEN_PASTE(hash_free_ ,D) --#define findpts_el_data TOKEN_PASTE(findpts_el_data_ ,D) --#define findpts_el_pt TOKEN_PASTE(findpts_el_pt_ ,D) --#define findpts_el_setup TOKEN_PASTE(PREFIXED_NAME(findpts_el_setup_),D) --#define findpts_el_free TOKEN_PASTE(PREFIXED_NAME(findpts_el_free_ ),D) --#define findpts_el TOKEN_PASTE(PREFIXED_NAME(findpts_el_ ),D) --#define findpts_el_eval TOKEN_PASTE(PREFIXED_NAME(findpts_el_eval_ ),D) --#define findpts_el_start TOKEN_PASTE(findpts_el_start_ ,D) --#define findpts_el_points TOKEN_PASTE(findpts_el_points_ ,D) --#define findpts_local_data TOKEN_PASTE(findpts_local_data_,D) --#define map_points_to_els TOKEN_PASTE(map_points_to_els_ ,D) -- --#define findptsms_local_setup TOKEN_PASTE(PREFIXED_NAME(findptsms_local_setup_),D) --#define findptsms_local_free TOKEN_PASTE(PREFIXED_NAME(findptsms_local_free_ ),D) --#define findptsms_local TOKEN_PASTE(PREFIXED_NAME(findptsms_local_ ),D) --#define findptsms_local_eval TOKEN_PASTE(PREFIXED_NAME(findptsms_local_eval_ ),D) -- --#define findpts_local_setup TOKEN_PASTE(PREFIXED_NAME(findpts_local_setup_),D) --#define findpts_local_free TOKEN_PASTE(PREFIXED_NAME(findpts_local_free_ ),D) --#define findpts_local TOKEN_PASTE(PREFIXED_NAME(findpts_local_ ),D) --#define findpts_local_eval TOKEN_PASTE(PREFIXED_NAME(findpts_local_eval_ ),D) -+#define obbox GS_TOKEN_PASTE(obbox_ ,D) -+#define obbox_calc GS_TOKEN_PASTE(GS_PREFIXED_NAME(obbox_calc_),D) -+#define obbox_test GS_TOKEN_PASTE(obbox_test_ ,D) -+#define hash_data GS_TOKEN_PASTE(findpts_local_hash_data_,D) -+#define hash_index GS_TOKEN_PASTE(hash_index_ ,D) -+#define hash_setfac GS_TOKEN_PASTE(hash_setfac_ ,D) -+#define hash_range GS_TOKEN_PASTE(hash_range_ ,D) -+#define hash_count GS_TOKEN_PASTE(hash_count_ ,D) -+#define hash_opt_size GS_TOKEN_PASTE(hash_opt_size_ ,D) -+#define hash_bb GS_TOKEN_PASTE(hash_bb_ ,D) -+#define hash_build GS_TOKEN_PASTE(hash_build_ ,D) -+#define hash_free GS_TOKEN_PASTE(hash_free_ ,D) -+#define findpts_el_data GS_TOKEN_PASTE(findpts_el_data_ ,D) -+#define findpts_el_pt GS_TOKEN_PASTE(findpts_el_pt_ ,D) -+#define findpts_el_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_el_setup_),D) -+#define findpts_el_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_el_free_ ),D) -+#define findpts_el GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_el_ ),D) -+#define findpts_el_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_el_eval_ ),D) -+#define findpts_el_start GS_TOKEN_PASTE(findpts_el_start_ ,D) -+#define findpts_el_points GS_TOKEN_PASTE(findpts_el_points_ ,D) -+#define findpts_local_data GS_TOKEN_PASTE(findpts_local_data_,D) -+#define map_points_to_els GS_TOKEN_PASTE(map_points_to_els_ ,D) -+ -+#define findptsms_local_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_setup_),D) -+#define findptsms_local_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_free_ ),D) -+#define findptsms_local GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_ ),D) -+#define findptsms_local_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findptsms_local_eval_ ),D) -+ -+#define findpts_local_setup GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_setup_),D) -+#define findpts_local_free GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_free_ ),D) -+#define findpts_local GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_ ),D) -+#define findpts_local_eval GS_TOKEN_PASTE(GS_PREFIXED_NAME(findpts_local_eval_ ),D) - /*-------------------------------------------------------------------------- - Point to Possible Elements Hashing - -@@ -466,7 +466,7 @@ void findpts_local_eval( - const uint npt, - const double *const in, struct findpts_local_data *const fd) - { -- findpts_local_eval( -+ findptsms_local_eval( - out_base,out_stride, - el_base,el_stride, - r_base,r_stride, -diff --git a/src/gs.c b/src/gs.c -index 68581b3..e3a7b70 100644 ---- a/src/gs.c -+++ b/src/gs.c -@@ -19,19 +19,19 @@ - #include "sarray_sort.h" - #include "sarray_transfer.h" - --#define gs PREFIXED_NAME(gs ) --#define gs_vec PREFIXED_NAME(gs_vec ) --#define gs_many PREFIXED_NAME(gs_many ) --#define igs PREFIXED_NAME(igs ) --#define igs_vec PREFIXED_NAME(igs_vec ) --#define igs_many PREFIXED_NAME(igs_many ) --#define gs_wait PREFIXED_NAME(gs_wait ) --#define gs_setup PREFIXED_NAME(gs_setup ) --#define gs_free PREFIXED_NAME(gs_free ) --#define gs_unique PREFIXED_NAME(gs_unique) --#define gs_hf2c PREFIXED_NAME(gs_hf2c ) --#define pw_data_nmsg PREFIXED_NAME(pw_data_nmsg ) --#define pw_data_size PREFIXED_NAME(pw_data_size ) -+#define gs GS_PREFIXED_NAME(gs ) -+#define gs_vec GS_PREFIXED_NAME(gs_vec ) -+#define gs_many GS_PREFIXED_NAME(gs_many ) -+#define igs GS_PREFIXED_NAME(igs ) -+#define igs_vec GS_PREFIXED_NAME(igs_vec ) -+#define igs_many GS_PREFIXED_NAME(igs_many ) -+#define gs_wait GS_PREFIXED_NAME(gs_wait ) -+#define gs_setup GS_PREFIXED_NAME(gs_setup ) -+#define gs_free GS_PREFIXED_NAME(gs_free ) -+#define gs_unique GS_PREFIXED_NAME(gs_unique) -+#define gs_hf2c GS_PREFIXED_NAME(gs_hf2c ) -+#define pw_data_nmsg GS_PREFIXED_NAME(pw_data_nmsg ) -+#define pw_data_size GS_PREFIXED_NAME(pw_data_size ) - - GS_DEFINE_DOM_SIZES() - -@@ -1497,29 +1497,29 @@ void pw_data_size(struct gs_data *gsh, int *n) - #undef igs_many - #undef gs_wait - --#define cgs PREFIXED_NAME(gs ) --#define cgs_vec PREFIXED_NAME(gs_vec ) --#define cgs_many PREFIXED_NAME(gs_many ) --#define cgs_setup PREFIXED_NAME(gs_setup) --#define cgs_free PREFIXED_NAME(gs_free ) --#define cgs_unique PREFIXED_NAME(gs_unique) --#define cigs PREFIXED_NAME(igs ) --#define cigs_vec PREFIXED_NAME(igs_vec ) --#define cigs_many PREFIXED_NAME(igs_many) --#define cgs_wait PREFIXED_NAME(gs_wait ) -- --#define fgs_setup_pick FORTRAN_NAME(gs_setup_pick,GS_SETUP_PICK) --#define fgs_setup FORTRAN_NAME(gs_setup ,GS_SETUP ) --#define fgs FORTRAN_NAME(gs_op ,GS_OP ) --#define fgs_vec FORTRAN_NAME(gs_op_vec ,GS_OP_VEC ) --#define fgs_many FORTRAN_NAME(gs_op_many ,GS_OP_MANY ) --#define figs FORTRAN_NAME(igs_op ,IGS_OP ) --#define figs_vec FORTRAN_NAME(igs_op_vec ,IGS_OP_VEC ) --#define figs_many FORTRAN_NAME(igs_op_many ,IGS_OP_MANY ) --#define fgs_wait FORTRAN_NAME(gs_op_wait ,GS_OP_WAIT ) --#define fgs_fields FORTRAN_NAME(gs_op_fields ,GS_OP_FIELDS ) --#define fgs_free FORTRAN_NAME(gs_free ,GS_FREE ) --#define fgs_unique FORTRAN_NAME(gs_unique ,GS_UNIQUE ) -+#define cgs GS_PREFIXED_NAME(gs ) -+#define cgs_vec GS_PREFIXED_NAME(gs_vec ) -+#define cgs_many GS_PREFIXED_NAME(gs_many ) -+#define cgs_setup GS_PREFIXED_NAME(gs_setup) -+#define cgs_free GS_PREFIXED_NAME(gs_free ) -+#define cgs_unique GS_PREFIXED_NAME(gs_unique) -+#define cigs GS_PREFIXED_NAME(igs ) -+#define cigs_vec GS_PREFIXED_NAME(igs_vec ) -+#define cigs_many GS_PREFIXED_NAME(igs_many) -+#define cgs_wait GS_PREFIXED_NAME(gs_wait ) -+ -+#define fgs_setup_pick GS_FORTRAN_NAME(gs_setup_pick,GS_SETUP_PICK) -+#define fgs_setup GS_FORTRAN_NAME(gs_setup ,GS_SETUP ) -+#define fgs GS_FORTRAN_NAME(gs_op ,GS_OP ) -+#define fgs_vec GS_FORTRAN_NAME(gs_op_vec ,GS_OP_VEC ) -+#define fgs_many GS_FORTRAN_NAME(gs_op_many ,GS_OP_MANY ) -+#define figs GS_FORTRAN_NAME(igs_op ,IGS_OP ) -+#define figs_vec GS_FORTRAN_NAME(igs_op_vec ,IGS_OP_VEC ) -+#define figs_many GS_FORTRAN_NAME(igs_op_many ,IGS_OP_MANY ) -+#define fgs_wait GS_FORTRAN_NAME(gs_op_wait ,GS_OP_WAIT ) -+#define fgs_fields GS_FORTRAN_NAME(gs_op_fields ,GS_OP_FIELDS ) -+#define fgs_free GS_FORTRAN_NAME(gs_free ,GS_FREE ) -+#define fgs_unique GS_FORTRAN_NAME(gs_unique ,GS_UNIQUE ) - - static struct gs_data **fgs_info = 0; - static int fgs_max = 0; -diff --git a/src/gs.h b/src/gs.h -index a06c99f..83a0591 100644 ---- a/src/gs.h -+++ b/src/gs.h -@@ -1,7 +1,7 @@ - #ifndef GS_H - #define GS_H - --#if !defined(COMM_H) || !defined(GS_DEFS_H) || !defined(MEM_H) -+#if !defined(GS_COMM_H) || !defined(GS_DEFS_H) || !defined(GS_MEM_H) - #warning "gs.h" requires "comm.h", "gs_defs.h", and "mem.h" - #endif - -@@ -116,19 +116,19 @@ - - */ - --#define gs PREFIXED_NAME(gs ) --#define gs_vec PREFIXED_NAME(gs_vec ) --#define gs_many PREFIXED_NAME(gs_many ) --#define igs PREFIXED_NAME(igs ) --#define igs_vec PREFIXED_NAME(igs_vec ) --#define igs_many PREFIXED_NAME(igs_many ) --#define gs_wait PREFIXED_NAME(gs_wait ) --#define gs_setup PREFIXED_NAME(gs_setup ) --#define gs_free PREFIXED_NAME(gs_free ) --#define gs_unique PREFIXED_NAME(gs_unique) --#define gs_hf2c PREFIXED_NAME(gs_hf2c ) --#define pw_data_nmsg PREFIXED_NAME(pw_data_nmsg ) --#define pw_data_size PREFIXED_NAME(pw_data_size ) -+#define gs GS_PREFIXED_NAME(gs ) -+#define gs_vec GS_PREFIXED_NAME(gs_vec ) -+#define gs_many GS_PREFIXED_NAME(gs_many ) -+#define igs GS_PREFIXED_NAME(igs ) -+#define igs_vec GS_PREFIXED_NAME(igs_vec ) -+#define igs_many GS_PREFIXED_NAME(igs_many ) -+#define gs_wait GS_PREFIXED_NAME(gs_wait ) -+#define gs_setup GS_PREFIXED_NAME(gs_setup ) -+#define gs_free GS_PREFIXED_NAME(gs_free ) -+#define gs_unique GS_PREFIXED_NAME(gs_unique) -+#define gs_hf2c GS_PREFIXED_NAME(gs_hf2c ) -+#define pw_data_nmsg GS_PREFIXED_NAME(pw_data_nmsg ) -+#define pw_data_size GS_PREFIXED_NAME(pw_data_size ) - - struct gs_data; - typedef enum {gs_auto, gs_pairwise, gs_crystal_router, gs_all_reduce} gs_method; -diff --git a/src/gs_defs.h b/src/gs_defs.h -index df4ad7b..3914442 100644 ---- a/src/gs_defs.h -+++ b/src/gs_defs.h -@@ -20,7 +20,7 @@ - macro(float ) \ - macro(int ) \ - macro(long ) \ -- WHEN_LONG_LONG(macro(long_long)) -+ GS_WHEN_LONG_LONG(macro(long_long)) - - /* the supported ops */ - #define GS_FOR_EACH_OP(T,macro) \ -@@ -49,7 +49,7 @@ - GS_DEFINE_MONOID_ID(float , -FLT_MAX, FLT_MAX) \ - GS_DEFINE_MONOID_ID(int , INT_MIN, INT_MAX) \ - GS_DEFINE_MONOID_ID(long , LONG_MIN, LONG_MAX) \ -- WHEN_LONG_LONG(GS_DEFINE_MONOID_ID(long_long,LLONG_MIN,LLONG_MAX)) -+ GS_WHEN_LONG_LONG(GS_DEFINE_MONOID_ID(long_long,LLONG_MIN,LLONG_MAX)) - - /*------------------------------------------------------------------------------ - Enums and constants -@@ -62,8 +62,8 @@ typedef enum { LIST } gs_dom; - #undef ITEM - #undef LIST - --#define gs_sint TYPE_LOCAL(gs_int,gs_long,gs_long_long) --#define gs_slong TYPE_GLOBAL(gs_int,gs_long,gs_long_long) -+#define gs_sint GS_TYPE_LOCAL(gs_int,gs_long,gs_long_long) -+#define gs_slong GS_TYPE_GLOBAL(gs_int,gs_long,gs_long_long) - - /* domain type size array */ - #define GS_DOM_SIZE_ITEM(T) sizeof(T), -diff --git a/src/gs_local.c b/src/gs_local.c -index 170e94d..fa758c9 100644 ---- a/src/gs_local.c -+++ b/src/gs_local.c -@@ -5,20 +5,20 @@ - #include "name.h" - #include "types.h" - --#define gs_gather_array PREFIXED_NAME(gs_gather_array ) --#define gs_init_array PREFIXED_NAME(gs_init_array ) --#define gs_gather PREFIXED_NAME(gs_gather ) --#define gs_scatter PREFIXED_NAME(gs_scatter ) --#define gs_init PREFIXED_NAME(gs_init ) --#define gs_gather_vec PREFIXED_NAME(gs_gather_vec ) --#define gs_scatter_vec PREFIXED_NAME(gs_scatter_vec ) --#define gs_init_vec PREFIXED_NAME(gs_init_vec ) --#define gs_gather_many PREFIXED_NAME(gs_gather_many ) --#define gs_scatter_many PREFIXED_NAME(gs_scatter_many ) --#define gs_init_many PREFIXED_NAME(gs_init_many ) --#define gs_gather_vec_to_many PREFIXED_NAME(gs_gather_vec_to_many ) --#define gs_scatter_many_to_vec PREFIXED_NAME(gs_scatter_many_to_vec) --#define gs_scatter_vec_to_many PREFIXED_NAME(gs_scatter_vec_to_many) -+#define gs_gather_array GS_PREFIXED_NAME(gs_gather_array ) -+#define gs_init_array GS_PREFIXED_NAME(gs_init_array ) -+#define gs_gather GS_PREFIXED_NAME(gs_gather ) -+#define gs_scatter GS_PREFIXED_NAME(gs_scatter ) -+#define gs_init GS_PREFIXED_NAME(gs_init ) -+#define gs_gather_vec GS_PREFIXED_NAME(gs_gather_vec ) -+#define gs_scatter_vec GS_PREFIXED_NAME(gs_scatter_vec ) -+#define gs_init_vec GS_PREFIXED_NAME(gs_init_vec ) -+#define gs_gather_many GS_PREFIXED_NAME(gs_gather_many ) -+#define gs_scatter_many GS_PREFIXED_NAME(gs_scatter_many ) -+#define gs_init_many GS_PREFIXED_NAME(gs_init_many ) -+#define gs_gather_vec_to_many GS_PREFIXED_NAME(gs_gather_vec_to_many ) -+#define gs_scatter_many_to_vec GS_PREFIXED_NAME(gs_scatter_many_to_vec) -+#define gs_scatter_vec_to_many GS_PREFIXED_NAME(gs_scatter_vec_to_many) - - #include "gs_defs.h" - GS_DEFINE_IDENTITIES() -diff --git a/src/gs_local.h b/src/gs_local.h -index fc7c414..d09a420 100644 ---- a/src/gs_local.h -+++ b/src/gs_local.h -@@ -1,24 +1,24 @@ - #ifndef GS_LOCAL_H - #define GS_LOCAL_H - --#if !defined(NAME_H) || !defined(TYPES_H) || !defined(GS_DEFS_H) -+#if !defined(GS_NAME_H) || !defined(GS_TYPES_H) || !defined(GS_DEFS_H) - #warning "gs_local.h" requires "name.h", "types.h", and "gs_defs.h" - #endif - --#define gs_gather_array PREFIXED_NAME(gs_gather_array ) --#define gs_init_array PREFIXED_NAME(gs_init_array ) --#define gs_gather PREFIXED_NAME(gs_gather ) --#define gs_scatter PREFIXED_NAME(gs_scatter ) --#define gs_init PREFIXED_NAME(gs_init ) --#define gs_gather_vec PREFIXED_NAME(gs_gather_vec ) --#define gs_scatter_vec PREFIXED_NAME(gs_scatter_vec ) --#define gs_init_vec PREFIXED_NAME(gs_init_vec ) --#define gs_gather_many PREFIXED_NAME(gs_gather_many ) --#define gs_scatter_many PREFIXED_NAME(gs_scatter_many ) --#define gs_init_many PREFIXED_NAME(gs_init_many ) --#define gs_gather_vec_to_many PREFIXED_NAME(gs_gather_vec_to_many ) --#define gs_scatter_many_to_vec PREFIXED_NAME(gs_scatter_many_to_vec) --#define gs_scatter_vec_to_many PREFIXED_NAME(gs_scatter_vec_to_many) -+#define gs_gather_array GS_PREFIXED_NAME(gs_gather_array ) -+#define gs_init_array GS_PREFIXED_NAME(gs_init_array ) -+#define gs_gather GS_PREFIXED_NAME(gs_gather ) -+#define gs_scatter GS_PREFIXED_NAME(gs_scatter ) -+#define gs_init GS_PREFIXED_NAME(gs_init ) -+#define gs_gather_vec GS_PREFIXED_NAME(gs_gather_vec ) -+#define gs_scatter_vec GS_PREFIXED_NAME(gs_scatter_vec ) -+#define gs_init_vec GS_PREFIXED_NAME(gs_init_vec ) -+#define gs_gather_many GS_PREFIXED_NAME(gs_gather_many ) -+#define gs_scatter_many GS_PREFIXED_NAME(gs_scatter_many ) -+#define gs_init_many GS_PREFIXED_NAME(gs_init_many ) -+#define gs_gather_vec_to_many GS_PREFIXED_NAME(gs_gather_vec_to_many ) -+#define gs_scatter_many_to_vec GS_PREFIXED_NAME(gs_scatter_many_to_vec) -+#define gs_scatter_vec_to_many GS_PREFIXED_NAME(gs_scatter_vec_to_many) - - void gs_gather_array(void *out, const void *in, uint n, - gs_dom dom, gs_op op); -diff --git a/src/gslib.h b/src/gslib.h -index e80d7a3..4bf4d72 100644 ---- a/src/gslib.h -+++ b/src/gslib.h -@@ -1,5 +1,5 @@ --#ifndef GSLIB_H --#define GSLIB_H -+#ifndef GS_GSLIB_H -+#define GS_GSLIB_H - - #include - #include -diff --git a/src/lob_bnd.c b/src/lob_bnd.c -index 9d02ca4..0aa0492 100644 ---- a/src/lob_bnd.c -+++ b/src/lob_bnd.c -@@ -10,13 +10,13 @@ - #include "mem.h" - #include "poly.h" - --#define lob_bnd_setup PREFIXED_NAME(lob_bnd_setup) --#define lob_bnd_lin_1 PREFIXED_NAME(lob_bnd_lin_1) --#define lob_bnd_lin_2 PREFIXED_NAME(lob_bnd_lin_2) --#define lob_bnd_lin_3 PREFIXED_NAME(lob_bnd_lin_3) --#define lob_bnd_1 PREFIXED_NAME(lob_bnd_1 ) --#define lob_bnd_2 PREFIXED_NAME(lob_bnd_2 ) --#define lob_bnd_3 PREFIXED_NAME(lob_bnd_3 ) -+#define lob_bnd_setup GS_PREFIXED_NAME(lob_bnd_setup) -+#define lob_bnd_lin_1 GS_PREFIXED_NAME(lob_bnd_lin_1) -+#define lob_bnd_lin_2 GS_PREFIXED_NAME(lob_bnd_lin_2) -+#define lob_bnd_lin_3 GS_PREFIXED_NAME(lob_bnd_lin_3) -+#define lob_bnd_1 GS_PREFIXED_NAME(lob_bnd_1 ) -+#define lob_bnd_2 GS_PREFIXED_NAME(lob_bnd_2 ) -+#define lob_bnd_3 GS_PREFIXED_NAME(lob_bnd_3 ) - - struct dbl_range { double min,max; }; - -diff --git a/src/lob_bnd.h b/src/lob_bnd.h -index 7ecc8a3..52f30ee 100644 ---- a/src/lob_bnd.h -+++ b/src/lob_bnd.h -@@ -1,17 +1,17 @@ --#ifndef LOB_BND_H --#define LOB_BND_H -+#ifndef GS_LOB_BND_H -+#define GS_LOB_BND_H - --#if !defined(TYPES_H) || !defined(NAME_H) -+#if !defined(GS_TYPES_H) || !defined(GS_NAME_H) - #warning "lob_bnd.h" requires "types.h" and "name.h" - #endif - --#define lob_bnd_setup PREFIXED_NAME(lob_bnd_setup) --#define lob_bnd_lin_1 PREFIXED_NAME(lob_bnd_lin_1) --#define lob_bnd_lin_2 PREFIXED_NAME(lob_bnd_lin_2) --#define lob_bnd_lin_3 PREFIXED_NAME(lob_bnd_lin_3) --#define lob_bnd_1 PREFIXED_NAME(lob_bnd_1 ) --#define lob_bnd_2 PREFIXED_NAME(lob_bnd_2 ) --#define lob_bnd_3 PREFIXED_NAME(lob_bnd_3 ) -+#define lob_bnd_setup GS_PREFIXED_NAME(lob_bnd_setup) -+#define lob_bnd_lin_1 GS_PREFIXED_NAME(lob_bnd_lin_1) -+#define lob_bnd_lin_2 GS_PREFIXED_NAME(lob_bnd_lin_2) -+#define lob_bnd_lin_3 GS_PREFIXED_NAME(lob_bnd_lin_3) -+#define lob_bnd_1 GS_PREFIXED_NAME(lob_bnd_1 ) -+#define lob_bnd_2 GS_PREFIXED_NAME(lob_bnd_2 ) -+#define lob_bnd_3 GS_PREFIXED_NAME(lob_bnd_3 ) - - /*-------------------------------------------------------------------------- - Bounds for Polynomials on [-1,1]^d -@@ -85,7 +85,7 @@ void lob_bnd_lin_3( - const double *lob_bnd_data_t, unsigned nt, unsigned mt, - const double *restrict u, uint un, double *restrict work); - --#ifndef OBBOX_H -+#ifndef GS_OBBOX_H - struct dbl_range { double min, max; }; - #endif - -diff --git a/src/mem.h b/src/mem.h -index 09ea661..8156c77 100644 ---- a/src/mem.h -+++ b/src/mem.h -@@ -1,5 +1,5 @@ --#ifndef MEM_H --#define MEM_H -+#ifndef GS_MEM_H -+#define GS_MEM_H - - /* requires: - for size_t, offsetof -@@ -9,7 +9,7 @@ - "fail.h" - */ - --#if !defined(C99_H) || !defined(FAIL_H) -+#if !defined(GS_C99_H) || !defined(GS_FAIL_H) - #error "mem.h" requires "c99.h" and "fail.h" - #endif - -@@ -31,8 +31,8 @@ - #else - # include - # ifndef comm_gbl_id --# define comm_gbl_id PREFIXED_NAME(comm_gbl_id) --# define comm_gbl_np PREFIXED_NAME(comm_gbl_np) -+# define comm_gbl_id GS_PREFIXED_NAME(comm_gbl_id) -+# define comm_gbl_np GS_PREFIXED_NAME(comm_gbl_np) - # include "types.h" - extern uint comm_gbl_id, comm_gbl_np; - # endif -diff --git a/src/name.h b/src/name.h -index b4bcd91..6d64c85 100644 ---- a/src/name.h -+++ b/src/name.h -@@ -1,43 +1,43 @@ --#ifndef NAME_H --#define NAME_H -+#ifndef GS_NAME_H -+#define GS_NAME_H - - /* establishes some macros to establish - * the FORTRAN naming convention -- default gs_setup, etc. -- -DUPCASE GS_SETUP, etc. -- -DUNDERSCORE gs_setup_, etc. -+ default gs_setup, etc. -+ -DGSLIB_UPCASE GS_SETUP, etc. -+ -DGSLIB_UNDERSCORE gs_setup_, etc. - * a prefix for all external (non-FORTRAN) function names -- for example, -DPREFIX=jl_ transforms fail -> jl_fail -+ for example, -DGSLIB_PREFIX=jl_ transforms fail -> jl_fail - * a prefix for all external FORTRAN function names -- for example, -DFPREFIX=jlf_ transforms gs_setup_ -> jlf_gs_setup_ -+ for example, -DGSLIB_FPREFIX=jlf_ transforms gs_setup_ -> jlf_gs_setup_ - */ - - /* the following macro functions like a##b, - but will expand a and/or b if they are themselves macros */ --#define TOKEN_PASTE_(a,b) a##b --#define TOKEN_PASTE(a,b) TOKEN_PASTE_(a,b) -+#define GS_TOKEN_PASTE_(a,b) a##b -+#define GS_TOKEN_PASTE(a,b) GS_TOKEN_PASTE_(a,b) - --#ifdef PREFIX --# define PREFIXED_NAME(x) TOKEN_PASTE(PREFIX,x) -+#ifdef GSLIB_PREFIX -+# define GS_PREFIXED_NAME(x) GS_TOKEN_PASTE(GSLIB_PREFIX,x) - #else --# define PREFIXED_NAME(x) x -+# define GS_PREFIXED_NAME(x) x - #endif - --#ifdef FPREFIX --# define FPREFIXED_NAME(x) TOKEN_PASTE(FPREFIX,x) -+#ifdef GSLIB_FPREFIX -+# define GS_FPREFIXED_NAME(x) GS_TOKEN_PASTE(GSLIB_FPREFIX,x) - #else --# define FPREFIXED_NAME(x) x -+# define GS_FPREFIXED_NAME(x) x - #endif - --#if defined(UPCASE) --# define FORTRAN_NAME(low,up) FPREFIXED_NAME(up) --# define FORTRAN_UNPREFIXED(low,up) up --#elif defined(UNDERSCORE) --# define FORTRAN_NAME(low,up) FPREFIXED_NAME(TOKEN_PASTE(low,_)) --# define FORTRAN_UNPREFIXED(low,up) TOKEN_PASTE(low,_) -+#if defined(GSLIB_UPCASE) -+# define GS_FORTRAN_NAME(low,up) GS_FPREFIXED_NAME(up) -+# define GS_FORTRAN_UNPREFIXED(low,up) up -+#elif defined(GSLIB_UNDERSCORE) -+# define GS_FORTRAN_NAME(low,up) GS_FPREFIXED_NAME(GS_TOKEN_PASTE(low,_)) -+# define GS_FORTRAN_UNPREFIXED(low,up) GS_TOKEN_PASTE(low,_) - #else --# define FORTRAN_NAME(low,up) FPREFIXED_NAME(low) --# define FORTRAN_UNPREFIXED(low,up) low -+# define GS_FORTRAN_NAME(low,up) GS_FPREFIXED_NAME(low) -+# define GS_FORTRAN_UNPREFIXED(low,up) low - #endif - - #endif -diff --git a/src/obbox.c b/src/obbox.c -index 22c4614..611f3ac 100644 ---- a/src/obbox.c -+++ b/src/obbox.c -@@ -10,8 +10,8 @@ - #include "poly.h" - #include "lob_bnd.h" - --#define obbox_calc_2 PREFIXED_NAME(obbox_calc_2) --#define obbox_calc_3 PREFIXED_NAME(obbox_calc_3) -+#define obbox_calc_2 GS_PREFIXED_NAME(obbox_calc_2) -+#define obbox_calc_3 GS_PREFIXED_NAME(obbox_calc_3) - - struct obbox_2 { double c0[2], A[4]; - struct dbl_range x[2]; }; -diff --git a/src/obbox.h b/src/obbox.h -index 8e5764f..86ba0ce 100644 ---- a/src/obbox.h -+++ b/src/obbox.h -@@ -1,12 +1,12 @@ --#ifndef OBBOX_H --#define OBBOX_H -+#ifndef GS_OBBOX_H -+#define GS_OBBOX_H - --#if !defined(TYPES_H) || !defined(NAME_H) -+#if !defined(GS_TYPES_H) || !defined(GS_NAME_H) - #warning "obbox.h" requires "types.h" and "name.h" - #endif - --#define obbox_calc_2 PREFIXED_NAME(obbox_calc_2) --#define obbox_calc_3 PREFIXED_NAME(obbox_calc_3) -+#define obbox_calc_2 GS_PREFIXED_NAME(obbox_calc_2) -+#define obbox_calc_3 GS_PREFIXED_NAME(obbox_calc_3) - - /*-------------------------------------------------------------------------- - Oriented and axis-aligned bounding box computation for spectral elements -@@ -45,7 +45,7 @@ - - --------------------------------------------------------------------------*/ - --#ifndef LOB_BND_H -+#ifndef GS_LOB_BND_H - struct dbl_range { double min, max; }; - #endif - -diff --git a/src/poly.c b/src/poly.c -index 00ad22b..d8585be 100644 ---- a/src/poly.c -+++ b/src/poly.c -@@ -8,14 +8,14 @@ - #include "fail.h" - #include "mem.h" - --#define lagrange_size PREFIXED_NAME(lagrange_size ) --#define lagrange_setup PREFIXED_NAME(lagrange_setup) --#define gauss_nodes PREFIXED_NAME(gauss_nodes ) --#define gauss_quad PREFIXED_NAME(gauss_quad ) --#define lobatto_nodes PREFIXED_NAME(lobatto_nodes ) --#define lobatto_quad PREFIXED_NAME(lobatto_quad ) --#define gll_lag_size PREFIXED_NAME(gll_lag_size ) --#define gll_lag_setup PREFIXED_NAME(gll_lag_setup ) -+#define lagrange_size GS_PREFIXED_NAME(lagrange_size ) -+#define lagrange_setup GS_PREFIXED_NAME(lagrange_setup) -+#define gauss_nodes GS_PREFIXED_NAME(gauss_nodes ) -+#define gauss_quad GS_PREFIXED_NAME(gauss_quad ) -+#define lobatto_nodes GS_PREFIXED_NAME(lobatto_nodes ) -+#define lobatto_quad GS_PREFIXED_NAME(lobatto_quad ) -+#define gll_lag_size GS_PREFIXED_NAME(gll_lag_size ) -+#define gll_lag_setup GS_PREFIXED_NAME(gll_lag_setup ) - - typedef void lagrange_fun(double *restrict p, - double *restrict data, unsigned n, int d, double x); -diff --git a/src/poly.h b/src/poly.h -index 2fa162a..2781b22 100644 ---- a/src/poly.h -+++ b/src/poly.h -@@ -1,18 +1,18 @@ --#ifndef POLY_H --#define POLY_H -+#ifndef GS_POLY_H -+#define GS_POLY_H - --#if !defined(NAME_H) -+#if !defined(GS_NAME_H) - #warning "poly.h" requires "name.h" - #endif - --#define lagrange_size PREFIXED_NAME(lagrange_size ) --#define lagrange_setup PREFIXED_NAME(lagrange_setup) --#define gauss_nodes PREFIXED_NAME(gauss_nodes ) --#define gauss_quad PREFIXED_NAME(gauss_quad ) --#define lobatto_nodes PREFIXED_NAME(lobatto_nodes ) --#define lobatto_quad PREFIXED_NAME(lobatto_quad ) --#define gll_lag_size PREFIXED_NAME(gll_lag_size ) --#define gll_lag_setup PREFIXED_NAME(gll_lag_setup ) -+#define lagrange_size GS_PREFIXED_NAME(lagrange_size ) -+#define lagrange_setup GS_PREFIXED_NAME(lagrange_setup) -+#define gauss_nodes GS_PREFIXED_NAME(gauss_nodes ) -+#define gauss_quad GS_PREFIXED_NAME(gauss_quad ) -+#define lobatto_nodes GS_PREFIXED_NAME(lobatto_nodes ) -+#define lobatto_quad GS_PREFIXED_NAME(lobatto_quad ) -+#define gll_lag_size GS_PREFIXED_NAME(gll_lag_size ) -+#define gll_lag_setup GS_PREFIXED_NAME(gll_lag_setup ) - - /*-------------------------------------------------------------------------- - Quadrature Nodes and Weights Calculation -diff --git a/src/sarray_sort.c b/src/sarray_sort.c -index 0ec26d1..9ba8fc4 100644 ---- a/src/sarray_sort.c -+++ b/src/sarray_sort.c -@@ -8,8 +8,8 @@ - #include "mem.h" - #include "sort.h" - --#define sarray_permute_ PREFIXED_NAME(sarray_permute_) --#define sarray_permute_buf_ PREFIXED_NAME(sarray_permute_buf_) -+#define sarray_permute_ GS_PREFIXED_NAME(sarray_permute_) -+#define sarray_permute_buf_ GS_PREFIXED_NAME(sarray_permute_buf_) - - void sarray_permute_(size_t size, void *A, size_t n, uint *perm, void *work) - { -diff --git a/src/sarray_sort.h b/src/sarray_sort.h -index cd30d7c..97fdba1 100644 ---- a/src/sarray_sort.h -+++ b/src/sarray_sort.h -@@ -1,7 +1,7 @@ --#ifndef SARRAY_SORT_H --#define SARRAY_SORT_H -+#ifndef GS_SARRAY_SORT_H -+#define GS_SARRAY_SORT_H - --#if !defined(SORT_H) -+#if !defined(GS_SORT_H) - #warning "sarray_sort.h" requires "sort.h" - #endif - -@@ -33,8 +33,8 @@ - ----------------------------------------------------------------------------*/ - - --#define sarray_permute_ PREFIXED_NAME(sarray_permute_) --#define sarray_permute_buf_ PREFIXED_NAME(sarray_permute_buf_) -+#define sarray_permute_ GS_PREFIXED_NAME(sarray_permute_) -+#define sarray_permute_buf_ GS_PREFIXED_NAME(sarray_permute_buf_) - - void sarray_permute_(size_t size, void *A, size_t n, uint *perm, void *work); - void sarray_permute_buf_( -diff --git a/src/sarray_transfer.c b/src/sarray_transfer.c -index c5dfd2b..5f94192 100644 ---- a/src/sarray_transfer.c -+++ b/src/sarray_transfer.c -@@ -11,9 +11,9 @@ - #include "crystal.h" - #include "sort.h" - --#define sarray_transfer_many PREFIXED_NAME(sarray_transfer_many) --#define sarray_transfer_ PREFIXED_NAME(sarray_transfer_ ) --#define sarray_transfer_ext_ PREFIXED_NAME(sarray_transfer_ext_) -+#define sarray_transfer_many GS_PREFIXED_NAME(sarray_transfer_many) -+#define sarray_transfer_ GS_PREFIXED_NAME(sarray_transfer_ ) -+#define sarray_transfer_ext_ GS_PREFIXED_NAME(sarray_transfer_ext_) - - static void pack_int( - buffer *const data, const unsigned row_size, const uint id, -diff --git a/src/sarray_transfer.h b/src/sarray_transfer.h -index c195e21..cc441ae 100644 ---- a/src/sarray_transfer.h -+++ b/src/sarray_transfer.h -@@ -1,7 +1,7 @@ --#ifndef SARRAY_TRANSFER_H --#define SARRAY_TRANSFER_H -+#ifndef GS_SARRAY_TRANSFER_H -+#define GS_SARRAY_TRANSFER_H - --#if !defined(CRYSTAL_H) -+#if !defined(GS_CRYSTAL_H) - #warning "sarray_transfer.h" requires "crystal.h" - #endif - -@@ -70,9 +70,9 @@ - - */ - --#define sarray_transfer_many PREFIXED_NAME(sarray_transfer_many) --#define sarray_transfer_ PREFIXED_NAME(sarray_transfer_ ) --#define sarray_transfer_ext_ PREFIXED_NAME(sarray_transfer_ext_) -+#define sarray_transfer_many GS_PREFIXED_NAME(sarray_transfer_many) -+#define sarray_transfer_ GS_PREFIXED_NAME(sarray_transfer_ ) -+#define sarray_transfer_ext_ GS_PREFIXED_NAME(sarray_transfer_ext_) - - uint sarray_transfer_many( - struct array *const *const A, const unsigned *const size, const unsigned An, -diff --git a/src/sort.c b/src/sort.c -index 2bb061b..5bccad8 100644 ---- a/src/sort.c -+++ b/src/sort.c -@@ -14,7 +14,7 @@ - #undef SORT_SUFFIX - #undef T - --#if defined(USE_LONG) || defined(GLOBAL_LONG) -+#if defined(GSLIB_USE_LONG) || defined(GSLIB_USE_GLOBAL_LONG) - # define T unsigned long - # define SORT_SUFFIX _ul - # include "sort_imp.h" -@@ -22,7 +22,7 @@ - # undef T - #endif - --#if defined(USE_LONG_LONG) || defined(GLOBAL_LONG_LONG) -+#if defined(GSLIB_USE_LONG_LONG) || defined(GSLIB_USE_GLOBAL_LONG_LONG) - # define T unsigned long long - # define SORT_SUFFIX _ull - # include "sort_imp.h" -diff --git a/src/sort.h b/src/sort.h -index 0b0ee53..d0a1cc7 100644 ---- a/src/sort.h -+++ b/src/sort.h -@@ -1,7 +1,7 @@ --#ifndef SORT_H --#define SORT_H -+#ifndef GS_SORT_H -+#define GS_SORT_H - --#if !defined(TYPES_H) || !defined(MEM_H) -+#if !defined(GS_TYPES_H) || !defined(GS_MEM_H) - #warning "sort.h" requires "types.h" and "mem.h" - /* types.h defines uint, ulong - mem.h defines buffer */ -@@ -44,21 +44,21 @@ - - ----------------------------------------------------------------------------*/ - --#define sortv_ui PREFIXED_NAME(sortv_ui) --#define sortv_ul PREFIXED_NAME(sortv_ul) --#define sortv_ull PREFIXED_NAME(sortv_ull) --#define sortv_double PREFIXED_NAME(sortv_double) --#define sortv_float PREFIXED_NAME(sortv_float) --#define sortp_ui PREFIXED_NAME(sortp_ui) --#define sortp_ul PREFIXED_NAME(sortp_ul) --#define sortp_ull PREFIXED_NAME(sortp_ull) --#define sortp_double PREFIXED_NAME(sortp_double) --#define sortp_float PREFIXED_NAME(sortp_float) -+#define sortv_ui GS_PREFIXED_NAME(sortv_ui) -+#define sortv_ul GS_PREFIXED_NAME(sortv_ul) -+#define sortv_ull GS_PREFIXED_NAME(sortv_ull) -+#define sortv_double GS_PREFIXED_NAME(sortv_double) -+#define sortv_float GS_PREFIXED_NAME(sortv_float) -+#define sortp_ui GS_PREFIXED_NAME(sortp_ui) -+#define sortp_ul GS_PREFIXED_NAME(sortp_ul) -+#define sortp_ull GS_PREFIXED_NAME(sortp_ull) -+#define sortp_double GS_PREFIXED_NAME(sortp_double) -+#define sortp_float GS_PREFIXED_NAME(sortp_float) - --#define sortv TYPE_LOCAL(sortv_ui,sortv_ul,sortv_ull) --#define sortp TYPE_LOCAL(sortp_ui,sortp_ul,sortp_ull) --#define sortv_long TYPE_GLOBAL(sortv_ui,sortv_ul,sortv_ull) --#define sortp_long TYPE_GLOBAL(sortp_ui,sortp_ul,sortp_ull) -+#define sortv GS_TYPE_LOCAL(sortv_ui,sortv_ul,sortv_ull) -+#define sortp GS_TYPE_LOCAL(sortp_ui,sortp_ul,sortp_ull) -+#define sortv_long GS_TYPE_GLOBAL(sortv_ui,sortv_ul,sortv_ull) -+#define sortp_long GS_TYPE_GLOBAL(sortp_ui,sortp_ul,sortp_ull) - - void sortv_ui(unsigned *out, const unsigned *A, uint n, unsigned stride, - buffer *restrict buf); -@@ -79,7 +79,7 @@ uint *sortp_double(buffer *restrict buf, int start_perm, - const double *restrict A, uint n, unsigned stride); - uint *sortp_float(buffer *restrict buf, int start_perm, - const float *restrict A, uint n, unsigned stride); --#if defined(USE_LONG_LONG) || defined(GLOBAL_LONG_LONG) -+#if defined(GSLIB_USE_LONG_LONG) || defined(GSLIB_USE_GLOBAL_LONG_LONG) - void sortv_ull(unsigned long long *out, - const unsigned long long *A, uint n, unsigned stride, - buffer *restrict buf); -diff --git a/src/sort_imp.h b/src/sort_imp.h -index 3ec8e0c..a6a0426 100644 ---- a/src/sort_imp.h -+++ b/src/sort_imp.h -@@ -2,27 +2,27 @@ - #error sort_imp.h not meant to be compiled by itself - #endif - --#define sort_data TOKEN_PASTE(sort_data ,SORT_SUFFIX) --#define radix_count TOKEN_PASTE(radix_count ,SORT_SUFFIX) --#define radix_offsets TOKEN_PASTE(radix_offsets ,SORT_SUFFIX) --#define radix_zeros TOKEN_PASTE(radix_zeros ,SORT_SUFFIX) --#define radix_passv TOKEN_PASTE(radix_passv ,SORT_SUFFIX) --#define radix_sortv TOKEN_PASTE(radix_sortv ,SORT_SUFFIX) --#define radix_passp0_b TOKEN_PASTE(radix_passp0_b ,SORT_SUFFIX) --#define radix_passp_b TOKEN_PASTE(radix_passp_b ,SORT_SUFFIX) --#define radix_passp_m TOKEN_PASTE(radix_passp_m ,SORT_SUFFIX) --#define radix_passp_e TOKEN_PASTE(radix_passp_e ,SORT_SUFFIX) --#define radix_passp0_be TOKEN_PASTE(radix_passp0_be,SORT_SUFFIX) --#define radix_passp_be TOKEN_PASTE(radix_passp_be, SORT_SUFFIX) --#define radix_sortp TOKEN_PASTE(radix_sortp ,SORT_SUFFIX) --#define merge_sortv TOKEN_PASTE(merge_sortv ,SORT_SUFFIX) --#define merge_copy_perm TOKEN_PASTE(merge_copy_perm,SORT_SUFFIX) --#define merge_sortp0 TOKEN_PASTE(merge_sortp0 ,SORT_SUFFIX) --#define merge_sortp TOKEN_PASTE(merge_sortp ,SORT_SUFFIX) --#define heap_sortv TOKEN_PASTE(heap_sortv ,SORT_SUFFIX) -- --#define sortv PREFIXED_NAME(TOKEN_PASTE(sortv,SORT_SUFFIX)) --#define sortp PREFIXED_NAME(TOKEN_PASTE(sortp,SORT_SUFFIX)) -+#define sort_data GS_TOKEN_PASTE(sort_data ,SORT_SUFFIX) -+#define radix_count GS_TOKEN_PASTE(radix_count ,SORT_SUFFIX) -+#define radix_offsets GS_TOKEN_PASTE(radix_offsets ,SORT_SUFFIX) -+#define radix_zeros GS_TOKEN_PASTE(radix_zeros ,SORT_SUFFIX) -+#define radix_passv GS_TOKEN_PASTE(radix_passv ,SORT_SUFFIX) -+#define radix_sortv GS_TOKEN_PASTE(radix_sortv ,SORT_SUFFIX) -+#define radix_passp0_b GS_TOKEN_PASTE(radix_passp0_b ,SORT_SUFFIX) -+#define radix_passp_b GS_TOKEN_PASTE(radix_passp_b ,SORT_SUFFIX) -+#define radix_passp_m GS_TOKEN_PASTE(radix_passp_m ,SORT_SUFFIX) -+#define radix_passp_e GS_TOKEN_PASTE(radix_passp_e ,SORT_SUFFIX) -+#define radix_passp0_be GS_TOKEN_PASTE(radix_passp0_be,SORT_SUFFIX) -+#define radix_passp_be GS_TOKEN_PASTE(radix_passp_be, SORT_SUFFIX) -+#define radix_sortp GS_TOKEN_PASTE(radix_sortp ,SORT_SUFFIX) -+#define merge_sortv GS_TOKEN_PASTE(merge_sortv ,SORT_SUFFIX) -+#define merge_copy_perm GS_TOKEN_PASTE(merge_copy_perm,SORT_SUFFIX) -+#define merge_sortp0 GS_TOKEN_PASTE(merge_sortp0 ,SORT_SUFFIX) -+#define merge_sortp GS_TOKEN_PASTE(merge_sortp ,SORT_SUFFIX) -+#define heap_sortv GS_TOKEN_PASTE(heap_sortv ,SORT_SUFFIX) -+ -+#define sortv GS_PREFIXED_NAME(GS_TOKEN_PASTE(sortv,SORT_SUFFIX)) -+#define sortp GS_PREFIXED_NAME(GS_TOKEN_PASTE(sortp,SORT_SUFFIX)) - - typedef struct { T v; uint i; } sort_data; - -diff --git a/src/tensor.c b/src/tensor.c -index a724714..2cdf570 100644 ---- a/src/tensor.c -+++ b/src/tensor.c -@@ -2,10 +2,10 @@ - #include "name.h" - #include "types.h" - --#if !defined(USE_CBLAS) -+#if !defined(GSLIB_USE_CBLAS) - --#define tensor_dot PREFIXED_NAME(tensor_dot ) --#define tensor_mtxm PREFIXED_NAME(tensor_mtxm) -+#define tensor_dot GS_PREFIXED_NAME(tensor_dot ) -+#define tensor_mtxm GS_PREFIXED_NAME(tensor_mtxm) - - /* Matrices are always column-major (FORTRAN style) */ - -@@ -16,10 +16,10 @@ double tensor_dot(const double *a, const double *b, uint n) - return sum; - } - --# if defined(USE_NAIVE_BLAS) --# define tensor_mxv PREFIXED_NAME(tensor_mxv ) --# define tensor_mtxv PREFIXED_NAME(tensor_mtxv) --# define tensor_mxm PREFIXED_NAME(tensor_mxm ) -+# if defined(GSLIB_USE_NAIVE_BLAS) -+# define tensor_mxv GS_PREFIXED_NAME(tensor_mxv ) -+# define tensor_mtxv GS_PREFIXED_NAME(tensor_mtxv) -+# define tensor_mxm GS_PREFIXED_NAME(tensor_mxm ) - - /* y = A x */ - void tensor_mxv( -diff --git a/src/tensor.h b/src/tensor.h -index bb65be1..5a9e52b 100644 ---- a/src/tensor.h -+++ b/src/tensor.h -@@ -1,12 +1,16 @@ --#ifndef TENSOR_H --#define TENSOR_H -+#ifndef GS_TENSOR_H -+#define GS_TENSOR_H - --#if !defined(TYPES_H) || !defined(NAME_H) -+#if !defined(GS_TYPES_H) || !defined(GS_NAME_H) - #warning "tensor.h" requires "types.h" and "name.h" - #endif - --#if defined(USE_CBLAS) -+#if defined(GSLIB_USE_CBLAS) -+#if defined(GSLIB_USE_MKL) -+# include -+#else - # include -+#endif - # define tensor_dot(a,b,n) cblas_ddot((int)(n),a,1,b,1) - # define tensor_mxv(y,ny,A,x,nx) \ - cblas_dgemv(CblasColMajor,CblasNoTrans,(int)ny,(int)nx, \ -@@ -23,17 +27,17 @@ - (int)nc,(int)nb,(int)na,1.0, \ - A,(int)na,B,(int)na,0.0,C,(int)nc) - #else --# define tensor_dot PREFIXED_NAME(tensor_dot ) --# define tensor_mtxm PREFIXED_NAME(tensor_mtxm) -+# define tensor_dot GS_PREFIXED_NAME(tensor_dot ) -+# define tensor_mtxm GS_PREFIXED_NAME(tensor_mtxm) - double tensor_dot(const double *a, const double *b, uint n); - - /* C (nc x nb) = [A (na x nc)]^T * B (na x nb); all column-major */ - void tensor_mtxm(double *C, uint nc, - const double *A, uint na, const double *B, uint nb); --# if defined(USE_NAIVE_BLAS) --# define tensor_mxv PREFIXED_NAME(tensor_mxv ) --# define tensor_mtxv PREFIXED_NAME(tensor_mtxv) --# define tensor_mxm PREFIXED_NAME(tensor_mxm ) -+# if defined(GSLIB_USE_NAIVE_BLAS) -+# define tensor_mxv GS_PREFIXED_NAME(tensor_mxv ) -+# define tensor_mtxv GS_PREFIXED_NAME(tensor_mtxv) -+# define tensor_mxm GS_PREFIXED_NAME(tensor_mxm ) - /* y = A x */ - void tensor_mxv(double *y, uint ny, const double *A, const double *x, uint nx); - -@@ -44,7 +48,7 @@ void tensor_mtxv(double *y, uint ny, const double *A, const double *x, uint nx); - void tensor_mxm(double *C, uint nc, - const double *A, uint na, const double *B, uint nb); - # else --# define mxm FORTRAN_NAME(mxm,MXM) -+# define mxm GS_FORTRAN_NAME(mxm,MXM) - /* C (na x nc) = A (na x nb) * B (nb x nc); all column-major */ - void mxm(const double *A, const uint *na, - const double *B, const uint *nb, -diff --git a/src/types.h b/src/types.h -index 14a94bf..c4c6cd6 100644 ---- a/src/types.h -+++ b/src/types.h -@@ -1,5 +1,6 @@ --#ifndef TYPES_H --#define TYPES_H -+#ifndef GS_TYPES_H -+#define GS_TYPES_H -+ - #include - - /* -@@ -10,20 +11,20 @@ - most frequently, e.g., for indexing into local arrays, - and for processor ids. It can be one of - -- macro sint/uint type -+ macro sint/uint type - -- (default) int -- USE_LONG long -- USE_LONG_LONG long long -+ (default) int -+ GSLIB_USE_LONG long -+ GSLIB_USE_LONG_LONG long long - - The slong/ulong type is used in relatively few places - for global identifiers and indices. It can be one of - -- macro slong/ulong type -+ macro slong/ulong type - -- (default) int -- GLOBAL_LONG long -- GLOBAL_LONG_LONG long long -+ (default) int -+ GSLIB_USE_GLOBAL_LONG long -+ GSLIB_USE_GLOBAL_LONG_LONG long long - - Since the long long type is not ISO C90, it is never - used unless explicitly asked for. -@@ -34,9 +35,9 @@ - - */ - --#if defined(USE_LONG_LONG) || defined(GLOBAL_LONG_LONG) -+#if defined(GSLIB_USE_LONG_LONG) || defined(GSLIB_USE_GLOBAL_LONG_LONG) - typedef long long long_long; --# define WHEN_LONG_LONG(x) x -+# define GS_WHEN_LONG_LONG(x) x - # if !defined(LLONG_MAX) - # if defined(LONG_LONG_MAX) - # define LLONG_MAX LONG_LONG_MAX -@@ -52,34 +53,34 @@ typedef long long long_long; - # endif - # endif - #else --# define WHEN_LONG_LONG(x) -+# define GS_WHEN_LONG_LONG(x) - #endif - --#if !defined(USE_LONG) && !defined(USE_LONG_LONG) --# define TYPE_LOCAL(i,l,ll) i --#elif defined(USE_LONG) --# define TYPE_LOCAL(i,l,ll) l --#elif defined(USE_LONG_LONG) --# define TYPE_LOCAL(i,l,ll) ll -+#if !defined(GSLIB_USE_LONG) && !defined(GSLIB_USE_LONG_LONG) -+# define GS_TYPE_LOCAL(i,l,ll) i -+#elif defined(GSLIB_USE_LONG) -+# define GS_TYPE_LOCAL(i,l,ll) l -+#elif defined(GSLIB_USE_LONG_LONG) -+# define GS_TYPE_LOCAL(i,l,ll) ll - #endif - --#if !defined(GLOBAL_LONG) && !defined(GLOBAL_LONG_LONG) --# define TYPE_GLOBAL(i,l,ll) i --#elif defined(GLOBAL_LONG) --# define TYPE_GLOBAL(i,l,ll) l -+#if !defined(GSLIB_USE_GLOBAL_LONG) && !defined(GSLIB_USE_GLOBAL_LONG_LONG) -+# define GS_TYPE_GLOBAL(i,l,ll) i -+#elif defined(GSLIB_USE_GLOBAL_LONG) -+# define GS_TYPE_GLOBAL(i,l,ll) l - #else --# define TYPE_GLOBAL(i,l,ll) ll -+# define GS_TYPE_GLOBAL(i,l,ll) ll - #endif - - /* local integer type: for quantities O(N/P) */ --#define sint signed TYPE_LOCAL(int,long,long long) --#define uint unsigned TYPE_LOCAL(int,long,long long) --#define iabs TYPE_LOCAL(abs,labs,llabs) -+#define sint signed GS_TYPE_LOCAL(int,long,long long) -+#define uint unsigned GS_TYPE_LOCAL(int,long,long long) -+#define iabs GS_TYPE_LOCAL(abs,labs,llabs) - - /* global integer type: for quantities O(N) */ --#define slong signed TYPE_GLOBAL(int,long,long long) --#define ulong unsigned TYPE_GLOBAL(int,long,long long) --#define iabsl TYPE_GLOBAL(abs,labs,llabs) -+#define slong signed GS_TYPE_GLOBAL(int,long,long long) -+#define ulong unsigned GS_TYPE_GLOBAL(int,long,long long) -+#define iabsl GS_TYPE_GLOBAL(abs,labs,llabs) - - #endif - -diff --git a/tests/rand_elt_test.h b/tests/rand_elt_test.h -index c4d07a0..fba1d5d 100644 ---- a/tests/rand_elt_test.h -+++ b/tests/rand_elt_test.h -@@ -1,5 +1,6 @@ - #ifndef RAND_ELT_TEST_H - #define RAND_ELT_TEST_H -+ - #include - - static double det_2(const double A[4]) { return A[0]*A[3]-A[1]*A[2]; } diff --git a/extern/patch/mumps/patch_build.diff b/extern/patch/mumps/patch_build.diff index 6f9bd940c..7472015bf 100644 --- a/extern/patch/mumps/patch_build.diff +++ b/extern/patch/mumps/patch_build.diff @@ -32,10 +32,10 @@ index 3be37f8..193e8b5 100644 message(STATUS "MUMPS LAPACK_VENDOR: ${LAPACK_VENDOR}") diff --git a/cmake/FindLAPACK.cmake b/cmake/FindLAPACK.cmake deleted file mode 100644 -index 8647696..0000000 +index 9b9d1d0..0000000 --- a/cmake/FindLAPACK.cmake +++ /dev/null -@@ -1,502 +0,0 @@ +@@ -1,501 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - @@ -392,12 +392,11 @@ index 8647696..0000000 - -# ========== main program - --set(lapack_cray false) --if(DEFINED ENV{CRAYPE_VERSION}) -- set(lapack_cray true) +-if(NOT DEFINED LAPACK_CRAY AND DEFINED ENV{CRAYPE_VERSION}) +- set(LAPACK_CRAY true) -endif() - --if(NOT (lapack_cray +-if(NOT (LAPACK_CRAY - OR OpenBLAS IN_LIST LAPACK_FIND_COMPONENTS - OR Netlib IN_LIST LAPACK_FIND_COMPONENTS - OR Atlas IN_LIST LAPACK_FIND_COMPONENTS @@ -428,7 +427,7 @@ index 8647696..0000000 - openblas_libs() -elseif(AOCL IN_LIST LAPACK_FIND_COMPONENTS) - aocl_libs() --elseif(lapack_cray) +-elseif(LAPACK_CRAY) - # LAPACK is implicitly part of Cray PE LibSci, use Cray compiler wrapper. -endif() - @@ -483,14 +482,14 @@ index 8647696..0000000 -endfunction(lapack_check) - -# --- Check library links --if(lapack_cray OR LAPACK_LIBRARY) +-if(LAPACK_CRAY OR LAPACK_LIBRARY) - lapack_check() -endif() - - -include(FindPackageHandleStandardArgs) - --if(lapack_cray) +-if(LAPACK_CRAY) - find_package_handle_standard_args(LAPACK HANDLE_COMPONENTS - REQUIRED_VARS LAPACK_links - ) @@ -539,7 +538,7 @@ index 8647696..0000000 - -mark_as_advanced(LAPACK_LIBRARY LAPACK_INCLUDE_DIR) diff --git a/cmake/FindSCALAPACK.cmake b/cmake/FindSCALAPACK.cmake -index 9b2e056..166d05f 100644 +index e66930a..5fa9d78 100644 --- a/cmake/FindSCALAPACK.cmake +++ b/cmake/FindSCALAPACK.cmake @@ -52,8 +52,6 @@ References @@ -565,64 +564,7 @@ index 9b2e056..166d05f 100644 list(APPEND CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) if(STATIC IN_LIST SCALAPACK_FIND_COMPONENTS AND -@@ -188,40 +183,9 @@ endfunction(scalapack_lib) - - # === main - --set(scalapack_cray false) --if(DEFINED ENV{CRAYPE_VERSION}) -- set(scalapack_cray true) --endif() -- --if(NOT scalapack_cray) -- if(NOT MKL IN_LIST SCALAPACK_FIND_COMPONENTS AND DEFINED ENV{MKLROOT} AND IS_DIRECTORY "$ENV{MKLROOT}") -- list(APPEND SCALAPACK_FIND_COMPONENTS MKL) -- endif() --endif() -- --if(STATIC IN_LIST SCALAPACK_FIND_COMPONENTS) -- set(_orig_suff ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) --endif() -- --if(MKL IN_LIST SCALAPACK_FIND_COMPONENTS OR MKL64 IN_LIST SCALAPACK_FIND_COMPONENTS) -- scalapack_mkl() --elseif(scalapack_cray) -- # Cray PE has Scalapack build into LibSci. Use Cray compiler wrapper. --else() -- scalapack_lib() --endif() -- --if(STATIC IN_LIST SCALAPACK_FIND_COMPONENTS) -- if(SCALAPACK_LIBRARY) -- set(SCALAPACK_STATIC_FOUND true) -- endif() -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_orig_suff}) --endif() -- - # --- Check that Scalapack links - --if(scalapack_cray OR SCALAPACK_LIBRARY) -+if(SCALAPACK_LIBRARIES) - scalapack_check() - endif() - -@@ -229,32 +193,19 @@ endif() - - include(FindPackageHandleStandardArgs) - --if(scalapack_cray) -- find_package_handle_standard_args(SCALAPACK HANDLE_COMPONENTS -- REQUIRED_VARS SCALAPACK_links -- ) --else() -- find_package_handle_standard_args(SCALAPACK HANDLE_COMPONENTS -- REQUIRED_VARS SCALAPACK_LIBRARY SCALAPACK_links -- ) --endif() -+find_package_handle_standard_args(SCALAPACK HANDLE_COMPONENTS -+REQUIRED_VARS SCALAPACK_LIBRARIES SCALAPACK_links -+) +@@ -240,20 +235,13 @@ endif() if(SCALAPACK_FOUND) # need if _FOUND guard as can't overwrite imported target even if bad @@ -644,7 +586,7 @@ index 9b2e056..166d05f 100644 # For MKL, we don't use FindLapack, so define LAPACK::LAPACK as alias if(MKL_FOUND AND NOT TARGET LAPACK::LAPACK) -@@ -262,5 +213,3 @@ Scalapack include directories: ${SCALAPACK_INCLUDE_DIRS}") +@@ -261,5 +249,3 @@ Scalapack include directories: ${SCALAPACK_INCLUDE_DIRS}") endif() endif() endif() diff --git a/singularity/singularity.def b/singularity/singularity.def index ae4955a5b..509f276b9 100644 --- a/singularity/singularity.def +++ b/singularity/singularity.def @@ -40,7 +40,7 @@ From: rockylinux:9 pkg-config python3 wget zlib # Install CMake (STRUMPACK requires >= 3.21) - CMAKE_VERSION=3.26.5 + CMAKE_VERSION=3.31.0 wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-$(uname -m).sh /bin/bash cmake-$CMAKE_VERSION-* --skip-license --prefix=/usr rm -rf cmake-*