forked from neuronsimulator/nrn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bldnrnmacpkg.sh
95 lines (81 loc) · 2.44 KB
/
bldnrnmacpkg.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
#!/bin/bash
set -ex
# distribution built with
#sh bldnrnmacpkg.sh python3.7 python3.6 python2.7
#10.7 possible if one builds with pythons that are consisent with that.
export MACOSX_DEPLOYMENT_TARGET=10.9
INST=/Applications/NEURON-7.7
export PATH=$INST/nrn/x86_64/bin:$PATH
if false ; then
cd $HOME/neuron/iv
make clean
rm -r -f $INST
./configure --prefix=$INST/iv
make
make install
fi
rm -r -f $INST/nrn
cd $HOME/neuron/nrnobj
rm -r -f $HOME/neuron/nrnobj/*
PYVS="py"
bld () {
PYVER=`$1 -c 'from sys import version_info as v ; print (str(v.major) + str(v.minor)); quit()'`
PYVS=${PYVS}-${PYVER}
rm -r -f src/nrnpython/build
../nrn/configure --prefix=$INST/nrn --with-paranrn=dynamic \
--with-nrnpython=dynamic --with-pyexe=$1 --with-readline=no #$2
make -j 2 install
}
chk () {
# Can launch python and import neuron
# only needs PYTHONPATH
(
export PYTHONPATH=$INST/nrn/lib/python
$1 -c 'from neuron import test; test()'
$1 -c 'from neuron.tests import test_rxd; test_rxd.test(); quit()'
)
# Can launch nrniv -python and import neuron
# needs NRN_PYLIB and perhaps PYTHONHOME
(
export PATH=$INST/nrn/x86_64/bin:$PATH
eval "`nrnpyenv.sh $1`"
nrniv -python -c "from neuron import test; test() ; quit()"
)
# Launching nrniv no longer needs NRN_PYLIB and PYTHONHOME
(
$INST/nrn/x86_64/bin/nrniv -python -pyexe $1 -c "import neuron ; neuron.test() ; quit()"
$INST/nrn/x86_64/bin/nrniv -python -pyexe $1 -c 'from neuron.tests import test_rxd; test_rxd.test(); quit()'
)
}
# no args, use standard python
if test "$1" = "" ; then
first=python
else
first=$1
shift
fi
bld $first ""
chk $first
for i in $* ; do
bld $i "--with-nrnpython-only"
chk $i
done
#chk $HOME/anaconda3/bin/python3.6
#chk $HOME/anaconda2/bin/python2.7
make after_install
#/Applications/Packages.app from
# http://s.sudre.free.fr/Software/Packages/about.html
# For mac to do a productsign, need my developerID_installer.cer
# and Neurondev.p12 file. To add to the keychain, double click each
# of those files. By default, I added my cerificate to the login keychain.
make pkg
#make alphadist
#following requires cwd to be the build directory because of NSRC
ALPHADIR='[email protected]:/home/htdocs/ftp/neuron/versions/alpha'
export NSRC=../nrn
describe="`sh $NSRC/nrnversion.sh describe`"
NVER="`sh $NSRC/nrnversion.sh 3`"
a=${ALPHADIR}/nrn-${describe}.x86_64-osx-${PYVS}.pkg
b=./src/mac/build/NEURON-${NVER}.pkg
echo "scp $b $a"
scp $b $a