From 1c22be4743efee4171cbdcb2a9ed4545d46d3ad1 Mon Sep 17 00:00:00 2001
From: Carl Christensen <carlgt1@yahoo.com>
Date: Tue, 27 Aug 2013 19:00:19 -0400
Subject: [PATCH] Android/ARM Neon/VFP FP benchmarks should be working other
than figuring out the conditional OS_ARM_LINUX in client/Makefile.am
---
android/build_boinc.sh | 6 +++---
android/build_curl.sh | 2 +-
android/build_libraries.sh | 7 ++++---
android/build_openssl.sh | 2 +-
client/Makefile.am | 10 ++++++++++
client/cs_benchmark.cpp | 24 ++++++++++++++++++++++++
client/whetstone.cpp | 19 +++++++++++++++++++
configure.ac | 1 +
8 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/android/build_boinc.sh b/android/build_boinc.sh
index b442007..0eaa5b5 100755
|
a
|
b
|
COMPILEBOINC="yes" |
| 10 | 10 | CONFIGURE="yes" |
| 11 | 11 | MAKECLEAN="yes" |
| 12 | 12 | |
| 13 | | export BOINC=".." #BOINC source code |
| 14 | | export OPENSSL_DIR=$BOINC/../boinc_depends_android_eclipse/openssl |
| 15 | | export CURL_DIR=$BOINC/../boinc_depends_android_eclipse/curl |
| | 13 | export BOINC="/home/carlgt1/projects/boinc" #BOINC source code |
| | 14 | export OPENSSL_DIR="/home/carlgt1/projects/extra/openssl-1.0.1e" |
| | 15 | export CURL_DIR="/home/carlgt1/projects/extra/curl-7.32.0" |
| 16 | 16 | export PKG_CONFIG_DEBUG_SPEW=1 |
| 17 | 17 | |
| 18 | 18 | export ANDROIDTC="$HOME/android-tc" |
diff --git a/android/build_curl.sh b/android/build_curl.sh
index 726ae28..e377c1d 100755
|
a
|
b
|
COMPILECURL="yes" |
| 10 | 10 | CONFIGURE="yes" |
| 11 | 11 | MAKECLEAN="yes" |
| 12 | 12 | |
| 13 | | CURL="/home/boincadm/src/curl-7.28.1" #CURL sources, required by BOINC |
| | 13 | export CURL="/home/carlgt1/projects/extra/curl-7.32.0" |
| 14 | 14 | |
| 15 | 15 | export ANDROIDTC="$HOME/android-tc" |
| 16 | 16 | export TCBINARIES="$ANDROIDTC/bin" |
diff --git a/android/build_libraries.sh b/android/build_libraries.sh
index 992ef7c..7be38f1 100755
|
a
|
b
|
COMPILEBOINC="yes" |
| 11 | 11 | CONFIGURE="yes" |
| 12 | 12 | MAKECLEAN="yes" |
| 13 | 13 | |
| 14 | | export BOINC=".." #BOINC source code |
| 15 | | export OPENSSL_DIR=$BOINC/../boinc_depends_android_eclipse/openssl |
| 16 | | export CURL_DIR=$BOINC/../boinc_depends_android_eclipse/curl |
| | 14 | export BOINC="/home/carlgt1/projects/boinc" |
| | 15 | export OPENSSL_DIR="/home/carlgt1/projects/extra/openssl-1.0.1e" |
| | 16 | export CURL_DIR="/home/carlgt1/projects/extra/curl-7.32.0" |
| | 17 | |
| 17 | 18 | export PKG_CONFIG_DEBUG_SPEW=1 |
| 18 | 19 | |
| 19 | 20 | export ANDROIDTC="$HOME/android-tc" |
diff --git a/android/build_openssl.sh b/android/build_openssl.sh
index d493e3e..0ec6e29 100755
|
a
|
b
|
COMPILEOPENSSL="yes" |
| 10 | 10 | CONFIGURE="yes" |
| 11 | 11 | MAKECLEAN="yes" |
| 12 | 12 | |
| 13 | | OPENSSL="/home/boincadm/src/openssl-1.0.1c" #openSSL sources, requiered by BOINC |
| | 13 | export OPENSSL="/home/carlgt1/projects/extra/openssl-1.0.1e" |
| 14 | 14 | |
| 15 | 15 | export ANDROIDTC="$HOME/android-tc" |
| 16 | 16 | export TCBINARIES="$ANDROIDTC/bin" |
diff --git a/client/Makefile.am b/client/Makefile.am
index 0f474b8..71c6878 100644
|
a
|
b
|
boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD |
| 95 | 95 | |
| 96 | 96 | boinc_clientdir = $(bindir) |
| 97 | 97 | |
| | 98 | #if OS_ARM_LINUX |
| | 99 | boinc_client_LDADD += libwhetneon.a libwhetvfp.a |
| | 100 | noinst_LIBRARIES = libwhetneon.a libwhetvfp.a |
| | 101 | libwhetneon_a_SOURCES = whetstone.cpp whetstone.h |
| | 102 | libwhetneon_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon |
| | 103 | |
| | 104 | libwhetvfp_a_SOURCES = whetstone.cpp whetstone.h |
| | 105 | libwhetvfp_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_VFP -mfloat-abi=softfp -mfpu=vfp |
| | 106 | #endif |
| | 107 | |
| 98 | 108 | switcher_SOURCES = switcher.cpp |
| 99 | 109 | switcher_LDFLAGS = $(AM_LDFLAGS) -L../lib |
| 100 | 110 | switcher_LDADD = $(LIBBOINC) |
diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp
index e41302f..a3371fa 100644
|
a
|
b
|
|
| 60 | 60 | #include "filesys.h" |
| 61 | 61 | #include "util.h" |
| 62 | 62 | #include "cpu_benchmark.h" |
| | 63 | |
| | 64 | // CMC HERE - header file for whetstone namespaces (neon & vfp) |
| | 65 | #ifdef ANDROID |
| | 66 | #include "whetstone.h" |
| | 67 | #endif |
| | 68 | |
| 63 | 69 | #include "client_msgs.h" |
| 64 | 70 | #include "log_flags.h" |
| 65 | 71 | #include "client_state.h" |
| … |
… |
int cpu_benchmarks(BENCHMARK_DESC* bdp) { |
| 171 | 177 | |
| 172 | 178 | bdp->error_str[0] = '\0'; |
| 173 | 179 | host_info.clear_host_info(); |
| | 180 | // CMC here |
| | 181 | #ifdef ANDROID |
| | 182 | // check for vfp or neon process or no special fp process |
| | 183 | // namespaces separate the different compilations of the same whetstone.cpp file |
| | 184 | if ( strstr(gstate.host_info.p_features, " neon ") != NULL ) { |
| | 185 | // have ARM neon FP capabilities |
| | 186 | retval = android_neon::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); |
| | 187 | } |
| | 188 | else if ( strstr(gstate.host_info.p_features, " vfp ") != NULL ) { |
| | 189 | // have ARM vfp FP capabilities |
| | 190 | retval = android_vfp::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); |
| | 191 | } |
| | 192 | else { // just run normal test |
| | 193 | retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); |
| | 194 | } |
| | 195 | #else |
| 174 | 196 | retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); |
| | 197 | #endif |
| | 198 | // CMC end |
| 175 | 199 | if (retval) { |
| 176 | 200 | bdp->error = true; |
| 177 | 201 | sprintf(bdp->error_str, "FP benchmark ran only %f sec; ignoring", fp_time); |
diff --git a/client/whetstone.cpp b/client/whetstone.cpp
index 0aec5d1..666364c 100644
|
a
|
b
|
|
| 34 | 34 | #endif |
| 35 | 35 | |
| 36 | 36 | #include "util.h" |
| | 37 | // CMC android |
| | 38 | #ifdef ANDROID |
| | 39 | #include "whetstone.h" |
| | 40 | #endif |
| 37 | 41 | #include "cpu_benchmark.h" |
| 38 | 42 | |
| | 43 | #ifndef SPDP |
| 39 | 44 | #define SPDP double |
| | 45 | #endif |
| | 46 | |
| | 47 | #ifdef ANDROID |
| | 48 | #ifdef ANDROID_NEON |
| | 49 | namespace android_neon { |
| | 50 | #else |
| | 51 | #ifdef ANDROID_VFP |
| | 52 | namespace android_vfp { |
| | 53 | #endif |
| | 54 | #endif |
| | 55 | #endif |
| 40 | 56 | |
| 41 | 57 | // External array; store results here so that optimizing compilers |
| 42 | 58 | // don't do away with their computation. |
| … |
… |
int whetstone(double& flops, double& cpu_time, double min_cpu_time) { |
| 278 | 294 | return 0; |
| 279 | 295 | } |
| 280 | 296 | |
| | 297 | #if defined(ANDROID_NEON) || defined(ANDROID_VFP) |
| | 298 | } |
| | 299 | #endif // namespace closure |
diff --git a/configure.ac b/configure.ac
index 2823dc3..988f5ff 100644
|
a
|
b
|
dnl In case anyone wants to try building the windows code using mingw! |
| 779 | 779 | AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null]) |
| 780 | 780 | dnl or OS2 |
| 781 | 781 | AM_CONDITIONAL(OS_OS2, [echo $host_os | grep '^os2' > /dev/null]) |
| | 782 | AM_CONDITIONAL(OS_ARM_LINUX, [echo $host_os | grep '^arm-linux' > /dev/null]) |
| 782 | 783 | |
| 783 | 784 | dnl Whether to build fcgi components |
| 784 | 785 | AM_CONDITIONAL(ENABLE_FCGI,[test "${enable_fcgi}" = yes]) |