-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-mac.sh
More file actions
executable file
·82 lines (66 loc) · 3.25 KB
/
build-mac.sh
File metadata and controls
executable file
·82 lines (66 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
###### This file keeps the script to build Linux version of CilkPlus Clang based compiler
###### By default we assume you're using 'llvm' folder created in the current directory as a base folder of your source installation
###### If you use some specific location then pass it as argument to this script
if [ "$1" = "" ]
then
LLVM_HOME=`pwd`/llvm-release
else
LLVM_HOME=$1
fi
echo Building clang in $LLVM_HOME...
CLANG_HOME=`xcrun -find clang`
CLANG_HOME=`dirname $CLANG_HOME`
echo CLANG_BIN_HOME=$CLANG_HOME
###### Uncommet the following 4 lines if you'd like to build the project from scratch
###### If you already have the sources leave the following lines w/o changes
rm -rf $LLVM_HOME
git clone -b cilkplus https://github.com/cilkplus/llvm $LLVM_HOME
git clone -b cilkplus https://github.com/cilkplus/clang $LLVM_HOME/tools/clang
git clone -b cilkplus https://github.com/cilkplus/compiler-rt $LLVM_HOME/projects/compiler-rt
BUILD_HOME=$LLVM_HOME/build
mkdir -p $BUILD_HOME
cd $BUILD_HOME
###### If you need to tune your environment - do it
#export PATH=/usr/local/bin:/usr/bin:$PATH
#export DYLD_LIBRARY_PATH=/usr/local/lib64:$DYLD_LIBRARY_PATH
###### We're going to create the most agressive release version of the compiler
../configure --enable-optimized --enable-assertions=NO --with-c-include-dirs=$CLANG_HOME/../lib/c++/v1:$CLANG_HOME/../include:/usr/include
###### By default you should simply lanch
#../configure
###### Now you're able to build the compiler
make -j8 >build.log
###### The following lines will prepare your system to build CilkPlus runtime
###### If you don't want to do it - simply finish the script here
###### (remove or comment all the rest lines of the script)
###### We're suggesting to use your own Clang version to build the runtime
###### that's why we're exporting the following 3 variables
#export PATH=$BUILD_HOME/Debug+Asserts/bin:$PATH
export PATH=$BUILD_HOME/Release/bin:$PATH
export CC=clang
export CXX=clang++
#export CXXFLAGS="-I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1"
#export CFLAGS="-I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1"
###### That's the standard place in the llvm structure to deal with cilk runtime library
CILK_RT_HOME=$LLVM_HOME/projects/compiler-rt/lib/cilk
###### We're getting the latest sources from Cilk runtime site
###### that's why we suggest to remove all the stuff from our own code snapshot in the source tree
rm -rf $CILK_RT_HOME
git clone https://bitbucket.org/intelcilkruntime/intel-cilk-runtime.git $CILK_RT_HOME
cd $CILK_RT_HOME
###### You could find the instruction on how to build cilk runtime in $CILK_RT_HOME/README
glibtoolize
aclocal
automake --add-missing
autoconf
###### By default we'll install libraries and include files in $BUILD_HOME
###### If you don't like it - remove --prefix or use your prefered location
./configure --prefix=$BUILD_HOME
make
make install
###### That's it!
###### But don't forget to extend DYLD_LIBRARY_PATH and INCLUDE search path with selected --prefix/lib|include
###### (if you used the one). For example:
###### export DYLD_LIBRARY_PATH=$BUILD_HOME/lib:$DYLD_LIBRARY_PATH
###### export CFLAGS=$BUILD_HOME/include:$CFLAGS
###### export CXXFLAGS=$BUILD_HOME/include:$CXXFLAGS