Skip to content

Commit

Permalink
openblas 32 64
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchen committed Apr 21, 2017
1 parent 4bb50d6 commit 769af79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions swig/Android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ BIT = 32
ifeq ($(BIT), 64)
NDKINSTALLEDROOT := $(PWD)/ndk_install_64bit
OPENBLASTARGET := ARMV8
OPENBLASDIR := OpenBLAS-Android-ARM64
else
NDKINSTALLEDROOT := $(PWD)/ndk_install_32bit
OPENBLASTARGET := ARMV7
OPENBLASDIR := OpenBLAS-Android-ARM32
endif
NDKROOT := $(PWD)/android-ndk-${NDK_VERSION}

Expand All @@ -28,7 +30,7 @@ SNOWBOYDETECTSWIGCC = snowboy-detect-swig.cc
SNOWBOYDETECTJAVAPKG = ai.kitt.snowboy
SNOWBOYDETECTJAVAPKGDIR = java/ai/kitt/snowboy/
SNOWBOYDETECTSWIGLIBFILE = libsnowboy-detect-android.so
OPENBLASLIBFILE = OpenBLAS-Android/install/lib/libopenblas.a
OPENBLASLIBFILE = $(OPENBLASDIR)/install/lib/libopenblas.a

ARCH := arm
TOPDIR := ../../
Expand Down Expand Up @@ -80,7 +82,7 @@ $(NDKINSTALLEDROOT):
@-./install_ndk.sh ${NDK_VERSION} ${BIT}

$(OPENBLASLIBFILE): $(NDKINSTALLEDROOT)
@-./install_openblas.sh $(CC) $(AR) $(OPENBLASTARGET)
@-./install_openblas.sh $(CC) $(AR) $(OPENBLASTARGET) $(OPENBLASDIR)

$(SNOWBOYDETECTSWIGCC): $(SNOWBOYDETECTSWIGITF)
@-mkdir -p $(SNOWBOYDETECTJAVAPKGDIR)
Expand Down
9 changes: 5 additions & 4 deletions swig/Android/install_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
CC=$1
AR=$2
TARGET=$3
DIR=$4

if [ ! -d "OpenBLAS-Android" ]; then
git clone https://github.com/xianyi/OpenBLAS.git OpenBLAS-Android
cd OpenBLAS-Android
if [ ! -d $DIR ]; then
git clone https://github.com/xianyi/OpenBLAS.git $DIR
cd $DIR
git checkout arm_soft_fp_abi || exit 1;
git reset --hard b5c96fcfcdc82945502a2303116a64d89985daf5 || exit 1;
cd ..
fi

cd OpenBLAS-Android
cd $DIR
make USE_THREAD=0 TARGET=${TARGET} HOSTCC=gcc CC=${CC} AR=${AR} \
NOFORTRAN=1 ARM_SOFTFP_ABI=1 libs || exit 1;
make PREFIX=`pwd`/install install || exit 1;

0 comments on commit 769af79

Please sign in to comment.