build.sh 3.8 KB
Newer Older
incardon's avatar
incardon committed
1
2
3
4
#! /bin/bash

# Make a directory in /tmp/OpenFPM_pdata

incardon's avatar
incardon committed
5
6
7
8
9
10
workspace=$1
hostname=$(hostname)
target=$3
comp_type=$4
branch=$5

incardon's avatar
incardon committed
11
if [ x"$branch" == x"" ]; then
incardon's avatar
Retry    
incardon committed
12
  echo "Getting branch from git"
incardon's avatar
incardon committed
13
14
15
  branch=$(git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3)
fi

incardon's avatar
incardon committed
16
echo "Directory: $workspace"
incardon's avatar
incardon committed
17
echo "Machine: $hostname"
incardon's avatar
incardon committed
18
19
20
echo "make target: $target"
echo "compilation type: $comp_type"
echo "Branch name: $branch"
incardon's avatar
incardon committed
21

incardon's avatar
incardon committed
22

23
24
if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de"  ]; then 
	./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_pdata/$branch/ 4
incardon's avatar
incardon committed
25
	echo 4 > $HOME/openfpm_dependencies/openfpm_pdata/$branch/MPI/version
26
fi
incardon's avatar
incardon committed
27

incardon's avatar
incardon committed
28
if [ x"$hostname" == x"cifarm-ubuntu-node.mpi-cbg.de"  ]; then
incardon's avatar
Re-run    
incardon committed
29
30
#	rm -rf $HOME/openfpm_dependencies/openfpm_pdata/$branch/
	echo "Continue"
incardon's avatar
incardon committed
31
32
fi

incardon's avatar
incardon committed
33
if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de"  ]; then
incardon's avatar
incardon committed
34
	export PATH="/usr/local/bin:$PATH"
incardon's avatar
Re-run    
incardon committed
35
36
#	rm -rf $HOME/openfpm_dependencies/openfpm_pdata/$branch/
	echo "Continue"
incardon's avatar
incardon committed
37
38
fi

incardon's avatar
incardon committed
39
40
41
42
43
44
45
46
47
if [ x"$hostname" == x"falcon1"  ]; then
#       rm -rf $HOME/openfpm_dependencies/openfpm_pdata/$branch/
        echo "Continue"
	dependency_dir=/projects/ppm/rundeck/openfpm_dependencies/
else
	dependency_dir=$HOME/openfpm_dependencies/openfpm_pdata/$branch
fi


incardon's avatar
Latest    
incardon committed
48
49
50
51
#### If you have a dep_dir file change the branch name to the dep_dir

dep_dir=$(cat dep_dir)
if [ x"$dep_dir" != x"" ]; then
incardon's avatar
incardon committed
52
  branch=$dep_dir
incardon's avatar
Latest    
incardon committed
53
54
fi

incardon's avatar
incardon committed
55
56
57
mkdir src/config
mkdir openfpm_numerics/src/config

58
echo "Compiling general"
incardon's avatar
incardon committed
59

60
source ~/.bashrc
incardon's avatar
incardon committed
61
 
incardon's avatar
incardon committed
62
installation_dir="--prefix=$HOME/openfpm_install/$branch"
incardon's avatar
incardon committed
63

64
# force ssh to not use HostKey verification
incardon's avatar
incardon committed
65
66
#echo "StrictHostKeyChecking=no" > $HOME/.ssh/config
#chmod 600 $HOME/.ssh/config
incardon's avatar
incardon committed
67

68
69
mkdir $HOME/openfpm_dependencies/openfpm_pdata/$branch
if [ x"$comp_type" == x"full" ]; then
incardon's avatar
incardon committed
70
71
  echo "Installing with: ./install -i $dependency_dir -s -c \"$installation_dir\"  "
  ./install -i $dependency_dir  -s -c "$installation_dir"
72
  make install
incardon's avatar
incardon committed
73
  if [ $? -ne 0 ]; then
incardon's avatar
incardon committed
74
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
75
76
    exit 1 ;
  fi
incardon's avatar
incardon committed
77
78
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$branch
  source $HOME/openfpm_vars_$branch
79
elif [ x"$comp_type" == x"numerics" ]; then
incardon's avatar
incardon committed
80
  ./install -i $dependency_dir  -m -s -c "$installation_dir"
incardon's avatar
incardon committed
81

incardon's avatar
incardon committed
82
  if [ $? -ne 0 ]; then
incardon's avatar
incardon committed
83
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
84
85
    exit 1 ;
  fi
incardon's avatar
incardon committed
86
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$branch
incardon's avatar
incardon committed
87
  source $HOME/openfpm_vars_$branch
incardon's avatar
incardon committed
88
  make VERBOSE=1  -j 8
89
else
incardon's avatar
incardon committed
90
91
  echo "Installing with: ./install -i $dependency_dir -m -s -c \"$installation_dir --no-recursion\""
  ./install -i $dependency_dir -m -s -c "$installation_dir"
incardon's avatar
incardon committed
92

incardon's avatar
incardon committed
93
  if [ $? -ne 0 ]; then
incardon's avatar
incardon committed
94
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
95
96
    exit 1 ;
  fi
incardon's avatar
incardon committed
97
98
  mv $HOME/openfpm_vars $HOME/openfpm_vars_$branch
  source $HOME/openfpm_vars_$branch
incardon's avatar
incardon committed
99
100

  make VERBOSE=1 -j 8
101
fi
incardon's avatar
incardon committed
102

103
if [ $? -ne 0 ]; then
incardon's avatar
incardon committed
104
   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$hostname failed to complete the openfpm_pdata test \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
105
106
107
   exit 1 ;
fi