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