Message boards :
Number crunching :
Building seti app for the Raspberry Pi
Message board moderation
Author | Message |
---|---|
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
I'm trying to build the fastest v8 seti_boinc app I can for the Raspberry Pi - separate apps for the v1 Pi and the v2 Pi. The Raspbian version is 2015-11-21-raspbian-jessie-lite, so it is using gcc 4.9.2. My first question is what are the optimum CFLAGS? I'm using the following: Raspberry Pi v1 (A, B, A+, B+, Zero) nano ~/.bashrc At the end of the file add: CC=gcc export CC CFLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -O3" export CFLAGS CXXFLAGS="$CFLAGS" export CXXFLAGS On the Raspberry Pi v2 nano ~/.bashrc At the end of the file add: CC=gcc export CC CFLAGS="-march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -ffast-math -funsafe-math-optimizations -O3" export CFLAGS CXXFLAGS="$CFLAGS" export CXXFLAGS |
![]() Send message Joined: 7 Nov 13 Posts: 12 Credit: 477,077 RAC: 0 ![]() |
Good luck ! I have 2 Pi devices and can't wait to see them crunching for SETI. If you make a successful build , Me (and other users) would be really grateful if you share it :) |
ShootY ![]() Send message Joined: 15 Jan 11 Posts: 71 Credit: 21,700,959 RAC: 41 ![]() ![]() |
AFAIK there is a SETI version for Raspberry Pi 2 already. I used this but cancelled it because 1 WU would take over 80 hours to crunch. Therefor my Smartphone is more efficient and only takes 9 to 12 hours. But a friend told me he was using the same version on his Raspberry Pi but it's not working anymore. Maybe because of an upgrade or so. If you want to try it by your own - here is the link: http://www.element14.com/community/community/raspberry-pi/raspberrypi2/blog/2015/05/20/setihome-boinc-on-raspbian-for-raspberry-pi-2 ![]() ![]() |
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
From the research I've done so far, it looks like the fastest app for the Raspberry Pi is to have the best CFLAGS/CXXFLAGS and to compile FFTW directly instead of installing it with apt-get. On the Raspberry Pi v2, both FFTW and the SETI apps have optimized code for the NEON instruction set. FFTW compiles fine on both my v1 and v2 Pis. I struggle getting the SETI app to compile on either. I'm using the 3304 code as suggested by Claggy in a different post. I was able to get it to compile once, but now I can't. I keep getting a can't find the lboinc error part way through the compilation. I'm going to start with a clean install and see how it goes. |
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
AFAIK there is a SETI version for Raspberry Pi 2 already. There was a SETI version 7 app on beta which your friend must have been using. There isn't a version 8 one yet. I'm trying to build a version 8 app. I've been running a v8 app on one of my Raspberry Pi v2s for a few weeks. It has FFTW from apt-get and I don't think it is properly using the NEON code in the SETI app. It takes a few days per WU. My goal it to improve this some. |
ShootY ![]() Send message Joined: 15 Jan 11 Posts: 71 Credit: 21,700,959 RAC: 41 ![]() ![]() |
I don't know exactly but I think he and me were using the same app (see my link I posted). But I deinstalled it a few month ago. He was trying to install it but now it's not working anymore. ![]() ![]() |
![]() Send message Joined: 15 May 99 Posts: 1 Credit: 1,303,256 RAC: 0 ![]() |
Good luck ! I'm one of the other users who'd be very grateful :) |
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
I've had success in building seti_boinc for both the Raspberry Pi v1 (A, B, A+, B+, Zero) and the Raspberry Pi v2. The following are my build notes. Please let me if you have other ideas on configuration options or CFLAGS. Start with a fresh installation of Raspbian version: 2015-11-21-raspbian-jessie-lite on a SD card. sudo apt-get update sudo apt-get dist-upgrade Setup up build environment Raspberry Pi v1 (A, B, A+, B+, Zero) nano ~/.bashrc At the end of the file add: CC=gcc export CC CFLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -O3" export CFLAGS CXXFLAGS="$CFLAGS" export CXXFLAGS Raspberry Pi v2 nano ~/.bashrc At the end of the file add: CC=gcc export CC CFLAGS="-march=armv7-a —mfloat-abi=hard -mfpu=neon-vfpv4 -ffast-math -funsafe-math-optimizations -O3" export CFLAGS CXXFLAGS="$CFLAGS" export CXXFLAGS Logout and log back in to activate the updated .bashrc file. Get prerequisites sudo apt-get update sudo apt-get install git make m4 libtool autoconf pkg-config automake subversion libcurl4-openssl-dev libssl-dev gettext docbook2x docbook-xml libxml2-utils zlib1g-dev libsm-dev libice-dev libxmu-dev libxi-dev libx11-dev libnotify-dev freeglut3-dev libfcgi-dev libjpeg8-dev libxss-dev libxcb-util0-dev libxcb-dpms0-dev libxext-dev libstdc++6-4.7-dev Get and build the FFTW libraries wget http://www.fftw.org/fftw-3.3.4.tar.gz tar zxvf fftw-3.3.4.tar.gz cd fftw-3.3.4 Pi v1 ./configure --enable-float Pi v2 ./configure --enable-float --enable-neon make sudo make install cd ~ Get and build the Boinc libraries - Version 7.4.42 - Raspbian Jessie has Boinc version 7.4.23 available. git clone https://github.com/BOINC/boinc boinc cd boinc git checkout client_release/7.4/7.4.42; git status ./_autosetup ./configure --disable-server --disable-manager LDFLAGS=-static-libgcc --with-boinc-alt-platform=arm-unknown-linux-gnueabihf make cd ~ Now get the Seti_boinc source, and build the app: svn checkout https://setisvn.ssl.berkeley.edu/svn/seti_boinc@3304 seti_boinc (Currently revisions after 3304 don’t compile, so get 3304) cd seti_boinc ./_autosetup ./configure BOINCDIR=/home/pi/boinc --enable-client --enable-static --disable-shared --disable-server --enable-dependency-tracking --with-gnu-ld --disable-altivec --enable-fast-math make ls -l client On Pi v1: if setiathome-8.0.armv6l-unknown-linux-gnueabihf exists, compilation has been successful. On Pi v2: if setiathome-8.0.armv7l-unknown-linux-gnueabihf exists, compilation has been successful. Pi v1 App Setup: cp ~/seti_boinc/client/setiathome-8.0.armv6l-unknown-linux-gnueabihf ~/ cd ~ nano app_info.xml Copy and paste the following into the file: <app_info> <app> <name>setiathome_v8</name> <user_friendly_name>SETI@home v8</user_friendly_name> </app> <file_info> <name>setiathome-8.0.armv6l-unknown-linux-gnueabihf</name> <executable/> </file_info> <app_version> <app_name>setiathome_v8</app_name> <version_num>800</version_num> <file_ref> <file_name>setiathome-8.0.armv6l-unknown-linux-gnueabihf</file_name> <main_program/> </file_ref> </app_version> </app_info> To build a tar.gz to move to another computer: tar cvzf setiathome-8.0.armv6l-unknown-linux-gnueabihf.tar.gz setiathome-8.0.armv6l-unknown-linux-gnueabihf app_info.xml To install and run the app you just built on a Raspberry Pi, first install boinc-client: sudo apt-get install boinc-client Next attach to the Seti project: boinccmd --project_attach http://setiathome.berkeley.edu [YOUR KEY GOES HERE] Copy the app and the app_info.xml files to the project folder: sudo cp setiathome-8.0.armv6l-unknown-linux-gnueabihf /var/lib/boinc-client/projects/setiathome.berkeley.edu/ sudo cp app_info.xml /var/lib/boinc-client/projects/setiathome.berkeley.edu/ Change the file permissions to boinc:boinc: sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/setiathome-8.0.armv6l-unknown-linux-gnueabihf sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/app_info.xml Finally, restart boinc-client so it will use the new app: sudo /etc/init.d/boinc-client restart You can check the boinc-client log using: cat /var/lib/boinc-client/stdoutdae.txt And you can view the tasks with: boinccmd --get_tasks Pi v2 App Setup: cp ~/seti_boinc/client/setiathome-8.0.armv7l-unknown-linux-gnueabihf ~/ cd ~ nano app_info.xml Copy and paste the following into the file: <app_info> <app> <name>setiathome_v8</name> <user_friendly_name>SETI@home v8</user_friendly_name> </app> <file_info> <name>setiathome-8.0.armv7l-unknown-linux-gnueabihf</name> <executable/> </file_info> <app_version> <app_name>setiathome_v8</app_name> <version_num>800</version_num> <file_ref> <file_name>setiathome-8.0.armv7l-unknown-linux-gnueabihf</file_name> <main_program/> </file_ref> </app_version> </app_info> To build a tar.gz to move to another computer: tar cvzf setiathome-8.0.armv7l-unknown-linux-gnueabihf.tar.gz setiathome-8.0.armv7l-unknown-linux-gnueabihf app_info.xml To install and run the app you just built on a Raspberry Pi, first install boinc-client: sudo apt-get install boinc-client Next attach to the Seti project: boinccmd --project_attach http://setiathome.berkeley.edu [YOUR KEY GOES HERE] Copy the app and the app_info.xml files to the project folder: sudo cp setiathome-8.0.armv7l-unknown-linux-gnueabihf /var/lib/boinc-client/projects/setiathome.berkeley.edu/ sudo cp app_info.xml /var/lib/boinc-client/projects/setiathome.berkeley.edu/ Change the file permissions to boinc:boinc: sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/setiathome-8.0.armv7l-unknown-linux-gnueabihf sudo chown boinc:boinc /var/lib/boinc-client/projects/setiathome.berkeley.edu/app_info.xml Finally, restart boinc-client so it will use the new app: sudo /etc/init.d/boinc-client restart You can check the boinc-client log using: cat /var/lib/boinc-client/stdoutdae.txt And you can view the tasks with: boinccmd --get_tasks |
Juha Send message Joined: 7 Mar 04 Posts: 388 Credit: 1,857,738 RAC: 0 ![]() |
Get and build the Boinc libraries - Version 7.4.42 - Raspbian Jessie has Boinc version 7.4.23 available. When building science apps you usually should use master branch. API code in client_release branch is not updated once the branch is created. 7.3/7.4 was branched a long time ago. As for compiler flags, I usually use -march=native when building for myself. At least on x86 GCC replaces that with more flags than just the CPU type. |
BitShock Send message Joined: 9 Feb 04 Posts: 7 Credit: 1,435,254 RAC: 16 ![]() ![]() |
[quote].... I've been running a v8 app on one of my Raspberry Pi v2s for a few weeks. It has FFTW from apt-get and I don't think it is properly using the NEON code in the SETI app. It takes a few days per WU. My goal it to improve this some. What was the initial v8 app you had been using for the rasp? Which one could you compile without any error? Was it the native version provided for UNIX system by BOINC? BTW: Crunching a WU in 80 hours on the raspberry is fine... On my old raspberry B+ v1 sometimes it took about 2 weeks ;) |
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
Thanks for the advice some of you have given. Simple seems to provide the best results. The debian-based version of libfftw3-dev has run-time detection of NEON, so you don't need to compile FFTW. Looking through the configuration files and makefiles for seti, it looks like seti adds the appropriate CFLAGS for ARM processors. I've found the following build instructions create the fastest and most stable seti client: Start with a fresh installation of Raspbian version: 2015-11-21-raspbian-jessie-lite on a SD card. sudo apt-get update sudo apt-get dist-upgrade Get prerequisites sudo apt-get update sudo apt-get install git make m4 libtool autoconf pkg-config automake subversion libcurl4-openssl-dev libssl-dev gettext docbook2x docbook-xml sudo apt-get install libxml2-utils zlib1g-dev libsm-dev libice-dev libxmu-dev libxi-dev libx11-dev libnotify-dev freeglut3-dev libfcgi-dev sudo apt-get install libjpeg8-dev libxss-dev libxcb-util0-dev libxcb-dpms0-dev libxext-dev libstdc++6-4.7-dev libfftw3-dev Get and build the Boinc libraries - Current Version git clone https://github.com/BOINC/boinc boinc cd boinc ./_autosetup ./configure --disable-server --disable-manager LDFLAGS=-static-libgcc --with-boinc-platform=arm-unknown-linux-gnueabihf make (“make -j 4†on the Pi2 to make with all 4 cores) cd ~ Now get the Seti_boinc source, and build the app: svn checkout https://setisvn.ssl.berkeley.edu/svn/seti_boinc@3304 seti_boinc (Currently revisions after 3304 don’t compile, so get 3304) cd seti_boinc ./_autosetup ./configure CFLAGS="-O3" CXXFLAGS="-O3" BOINCDIR=/home/pi/boinc --enable-client --enable-static --disable-shared --disable-server --enable-fast-math make (“make -j 4†on the Pi2 to make with all 4 cores) ls -l client On Pi v1: if setiathome-8.0.armv6l-unknown-linux-gnueabihf exists, compilation has been successful. On Pi v2: if setiathome-8.0.armv7l-unknown-linux-gnueabihf exists, compilation has been successful. |
Sidewinder ![]() ![]() ![]() ![]() Send message Joined: 15 Nov 09 Posts: 100 Credit: 79,432,465 RAC: 0 ![]() |
Thanks for the detailed steps Tom. I just configured my Pi 2 and it's working great. One issue that came up for me was that compilation failed while running make for the seti_boinc steps: readwu.cpp:47:20: fatal error: export.h: No such file or directory #include "export.h" ^ compilation terminated. Fortunately, another user had the same issue (https://setiathome.berkeley.edu/forum_thread.php?id=78593&postid=1747556#1747556) and after applying his two workarounds the compilation succeeded. Just a heads up in case anyone else encounters this issue. ![]() |
Tom Rinehart Send message Joined: 12 Dec 01 Posts: 113 Credit: 13,255,975 RAC: 6 ![]() |
Thanks for the detailed steps Tom. I just configured my Pi 2 and it's working great. I also get the same error, but the app is already built by then. BTW - Apps for both the Pi1 and Pi2 are now being tested on Beta. These should also work with other Linux armhf computers. We need more testers so please join Beta with your Linux armhf computer: http://setiweb.ssl.berkeley.edu/beta/. |
![]() ![]() Send message Joined: 15 Sep 01 Posts: 26 Credit: 6,149,499 RAC: 6 ![]() |
Joined up with a Pi2/Raspian. Hope that helps! Would be great if support was semi-official so it's easier to keep up to date. I know you can only chase so many platforms, though. Live long and crunch! |
![]() ![]() Send message Joined: 25 Jan 04 Posts: 11 Credit: 1,197,409 RAC: 0 ![]() |
Did the long version with "make -j4". It's now running with 4 cores. Thanks for your post ! ![]() |
DJStarfox Send message Joined: 23 May 01 Posts: 1066 Credit: 1,226,053 RAC: 2 ![]() |
I read somewhere, long ago, that SETI cannot run when compiled with "-ffast-math" so this option should be removed for accuracy of the calculations. This may still apply. |
![]() ![]() Send message Joined: 16 Jun 01 Posts: 6325 Credit: 106,370,077 RAC: 121 ![]() ![]() |
I read somewhere, long ago, that SETI cannot run when compiled with "-ffast-math" so this option should be removed for accuracy of the calculations. This may still apply. All opt Windows CPU builds and all Windows OpenCL GPU builds are done with fast math enabled. |
Bowie Xu Send message Joined: 25 Mar 16 Posts: 6 Credit: 7,172,031 RAC: 0 ![]() |
Hi guys. Sorry about my dumb question. I am newbie of SETI, just got my pi2 and followed this thread to get setiathome-8.0.armv7l-unknown-linux-gnueab. But how to install this new project into BOINC Manager so I can get work started? This there any post I can check? Thanks! |
Bowie Xu Send message Joined: 25 Mar 16 Posts: 6 Credit: 7,172,031 RAC: 0 ![]() |
Ok, I followed the link: http://boinc.berkeley.edu/trac/wiki/CoreClient and got my client running but BOINC Manager gives me a Notices says: "This project doesn't support computers of type arm-unknown-linux-gnueabihf" |
Bowie Xu Send message Joined: 25 Mar 16 Posts: 6 Credit: 7,172,031 RAC: 0 ![]() |
Me again.... I managed get it working. Following this link: https://github.com/dcarrion87/boinc-rpi/raw/master/bin/setiathomev7-armv6l.tar.gz I download v7 package and extract it to boinc_client folder and copy new v8 executable into that folder and modify app_info.xml, adding all v8 section and it worked! Because I used "make -j 4" for pi2, it seems BOINC Manager gives me a 4 tasks at a time. And each tasks costs about 116 hours (almost 5 days) to complete. Is that normal for a pi device? |
©2025 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.