root/trunk/howtomake

Revision 3, 6.8 kB (checked in by davison, 2 years ago)

standard svn dir structure

  • Property svn:executable set to
Line 
1 * howtomake text
2 This explains how to construct a development version of NEURON using
3 anonymous cvs.
4
5 1) create a neuron directory which will hold the entire development
6    tree and cd to it. On my machine it is $HOME/neuron
7
8 2) you will always need this to do the original checkout and get the updates
9    export CVS_RSH=ssh (for bash)
10    setenv CVS_RSH ssh (for tcsh)
11    (best put in .bashrc or .tcshrc since you may forget this later)
12         If this is missing, then cvs commands will seem to hang for
13         a minute or so and then fail with the message:
14                 miris.med.yale.edu: Connection refused
15
16
17 3)
18 Checkout and build the InterViews release branch (this is only done once)
19  
20    If you have a current version 15 of InterViews you can use it and skip
21 this step (until and  unless interviews starts getting revised again).
22
23 cvs -d :ext:anonymous@www.neuron.yale.edu:/home/cvsroot checkout \
24  -r iv-rel15 -d iv iv
25 when the password is requested type "neuron" without the double quotes.
26         If the cvs command hangs for a minute and then fails with the
27         message:
28                 miris.med.yale.edu: Connection refused
29         then your CVS_RSH environment variable is not ssh.
30         The first time cvs connects to www.neuron.yale.edu your machine
31         may respond with the message:
32 The authenticity of host 'www.neuron.yale.edu (130.132.220.62)' can't be established.
33 RSA key fingerprint is 5d:85:7c:b0:e2:4e:4f:13:d8:f0:b8:15:70:7d:db:2a.
34 Are you sure you want to continue connecting (yes/no)?
35         type "yes" without the quotes and it will continue to the point
36         where it asks for the password. (Then type "neuron" without the quotes.)
37
38 I build InterViews as follows (assuming that $IV is set to the source
39 code location)
40     cd $IV
41     sh build.sh
42     make
43     make install
44 Note that the above will install in $IV/i686 if you are on a linux machine.
45 If the build.sh command fails, you may need more recent versions of
46 autoconf and automake. Mine are
47 [hines@NeuronDev nrn-5.4]$ automake --version
48 automake (GNU automake) 1.6.3
49 [hines@NeuronDev nrn-5.4]$ autoconf --version
50 autoconf (GNU Autoconf) 2.53
51 Any newer versions will also work. See more info below.
52
53 4) Check out the neuron development branch
54 cvs -d :ext:anonymous@www.neuron.yale.edu:/home/cvsroot checkout -r nrn-dev5_4 -d nrn nrn
55 when the password is requested type "neuron" without the double quotes.
56  
57
58     You may wish to rename this directory for clarity.
59
60 You must construct some distribution files using the four commands:
61 aclocal
62 autoheader
63 automake
64 autoconf
65
66 (There are some potential pitfalls in the installation of these programs
67   I recommend building
68 from source obtained from www.gnu.org.  This will place things in /usr/local
69   Then make sure that
70 the programs being run are in /usr/local/bin and not in /usr/bin.)
71
72 5) It is useful to keep the source and build directories separate.  In
73 this way one can readily
74 build neuron with different flags for the
75 purposes of profiling, code coverage, static vs shared libraries, etc. without
76 doing a "make clean" and losing all the compiled objects.
77 Additionally, a separate build library allows you to build
78 for different architectures with the same source tree.
79 In short, it is best not to build anything in the source tree.
80
81 6) Let's assume that InterViews is installed in $IV and that neuron
82 source is located in $NRNS
83 These variables can be set using export (bash) or setenv (tcsh).
84 Now you need to create a build directory with
85 a name that indicates the purpose of this build (eg nrn-5.4) and cd
86 to this directory.
87
88 Now the configure command is:
89   $NRNS/configure --prefix=`pwd` --srcdir=$NRNS --with-iv=$IV
90 you can use relative addressing (eg ..) for everything except -with-iv=
91 since this will need to be accessed from deep within the tree
92
93 Make is done in the usual way:
94   make
95   make install
96
97 the path is then set to include $PWD/i686/bin
98
99 If "make" fails or you don't seem to be getting the latest changes,
100 it may be because your working copy is not using the
101 nrn-dev5_4 branch. There should be a $NRNS/CVS/Tag file with the contents
102 Tnrn-dev5_4
103 If the file is missing or indicates you are using the wrong branch
104 then switch to the nrn-dev5_4 branch with
105   cd $NRNS
106   cvs update -r nrn-dev5_4
107
108 7) An example for profiling:
109
110 Profiling (using bash)
111 # create a 'profile' directory; cd profile; export NPROF=$PWD
112 export CFLAGS="-pg"
113 export CXXFLAGS="-pg"
114 export linux_nrnmech=no
115 $NRNS/configure --disable-shared --prefix=$NPROF --srcdir=$NRNS
116 make
117 make install
118 # cd to some model to test
119 $NPROF/i686/bin/nrnivmodl
120 i686/special batch_.hoc
121 gprof i686/special > temp
122
123
124 How to make a neuron rpm.
125 1) Install InterViews in /usr/local/iv
126 ./configure --prefix=/usr/local/iv
127 make
128 su
129 make install
130
131 2) Install NEURON in /usr/local/nrn
132 ../nrn/configure --prefix=/usr/local/nrn --with-iv=/usr/local/iv \
133   --srcdir=../nrn --enable-rpm-rules --with-nrnjava --disable-static
134 make
135 su
136 make install
137 make rpm
138 This will create something like
139 /usr/src/redhat/RPMS/i386/nrn-5.5-1.i386.rpm
140
141
142 How to make a Mac dmg
143 The following is out of date in some points. e.g. the CopyDisk refers to
144 osx 10.2 and nowadays we use hdiutil to do everything under shell script control.
145 See cvs2osx11dmg for a script that specifies the entire process from cvs to
146 dmg. The x11 refers to the use of the xdarwin version of X11.
147
148 1) Install InterViews in /Applications/NEURON-5.5/nrn
149 ./configure --prefix=/Applications/NEURON-5.5/iv
150
151 2) Install NEURON in /Applications/NEURON-5.5/nrn
152 ./configure --prefix=/Applications/NEURON-5.5/nrn --with-iv=/Applications/NEURON-5.5/iv
153
154 3) With a finder window view the directory
155 /Applications/NEURON-5.5/nrn/powerpc/bin
156 This is required for the applescript to find the macnrn.term file.
157 Note: Don't bother, now done in the src/mac/after-install script
158
159 4) The nrngui, mknrndll, neurondemo, mos2nrn, idraw applescripts should be
160 in /Applications/NEURON-5.5 . Reuse the applescripts from a previous installation
161 along with their icons.
162 The applescript text is nrn/src/mac/prototype_applescript.txt .
163 Note: Now done by "make install" when src/mac/launch_inst.sh script is called.
164
165 5) sh nrn/src/mac/after-install.sh
166 to clean up the installation directory, remove irrelevant executables,
167 strip the important executables, and create the neurondemo. This will reduce
168 the size of an installation package from more than 12MB to less than 4MB.
169
170 6) Create a NEURON-5.5.dmg file using /Applications/Utilities/CopyDisk.
171 It is a good idea to create a NEURON-5.5 folder somewhere and temporarily
172 drag the /Applications/NEURON-5.5 folder to it and copy the former in order
173 to get a dmg file which when opened shows the NEURON-5.5 folder instead of
174 the contents. This makes it easier to install by dragging the NEURON-5.5
175 folder to where the user wants it (/Applications).
176 Note: now done by src/mac/mkdmg.sh .
177
178
179 how2make ncsnrn
180 unset PVM_ROOT
181 ../ncsnrn/configure --srcdir=../ncsnrn --prefix=`pwd` --without-x \
182  --enable-purify --disable-shared --without-memacs --without-readline \
183  --enable-ncs
Note: See TracBrowser for help on using the browser.