Saturday, September 15, 2012

Phaser MPI on OS X: Fink package phaser-mpi

I am trying to get phaser to use all my processors


I've created a fink package called phaser-mpi that does the following automatically:

1. Phaser uses c++ by default (clang++ on OS X).  If you compile phaser using an untouched ccp4-phaser-N.tgz package distributed by CCP4, this works.  If you compile cctbx first, it will fail to compile with clang++.  So you either need to compile both with g++, which you can do by issuing the

--compiler=gcc

directive.  (No other such directive will work, fwiw.)  This is why I had such troubles building phaser for 10.8.1.

2.  Phaser can be tricked into linking the openmpi library by doing the following:

(a)  Install Fink's gcc47 compiler package.

(b)  Unpack CCP4's cctbx/phaser source code.

(c) cd into the ccp4-6.3.0 directory, and issue the following (one-line) command:


perl -pi.orig -e \
"s|cxx \= cc.replace\('gcc', 'g\+\+'\)|cxx \= cc.replace\('gcc', 'sw/bin/g\+\+-4'\)|g" \
lib/cctbx/cctbx_sources/cctbx_project/libtbx/SConscript  


(d) Issue the following commands within the phaser src directory:

export CXXFLAGS="-L/sw/lib"
export CFLAGS="-I/sw/include"
export CPPFLAGS="$CFLAGS"

mv bin bin.orig

/usr/bin/python \
../../lib/cctbx/cctbx_sources/cctbx_project/libtbx/configure.py \
--repository=source phaser \ 
--build-boost-python-extensions=False \ 
--enable-openmp-if-possible=True \ 
--static-exe \ 
--use-environment-flags \ 
--compiler=gcc  

source setpaths.sh  

libtbx.scons -j 8 .  

(e) Restore the original /usr/bin/g++ and /usr/bin/gcc.

(I have 8 processors.  This speeds up the build, but has nothing to do with the outcome.)

(3) Run it using the following KeyWord (in this case for 8 processors):

   JOBS  8  

Thanks to Kaspar Hollenstein for help, advice and encouragement.



4 comments:

Ka Ching! said...

Hi,

I installed ccp4 using your precompiled binaries. I saw in that wiki a line about using all the processors which brought me here. I am not to sure I understand the process in which to execute these commands. any tips?

Unknown said...

What’s up everyone, it’s my first pay a visit at this web page, and paragraph is actually fruitful for me,
keep up posting such articles or reviews.

BORNEOPOKER.COM BANDAR POKER ONLINE SERTA BANDAR Q ONLINE TERPERCAYA DI INDONESIA

Unknown said...

Autonomous Boat

saad said...

Its a good oppertunity to invest in smart city lahore in pakistan.