Skip to content

Commit

Permalink
simplify, for now disable SYMBOLPREFIX to make sure tests pass on win…
Browse files Browse the repository at this point in the history
…dows
  • Loading branch information
mattip committed Nov 2, 2023
1 parent 4b0b196 commit ff6cfd4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ fflags="$fextra $cflags -frecursive -ffpe-summary=invalid,zero"
# Set suffixed-ILP64 flags
if [ "$if_bits" == "64" ]; then
SYMBOLSUFFIX="64_"
interface64_flags="INTERFACE64=1 SYMBOLSUFFIX=${SYMBOLSUFFIX}"
interface_flags="INTERFACE64=1 SYMBOLSUFFIX=${SYMBOLSUFFIX}"
# We override FCOMMON_OPT, so we need to set default integer manually
fflags="$fflags -fdefault-integer-8"
else
interface64_flags=""
interface_flags=""
fi
# XXX uncomment this
# interface_flags="$interface_flags SYMBOLPREFIX=scipy_"

# Build name for output library from gcc version and OpenBLAS commit.
GCC_TAG="gcc_$(gcc -dumpversion | tr .- _)"
Expand All @@ -95,17 +97,15 @@ make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
COMMON_OPT="$cflags" \
FCOMMON_OPT="$fflags" \
MAX_STACK_ALLOC=2048 \
SYMBOLPREFIX="scipy_" \
$interface64_flags
make PREFIX=$openblas_root/$build_bits $interface64_flags \
SYMBOLPREFIX="scipy_" install
$interface_flags
make PREFIX=$openblas_root/$build_bits $interface_flags install
DLL_BASENAME=libscipy_openblas${SYMBOLSUFFIX}_${LIBNAMESUFFIX}

# OpenBLAS does not build a symbol-suffixed static library on Windows:
# do it ourselves
set -x # echo commands
static_libname=$(find . -maxdepth 1 -type f -name '*.a' \! -name '*.dll.a' | tail -1)
make -C exports SYMBOLPREFIX="scipy_" $interface64_flags objcopy.def
make -C exports $interface_flags objcopy.def
objcopy --redefine-syms exports/objcopy.def "${static_libname}" "${static_libname}.renamed"
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${static_libname}"
cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME}.a"
Expand Down

0 comments on commit ff6cfd4

Please sign in to comment.