diff --git a/tools/build_openblas.sh b/tools/build_openblas.sh index 884d066..6d6677f 100644 --- a/tools/build_openblas.sh +++ b/tools/build_openblas.sh @@ -93,9 +93,7 @@ OPENBLAS_VERSION=$(git describe --tags --abbrev=8) # Patch OpenBLAS build to resolve all symbols and avoid linking # with libquadmath -if [ "$BUILD_BITS" == 64 ]; then - patch -p1 < ../patches-windows/openblas-make-libs.patch -fi +patch -p1 < ../patches-windows/openblas-make-libs.patch # Build OpenBLAS make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \ @@ -108,10 +106,7 @@ make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \ $interface_flags make PREFIX=$openblas_root/$build_bits $interface_flags install DLL_BASENAME=libscipy_openblas${LIBNAMESUFFIX} -echo ------ -ls *.dll.a -echo ------ -cp -f *.dll.a $openblas_root/$build_bits/lib/{DLL_BASENAME}.dll.a +cp -f *.dll.a $openblas_root/$build_bits/lib/${DLL_BASENAME}.dll.a # OpenBLAS does not build a symbol-suffixed static library on Windows: # do it ourselves. On 32-bit builds, the objcopy.def names need a '_' prefix @@ -134,22 +129,30 @@ cp -f "${static_libname}.renamed" "$openblas_root/$build_bits/lib/${DLL_BASENAME # Make sure quadmath library is not statically linked in to the DLL by checking # the output.map generated by the linker when using `-Wl,-gc-sections -Wl,-s` # the map will have libname(o-filename) for each function pulled out of the -# library -# The file itself appears in the map -grep -A 3 "libquadmath.a(" output.map +# library libname +# The file itself appears in the map, so look for "libquadmath.a(". Use '-A 3' +# to show a bit of context if any symbols appear (which should not happen) +set +e +grep -A 3 "libquadmath.a(" exports/output.map case $? in 0) - echo "link uses libquadmath.a when it should not" - exit -1 - ;; - 2) - echo "could not find 'output.map' to verify linking avoids libquadmath.a" - exit -1 + echo "link uses libquadmath.a when it should not" + exit -1 ;; 1) - echo "verified no 'libquadmath' used when linking" + if [ -f exports/output.map ]; then + echo "Good, verified no 'libquadmath' used when linking" + else + echo "error occurred" + exit -1 + fi + ;; + *) + echo "grep returned $?, error occurred" + exit -1 ;; esac +set -e cd $openblas_root # Copy library link file for custom name