Building pocl on OSX is, unfortunately, more complex than it should be.
Some of these steps are necessary because of llvm, others because OSX
doesn't use ELF. Below are my notes for building pocl on OSX.

There are still some things that don't work, e.g. pocl doesn't generate AVX
instructions.



# prerequisite: install MacPorts, install gcc47, make gcc-mp-4.7 the
default compiler

svn checkout http://llvm.org/svn/llvm-project/llvm/branches/release_31 llvm
pushd llvm/tools
svn checkout http://llvm.org/svn/llvm-project/cfe/branches/release_31 clang
popd ../..

mkdir llvm-build
pushd llvm-build
# Apple's clang doesn't build llvm-3.1, so I'm using gcc
../llvm/configure --prefix=${HOME}/llvm --enable-shared --enable-optimized
CC=gcc CXX=g++
make REQUIRES_RTTI=1 -j8
make install -j8
popd

# download and build hwloc, install into ${HOME}/hwloc-1.5

# I'm using a branch of pocl
bzr clone bzr+ssh://bazaar.launchpad.net/+branch/pocl
bzr branch pocl pocl-erik

pushd pocl-erik
# some of these settings are not only necessary for building pocl, but also
when running with pocl
export PATH="/Users/eschnett/llvm/bin:${PATH}"
export PKG_CONFIG_PATH="${HOME}/hwloc-1.5/lib/pkgconfig"
export LD_LIBRARY_PATH="${HOME}/llvm/lib:${LD_LIBRARY_PATH}"
# the llvm libraries expect that executables using them are installed in a
certain directory (!). override this.
export DYLD_FALLBACK_LIBRARY_PATH="${HOME}/llvm/lib"
export THREAD_COUNT_ENV=4
./autogen.sh
# ICD doesn't work on OSX; symbol aliases are not supported by the linker
env CPPFLAGS="-I${HOME}/hwloc-1.5/include -I/opt/local/include"
LDFLAGS="-L${HOME}/hwloc-1.5/lib -L/opt/local/lib" ./configure
--prefix=${HOME}/pocl-erik --disable-icd
make -j8
make install -j8
popd



-erik

-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/
AIM: eschnett247, Skype: eschnett, Google Talk: [email protected]
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to