Skip to content

Commit

Permalink
add cflag SUFFIX and PREFIX defines to pkgconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Jan 25, 2024
1 parent 1192235 commit 2cf9674
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tools/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ dlltool --input-def ${DLL_BASENAME}.def \
# Replace the DLL name with the generated name.
sed -i "s/ -lopenblas.*$/ -l${DLL_BASENAME:3}/g" pkgconfig/openblas*.pc
mv pkgconfig/*.pc pkgconfig/scipy-openblas.pc
if [ "$if_bits" == "64" ]; then
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_/" -i pkgconfig/scipy-openblas.pc
else
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_/" -i pkgconfig/scipy-openblas.pc
fi
popd
# Build template site.cfg for using this build
cat > ${build_bits}/site.cfg.template << EOF
Expand Down
7 changes: 4 additions & 3 deletions tools/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function do_build_lib {
else
local version=$(cd OpenBLAS && git describe --tags --abbrev=8)
fi
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
local plat_tag=$(get_plat_tag $plat)
local suff=""
[ -n "$suffix" ] && suff="-$suffix"
Expand All @@ -186,11 +187,11 @@ function do_build_lib {
# do it ourselves
static_libname=$(basename `find OpenBLAS -maxdepth 1 -type f -name '*.a' \! -name '*.dll.a'`)
renamed_libname=$(basename `find OpenBLAS -maxdepth 1 -type f -name '*.renamed'`)
# set -x # echo commands
cp -f "OpenBLAS/${renamed_libname}" "$BUILD_PREFIX/lib/${static_libname}"
# set +x
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_ -DBLAS_SYMBOL_SUFFIX=64_/" -i.bak $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
else
sed -e "s/^Cflags.*/\0 -DBLAS_SYMBOL_PREFIX=scipy_/" -i.bak $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc
fi
mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc

local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz"
tar zcvf libs/$out_name \
Expand Down

0 comments on commit 2cf9674

Please sign in to comment.