Message boards : Android : Android:Uppercase example. Computation Error: Output file for the task is absent
Message board moderation
Author | Message |
---|---|
Send message Joined: 14 Mar 16 Posts: 5 |
I am using the uppercase example from the BOINC samples in order to build BOINC app for android. I have setup my server using this tutorial, and I am following this tutorial to build the BOINC app for android. What have I done so far?
Built openssl and curl arm libraries Built boinc arm libraries Compiled the uppercase source code without any errors. Built the project in the server using the command: --test_app uppercase, so that all the templates are built. All these steps were done using the ARM scripts given here. I have uploaded the compiled uppercase app in the apps -> example_app->30000->arm-android-linux-gnu folder
'Output file absent' is always a symptom of an earlier failure, not a problem in itself I am trying to understand what went wrong having followed all the steps. O I made sure that it support PIE. This is the script which I am running to compile my uppercase app. #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildApp # # Script to compile a generic application on Android export ANDROIDTC="$HOME/androidarm-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ export LD=arm-linux-androideabi-ld export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include" make clean if [ -e "./configure" ]; then ./configure --host=arm-linux --prefix=$TCINCLUDES --libdir="$TCINCLUDES/lib" --disable-shared --enable-static fi make -f Makefile_android Screenshots: Other Information Tested on Android 5.0, 4.2, 4.1 on ARM architecture but the results are the same. I made the windows client version, and it is working fine. NDK version: NDK r10e Curl: curl-7.47.0 Openssl: openssl-1.0.1 |
Send message Joined: 29 Aug 05 Posts: 15581 |
Could you post the error as it shows in the TaskID on the web site, in your account->computers on this account->the device with the problem->Tasks->Task details of the tasks with the computation error. Or could you otherwise post the messages log of around such an error? The 'Output file is absent' is usually at the end of the error, there's always a lot of stuff before that. E.g. 8/6/2008 2:24:21 AM|Einstein@Home|[error] Process creation failed: Access is denied. (0x5) 8/6/2008 2:24:22 AM|Einstein@Home|Computation for task h1_0228.00_S5R4__46_S5R4a_0 finished 8/6/2008 2:24:22 AM|Einstein@Home|Output file h1_0228.00_S5R4__46_S5R4a_0_0 for task h1_0228.00_S5R4__46_S5R4a_0 absent |
Send message Joined: 14 Mar 16 Posts: 5 |
Hi, I found this error Stderr output <core_client_version>7.4.41</core_client_version> <![CDATA[ <message> process exited with code 1 (0x1, -255) </message> <stderr_txt> error: only position independent executables (PIE) are supported. </stderr_txt> ]]> This is wired. I have already compiled the app with -fPIE flag as seen in this script ------------------------------------------------------ Here are my steps which I have done to compile: 1) First I built the android tool chain with the android platform 21. This is the script I have used #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildClient# # # Script to setup Android toolchain export ANDROIDTC="$HOME/androidarm-tc" export NDKROOT="$HOME/android-ndk-r10e" if [ ! -d $ANDROIDTC/arm-linux-androideabi ]; then $NDKROOT/build/tools/make-standalone-toolchain.sh --platform=android-21 --arch=arm --install-dir=$ANDROIDTC fi 2) Then, built the openssl arm with this script: #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildClient# # # Script to compile OpenSSL for Android COMPILEOPENSSL="yes" CONFIGURE="yes" MAKECLEAN="yes" OPENSSL="/home/boincadm/openssl-1.0.1r" #openSSL sources, requiered by BOINC export ANDROIDTC="$HOME/androidarm-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ export LD=arm-linux-androideabi-ld export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -funroll-loops -fexceptions -O3 -fomit-frame-pointer -fPIE" export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include" # Prepare android toolchain and environment ./build_androidtc_arm.sh if [ -n "$COMPILEOPENSSL" ]; then echo "================building openssl from $OPENSSL=============================" cd $OPENSSL if [ -n "$MAKECLEAN" ]; then make clean fi if [ -n "$CONFIGURE" ]; then ./Configure linux-generic32 no-shared no-dso -DL_ENDIAN --openssldir="$TCINCLUDES/ssl" #override flags in Makefile sed -e "s/^CFLAG=.*$/`grep -e \^CFLAG= Makefile` \$(CFLAGS)/g s%^INSTALLTOP=.*%INSTALLTOP=$TCINCLUDES%g" Makefile > Makefile.out mv Makefile.out Makefile fi make make install_sw echo "========================openssl DONE==================================" fi 3) Built the curl arm with this script: #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildClient# # # Script to compile Libcurl for Android COMPILECURL="yes" CONFIGURE="yes" MAKECLEAN="yes" CURL="/home/boincadm/curl-7.47.0" #CURL sources, required by BOINC export ANDROIDTC="$HOME/androidarm-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ export LD=arm-linux-androideabi-ld export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -funroll-loops -fexceptions -O3 -fomit-frame-pointer -fPIE" export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include" # Prepare android toolchain and environment ./build_androidtc_arm.sh if [ -n "$COMPILECURL" ]; then echo "==================building curl from $CURL=================================" cd $CURL if [ -n "$MAKECLEAN" ]; then make clean fi if [ -n "$CONFIGURE" ]; then ./configure --host=arm-linux --prefix=$TCINCLUDES --libdir="$TCINCLUDES/lib" --disable-shared --enable-static --with-random=/dev/urandom fi make make install echo "========================curl done=================================" fi 4) built boinc arm libraries using this script #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildApp# # # Script to compile various BOINC libraries for Android to be used # by science applications COMPILEBOINC="yes" CONFIGURE="yes" MAKECLEAN="yes" export BOINC=".." #BOINC source code export ANDROIDTC="$HOME/androidarm-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ export LD=arm-linux-androideabi-ld export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -DDECLARE_TIMEZONE -Wall -I$TCINCLUDES/include -I$ANDROIDTC/include/c++/4.8 -O3 -fomit-frame-pointer -fPIE" export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -I$ANDROIDTC/include/c++/4.8 -funroll-loops -fexceptions -O3 -fomit-frame-pointer -fPIE" export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include -I$ANDROIDTC/includec++/4.8" export PKG_CONFIG_SYSROOT_DIR=$TCSYSROOT # Prepare android toolchain and environment ./build_androidtc_arm.sh if [ -n "$COMPILEBOINC" ]; then echo "==================building Libraries from $BOINC==========================" cd $BOINC if [ -n "$MAKECLEAN" ]; then make clean fi if [ -n "$CONFIGURE" ]; then ./_autosetup ./configure --host=arm-linux --with-boinc-platform="arm-android-linux-gnu" --prefix=$TCINCLUDES --libdir="$TCINCLUDES/lib" --with-ssl=$TCINCLUDES --disable-server --disable-manager --disable-client --disable-shared --enable-static --enable-boinczip fi make make stage make install echo "=============================BOINC done=============================" fi 5) Built the app #/bin/sh # # See: http://boinc.berkeley.edu/trac/wiki/AndroidBuildApp # # Script to compile a generic application on Android export ANDROIDTC="$HOME/androidarm-tc" export TCBINARIES="$ANDROIDTC/bin" export TCINCLUDES="$ANDROIDTC/arm-linux-androideabi" export TCSYSROOT="$ANDROIDTC/sysroot" export STDCPPTC="$TCINCLUDES/lib/libstdc++.a" export PATH="$PATH:$TCBINARIES:$TCINCLUDES/bin" export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ export LD=arm-linux-androideabi-ld export CFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export CXXFLAGS="--sysroot=$TCSYSROOT -DANDROID -Wall -I$TCINCLUDES/include -O3 -fomit-frame-pointer -fPIE" export LDFLAGS="-L$TCSYSROOT/usr/lib -L$TCINCLUDES/lib -llog -fPIE -pie" export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include" make clean if [ -e "./configure" ]; then ./configure --host=arm-linux --prefix=$TCINCLUDES --libdir="$TCINCLUDES/lib" --disable-shared --enable-static fi make -f Makefile_android 6) my Makefile_android is this: BOINC_DIR = /home/boincadm/boinc BOINC_API_DIR = $(BOINC_DIR)/api BOINC_LIB_DIR = $(BOINC_DIR)/lib #TCSYSROOT gets defined by AndroidBOINC build script CXXFLAGS = --sysroot=$(TCSYSROOT) \ -DANDROID \ -DAPP_GRAPHICS \ -I$(BOINC_DIR) \ -I$(BOINC_LIB_DIR) \ -I$(BOINC_API_DIR) \ -I$(HOME)/androidarm-tc/include/c++/4.8/ \ -L. # the following should be freeglut; use nm to check # you may have to change the paths for your system ifeq ($(wildcard /usr/local/lib/libglut.a),) LIBGLUT = /usr/lib/libglut.a LIBGLU = /usr/lib/libGLU.a LIBJPEG = /usr/lib/libjpeg.a else LIBGLUT = /usr/local/lib/libglut.a LIBGLU = /usr/local/lib/libGLU.a LIBJPEG = /usr/local/lib/libjpeg.a endif PROGS = uc2 \ # uc2_graphics is not supported on Android all: $(PROGS) libstdc++.a: ln -s $(STDCPPTC) #create symbolic link to Android-specific stdc++ library, variable gets defined by AndroidBOINC build script clean: /bin/rm -f $(PROGS) *.o libstdc++.a distclean: /bin/rm -f $(PROGS) *.o libstdc++.a install: uc2 # specify library paths explicitly (rather than -l) # because otherwise you might get a version in /usr/lib etc. uc2: uc2.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a $(CXX) $(CXXFLAGS) -o uc2 uc2.o libstdc++.a \ $(BOINC_API_DIR)/libboinc_api.a \ $(BOINC_LIB_DIR)/libboinc.a \ -llog uc2_graphics: uc2_graphics.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_graphics2.a $(CXX) $(CXXFLAGS) -o uc2_graphics uc2_graphics.o libstdc++.a -pthread \ $(BOINC_API_DIR)/libboinc_graphics2.a \ $(BOINC_API_DIR)/libboinc_api.a \ $(BOINC_LIB_DIR)/libboinc.a \ $(LIBGLUT) $(LIBGLU) $(LIBJPEG) \ -lGL -lX11 -lXmu -lm Can anyone spot any errors |
Send message Joined: 29 Aug 05 Posts: 15581 |
I'll see if I can find one of the developers to look over the scripts. Can't guarantee anything. Otherwise one of the Linux gurus may be able to help out. |
Send message Joined: 14 Mar 16 Posts: 5 |
Thank you. I will keep trying. |
Send message Joined: 20 Nov 12 Posts: 801 |
Built the app I'm not seeing -fPIE in the later CXXFLAGS. When you write it like that it overrides the CXXFLAGS set in the script. Try adding $(CXXFLAGS) to it. |
Send message Joined: 14 Mar 16 Posts: 5 |
Juha, Do you mean in my makefile?, so I will have something like this: CXXFLAGS = --sysroot=$(TCSYSROOT) \ -fPIE -DANDROID \ -DAPP_GRAPHICS \ -I$(BOINC_DIR) \ -I$(BOINC_LIB_DIR) \ -I$(BOINC_API_DIR) \ -I$(HOME)/androidarm-tc/include/c++/4.8/ \ -L. |
Send message Joined: 20 Nov 12 Posts: 801 |
Yeah, something like that. |
Send message Joined: 14 Mar 16 Posts: 5 |
That fixed the issue :) Thank you |
Copyright © 2025 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.