From 4379559aa794cedcfd3a1bfe2bd92187d837f6f2 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Mon, 29 Jul 2024 13:30:55 +0200 Subject: [PATCH] Use sed command to fix numpy --- Makefile | 3 +-- src_patches/replace_old_macros_numpy.sed | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 17d0de8..f71a95d 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,5 @@ get-dakota-src: git submodule update --init packages/pecos && \ git submodule update --init packages/surfpack && \ git apply ../src_patches/dakota-src.patch && \ - git apply --whitespace=nowarn ../src_patches/numpy_pyarray.patch && \ find . \( -name \*.cpp -o -name \*.hpp -o -name \*.c -o -name \*.h \) -exec \ - sed -i -f ../src_patches/replace_old_macros_numpy.sed {} + + sed -i -E -f ../src_patches/replace_old_macros_numpy.sed {} + diff --git a/src_patches/replace_old_macros_numpy.sed b/src_patches/replace_old_macros_numpy.sed index e1402a9..f8a4794 100644 --- a/src_patches/replace_old_macros_numpy.sed +++ b/src_patches/replace_old_macros_numpy.sed @@ -149,3 +149,4 @@ s/\bPyArray_MAX_ELSIZE\b/NPY_MAX_ELSIZE/g s/\bPyArray_USE_PYMEM\b/NPY_USE_PYMEM/g s/\bPyArray_RemoveLargest\b/PyArray_RemoveSmallest/g s/\bPyArray_UCS4\b/npy_ucs4/g +s/PyArray_(DIM|NDIM)\(([[:alpha:]]*)([^)]*)\)/PyArray_\1(reinterpret_cast(\2)\3)/g