-
Notifications
You must be signed in to change notification settings - Fork 19
/
HACKING
178 lines (119 loc) · 4.76 KB
/
HACKING
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
Instructions for developers who use the source code repository
**************************************************************
GIT repository
==============
The source repository can be obtained (read-only) at:
git clone https://github.com/drsteve/LANLGeoMag.git
For write access, fork the repository and clone from your fork.
Further information can be found in the github help.
Then:
cd LanlGeoMag
Later updates:
git pull
Committing your work:
git add [files]
git commit
git pull
git push
Then send a pull request with your changes.
Prerequisites
=============
The following list may not be complete. It is important to note that the
dependencies for LanlGeoMag will have their own dependencies (and so on), so we
highly recommend installing the dependencies using a package manager. On Mac
package managers are not installed by default: MacPorts and HomeBrew are
popular options.
git
autoconf >=2.62 (earlier versions do not have the AC_OPENMP)
libtool >=2.4.2 (earlier versions filter openmp flags - see http://lists.gnu.org/archive/html/bug-libtool/2011-03/msg00024.html)
libperl-dev
gsl
hdf5 >= 1.8 (API changed at this release)
On Mac, the following should also be installed through the package manager:
argp-standalone
Compiling
=========
Just once (or just occasionally):
autoreconf -i
./configure
NB (Oct 2015): Recent updates to HDF5 include non-standard locations and use of
pkg-config. If you have problems with HDF5 when running configure, try:
./configure CFLAGS=`pkg-config hdf5 --cflags` LIBS=`pkg-config hdf5 --libs|grep -o '^\S*'`
Every time:
make
Installing
==========
sudo make install
Note: This will run the script GetEopFiles. If you are behind a proxy, you may
need to modify your /etc/sudoers file to include the line;
Defaults env_keep = "http_proxy ftp_proxy"
Release engineering
===================
Example: you want to freeze and release version 1.5.12. The
convention is that we use tags with the name v1.5.12
Developer actions
.................
The developer takes these steps:
* Commit all final changes and sure that the code passes "make
distcheck"
* Set the new version in configure.ac with AC_INIT(... , [1.5.12] , ...)
* Update the NEWS file with a list of user-visible or API changes
* Tag the repository with
git tag -a v1.5.12
git commit -m "tagged release v1.5.12"
git push --tags
* Then move to the "development" version v1.5.12+ by editing
configure.ac and NEWS and putting AC_INIT(... , [1.5.12] , ...)
Release engineer actions
........................
Start with a fresh clone followed by a checkout of the release tag:
git clone ssh://[email protected]/n/projects/lanl/LanlGeoMag.git LanlGeoMag-v1.5.12
cd LanlGeoMag-v1.5.12
git checkout v1.5.12
autoreconf -i
./configure
make distcheck
And you've got a well-tracked tarball called lanlgeomag-1.5.12.tar.gz
Finally, you can try running
rpmbuild -ta lanlgeomag-1.5.12.tar.gz
to build RPMs. RPMs are not yet working because we still have
/usr/lanl hard-coded in a lot of places, but we are getting closer.
Ctypesgen
=========
The Python wrappers require ctypesgen. For simplicity, we bundle our own
version from https://github.com/olsonse/ctypesgen
There's a nice discussion at
https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec
If you aren't hacking on the ctypes code itself, there's no need to read
any of this. But if you need to update the bundled ctypes, first set up
the repositories:
git remote add ctypesgen https://github.com/olsonse/ctypesgen.git
To start this process from scratch (i.e. before we had anything pulled in):
git fetch ctypesgen
git read-tree --prefix=Python/ctypesgen/ -u ctypesgen/master
But to update ctypesgen now that it's been incorporated:
git fetch ctypesgen
git merge -s subtree --squash ctypesgen/master
git rev-parse ctypesgen/master #To get SHA1
git commit -m "Update ctypesgen to (SHA1)"
We should refer to this license (3-clause BSD) in the lanlgeomag docs.
make dist
===========
It seems you need to make with --enable-doxygen-doc on the ./configure cmd line....
Unit tests
==========
The unit tests test against the version of the library as built (not
installed). But the data directories are compiled in as at install
time. So you need to do a build of the library with those locations
specified in order to test. The directory layout in the source tree
doesn't match the expected directory layout post-install. Long-term
either there should be configure options/environment variables to
specify every directory separately (at build time or runtime), or the
layout of these directories in the source should match the expected
installed layout. For now we patch up with symlinks.
make clean
ln -s ./libLanlGeoMag/ LanlGeoMag
./configure --datadir="`pwd`"
make
JPL_EPHEM_PATH="`pwd`/libLanlGeoMag/DE_FILES/" make check
rm ./LanlGeoMag