forked from neuronsimulator/nrn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkalpha.sh
149 lines (136 loc) · 3.4 KB
/
mkalpha.sh
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#/bin/sh
# from svn update to alpha on ftp site for linux, mswin, and mac osx
# usage:sh mkalpha.sh
# sh mkalpha.sh force
# with force, will continue even if an ftp distribution file matches the
# svn updated version number
# must execute in the top level source directory
NSRC=`pwd`
export NSRC
cd $NSRC
lastalpha="`sh nrnversion.sh 2`"
hg pull
hg update
if test $? != 0 ; then
exit 1
fi
srcdir=$NSRC/src/nrnoc
sh $NSRC/git2nrnversion_h.sh > $srcdir/nrnversion.h.tmp
cmp $srcdir/nrnversion.h $srcdir/nrnversion.h.tmp || cp $srcdir/nrnversion.h.tmp $srcdir/nrnversion.h
rm $srcdir/nrnversion.h.tmp
if test ! -f config.guess ; then
sh build.sh
fi
ostype="`sh config.guess | sed 's/^\([^-]*\)-\([^-]*\)-\([A-Za-z]*\).*/\3/'`"
ver="`sh nrnversion.sh 2`"
a=1
old="`ssh [email protected] 'cd /home/htdocs/ftp/neuron/versions/alpha; ls *'$ver'*'`"
case "$ostype" in
cygwin) echo "$old" |grep 'setup' ; a=$? ;;
linux) host="`./config.guess`"
echo "$old" |grep "$host" ; a=$? ;;
darwin) host="`./config.guess`"
echo "$old" |grep "$host" ; a=$? ;;
esac
if test "$a" = "0" ; then
echo "up to date"
if test "$1" != "force" ; then
exit 0
fi
fi
currentalpha="`sh nrnversion.sh 2`"
base="`sh nrnversion.sh global`"
type="`sh nrnversion.sh type`"
echo "$old"
echo "$ostype old="$lastalpha" new=$currentalpha"
./build.sh
NVER="`sh nrnversion.sh`"
#mswin
if test "$ostype" = "cygwin" ; then
NOBJ=$HOME/neuron/nrn${type}setup
if test ! -d $NOBJ ; then
mkdir $NOBJ
fi
cd $NOBJ
$NSRC/configure --prefix=`pwd` --with-nrnpython --with-paranrn \
--with-readline=yes
make
if test $? != 0 ; then
echo "make failed"
exit 1
fi
newver=`src/nrniv/nrniv --version | sed 's/[^(]*.*:\(.*\)).*/\1/'`
if "$newver" != "$base" ; then
exit 1
fi
make mswin
make alphadist
fi
#linux
if test "$ostype" = "linux" ; then
NOBJ=$HOME/neuron/nrn${type}rpm
if test ! -d $NOBJ ; then
mkdir $NOBJ
fi
cd $NOBJ
which javac ; a=$?
jarg=""
a=1
if test "$a" = 0 ; then
jarg='--with-nrnjava'
fi
$NSRC/configure --prefix=/usr/local/nrn --with-iv=/usr/local/iv \
--srcdir=$NSRC --enable-rpm-rules --disable-static \
--with-readline=yes --with-nrnpython=dynamic --with-paranrn=dynamic $jarg
make
if test $? != 0 ; then
echo "make failed"
exit 1
fi
newver=`src/nrniv/nrniv --version | sed 's/[^(]*.*:\(.*\)).*/\1/'`
if "$newver" != "$base" ; then
exit 1
fi
#if test "$a" = 0 ; then
make dist
make alphadist
#fi
sudo $HOME/bin/make_install_rpm # make install; make rpm
make rpmdist
fi
#mac os x
if test "$ostype" = "darwin" ; then
#NOBJ=$HOME/neuron/nrn${type}carbon
NOBJ=$HOME/neuron/nrn${type}x11
IDIR=/Applications/NEURON-$NVER
if test ! -d $NOBJ ; then
mkdir $NOBJ
fi
cd $NOBJ
#$NSRC/configure --prefix=$IDIR/nrn --srcdir=$NSRC \
# --with-iv=$IDIR/iv --enable-carbon --with-nrnpython \
# PYLIB=-lpython PYLIBLINK=-lpython --enable-UniversalMacBinary
#$NSRC/configure --prefix=$IDIR/nrn --srcdir=$NSRC \
# --with-iv=$IDIR/iv --enable-carbon --with-nrnpython=dynamic \
# 'CFLAGS=-arch i386 -g -O2' 'CXXFLAGS=-arch i386 -g -O2'
$NSRC/configure --prefix=$IDIR/nrn \
--with-iv=$IDIR/iv --with-paranrn=dynamic --with-nrnpython=dynamic
make clean
make
if test $? != 0 ; then
echo "make failed"
exit 1
fi
make install
make after_install
host_cpu="`echo $host | sed 's/-.*//'`"
if test -d "$IDIR/nrn/umac" ; then
host_cpu=umac
fi
newver=`${IDIR}/nrn/${host_cpu}/bin/nrniv --version | sed 's/[^(]*.*:\(.*\)).*/\1/'`
if test "$newver" != "$base" ; then
exit 1
fi
make pkg
make alphadist
fi