Android:Uppercase example. Computation Error: Output file for the task is absent

Message boards : Android : Android:Uppercase example. Computation Error: Output file for the task is absent
Message board moderation

To post messages, you must log in.

AuthorMessage
Holako

Send message
Joined: 14 Mar 16
Posts: 5
New Zealand
Message 68278 - Posted: 14 Mar 2016, 15:08:35 UTC
Last modified: 14 Mar 2016, 15:31:52 UTC

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 the androidarm toolchain
    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



Issues I have encountered

Downloaded the BOINC from Google Play, and added my own project URL. It downloaded all the tasks. The tasks were running but it stopped because of the missing output as shown in the screenshots. I have searched about the issue, and someone said in other forums that

'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
ID: 68278 · Report as offensive
Profile Ageless
Volunteer moderator
Project administrator
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 12588
Netherlands
Message 68280 - Posted: 14 Mar 2016, 16:38:53 UTC - in response to Message 68278.  

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
Jord
Please do not private message me for tech support. Use the forums for that. Tech PMs will be ignored.

quote: "Isn't the best defense always a good attack?"
ID: 68280 · Report as offensive
Holako

Send message
Joined: 14 Mar 16
Posts: 5
New Zealand
Message 68281 - Posted: 14 Mar 2016, 17:13:29 UTC - in response to Message 68280.  
Last modified: 14 Mar 2016, 17:36:29 UTC

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
ID: 68281 · Report as offensive
Profile Ageless
Volunteer moderator
Project administrator
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 29 Aug 05
Posts: 12588
Netherlands
Message 68282 - Posted: 14 Mar 2016, 18:13:30 UTC

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.
Jord
Please do not private message me for tech support. Use the forums for that. Tech PMs will be ignored.

quote: "Isn't the best defense always a good attack?"
ID: 68282 · Report as offensive
Holako

Send message
Joined: 14 Mar 16
Posts: 5
New Zealand
Message 68283 - Posted: 14 Mar 2016, 19:23:15 UTC - in response to Message 68282.  

Thank you. I will keep trying.
ID: 68283 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 750
Finland
Message 68284 - Posted: 14 Mar 2016, 19:37:48 UTC - in response to Message 68281.  

Built the app

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"

make -f Makefile_android



6) my Makefile_android is this:
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.


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.
ID: 68284 · Report as offensive
Holako

Send message
Joined: 14 Mar 16
Posts: 5
New Zealand
Message 68288 - Posted: 15 Mar 2016, 10:57:55 UTC - in response to Message 68284.  

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.
ID: 68288 · Report as offensive
Juha
Volunteer developer
Volunteer tester
Help desk expert

Send message
Joined: 20 Nov 12
Posts: 750
Finland
Message 68310 - Posted: 15 Mar 2016, 19:24:33 UTC - in response to Message 68288.  

Yeah, something like that.
ID: 68310 · Report as offensive
Holako

Send message
Joined: 14 Mar 16
Posts: 5
New Zealand
Message 68335 - Posted: 16 Mar 2016, 18:15:46 UTC - in response to Message 68310.  

That fixed the issue :) Thank you
ID: 68335 · Report as offensive

Message boards : Android : Android:Uppercase example. Computation Error: Output file for the task is absent

Copyright © 2018 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.