You are not logged in.

#1 2006-11-22 20:08:27

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 671
Website

[PKGBUILD] foldingathome for SMP x86_64 clients

I dunno wether such a post should go in Arch64 & Other Architectures or User Contributions? Because there's no specifically x86_64 topic on the 2nd, i guessed it should go in the 1st. Please correct me if I'm wrong.

Here comes a running PKGBUILD Folding@home SMP for dual/quad (or more) x86_64 cores
I just adapted Jason Taylor & seratne foldingathome's PKGBUILD as well as files that come with it.
Comments & corrections are welcome.

Please note this is a BETA release that is supposed to run only on SMP x86_64 CPUs.
On those machines it will allow greater improvments for the Folding@Home's project.
Please read the SMP FAQ carefully before running it.
Because it can run on x86_64 single  core does not necessarily means it'd be usefull then. See this thread I opened on Folding-community.org's forum - SMP for Linux-64

PKGBUILD

# Contributor: Jason Taylor <jftaylor21_AT_gmail>
# Contributor: seratne
# Contributor: kozaki <kozaki_AT_guides>
pkgname=foldingathome-smp
pkgver=505
pkgrel=1
pkgdesc="Folding@Home SMP x86_64 Beta: a distributed computing project which
studies protein folding, misfolding, aggregation, and related diseases."
url="http://folding.stanford.edu/"
depends=('bash' 'lib32-glibc')
backup=('etc/conf.d/foldingathome-smp')
install=foldingathome-smp.install
source=(http://www.stanford.edu/%7Ekasson/folding/FAH_SMP_Linux.tgz foldingat
home-smp.rc.d foldingathome-smp.conf.d)
md5sums=('5fcc34e5158bb8551ed8fe2b1299a9d0' '6ea4b9b9cd3a0391375d299e7098602b
'
         'eb6b2b3b95920fd1a605a9574667d111')

build() {
  cd $startdir/src/
  mkdir -p $startdir/pkg/opt/fah-smp
  mkdir -p $startdir/pkg/etc/{rc.d,conf.d}
  install -c -m 0755 fah5 $startdir/pkg/opt/fah-smp/fah5
  install -c -m 0755 $startdir/foldingathome-smp.rc.d $startdir/pkg/etc/rc.d/
foldingathome-smp
  install -c -m 0644 $startdir/foldingathome-smp.conf.d $startdir/pkg/etc/con
f.d/foldingathome-smp
}

foldingathome-smp.rc.d

#!/bin/bash
#/etc/rc.d/foldingathome-smp
#
# Starts the Folding@Home-SMP client in the background

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/foldingathome-smp

PID=`pidof -o %PPID /opt/fah-smp/fah5`
case "$1" in
    start)
    stat_busy "Starting Folding@Home-SMP"
    if [ -z "$PID" ]; then
        if [ ! -z "$FAH_USER" ] ; then
            if [ ! -d "/opt/fah-smp/$FAH_USER" ] ; then
                mkdir /opt/fah-smp/$FAH_USER
                chown $FAH_USER /opt/fah-smp/$FAH_USER
                if [ ! -z "$FAH_GRP" ] ; then
                    chgrp $FAH_GRP /opt/fah-smp/$FAH_USER
                else
                    chgrp users /opt/fah-smp/$FAH_USER
                fi
            fi
            cd /opt/fah-smp/$FAH_USER
            su $FAH_USER -c "/opt/fah-smp/fah5 -verbosity 9 > /opt/fah-smp/$FAH_USER/myfah.log" &
        else
            cd /opt/fah-smp
            /opt/fah-smp/fah5 -verbosity 9 > /opt/fah-smp/myfah.log &
        fi
    fi
    if [ ! -z "$PID" -o $? -gt 0 ]; then
        stat_fail
    else
        add_daemon foldingathome-smp
        stat_done
    fi
    ;;
    
    stop)
    stat_busy "Stopping Folding@Home-SMP"
    [ ! -z "$PID" ]&& kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
        stat_fail
    else
        rm_daemon foldingathome-smp
        stat_done
    fi
    ;;
    
    restart)
    $0 stop
    sleep 1
    $0 start
    ;;
    
    *)
    echo $"Usage: $0 {start|stop|restart}"
esac

foldingathome-smp.conf.d

#
# Optional user settings for foldingathome-smp daemon
#
# If you prefer not to run fah as root then you can identifer a current or
# specially created user here.

FAH_USER=""

# If you wish to associate this user with a specific group you can enter the
# group name here.  If left blank the default is "users".

FAH_GRP=""

foldingathome-smp.install

# arg 1:  the new package version
post_install() {
  cat << 'EOM'
  --> Please cd to /opt/fah-smp/ and execute ./fah5 -configonly 
  --> to configure your settings. Then add "foldingathome" to the list
  --> of daemons in /etc/rc.conf. If you would like to join the Arch 
  --> Linux team, use team number 45032. To check current progress,
  --> point your browser to file://opt/fah-smp/MyFolding.html

  --> If you prefer not to run foldingathome as root you can identify a
  --> user in /etc/conf.d/foldingathome
  --> A directory called /opt/fah-smp/$FAH_USER will be created."
EOM
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  post_install $1
}

# arg 1:  the old package version
pre_remove() {
  /bin/true
}

op=$1
shift

$op $* 

Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9

Offline

Board footer

Powered by FluxBB