Revision 727ee1ec doc/devnotes.rst
b/doc/devnotes.rst | ||
---|---|---|
1 | 1 |
Developer notes |
2 | 2 |
=============== |
3 | 3 |
|
4 |
.. highlight:: shell-example |
|
5 |
|
|
4 | 6 |
Build dependencies |
5 | 7 |
------------------ |
6 | 8 |
|
... | ... | |
19 | 21 |
- `pep8 <https://github.com/jcrocholl/pep8/>`_ |
20 | 22 |
|
21 | 23 |
Note that for pylint, at the current moment the following versions |
22 |
need to be used::
|
|
24 |
must be used::
|
|
23 | 25 |
|
24 | 26 |
$ pylint --version |
25 | 27 |
pylint 0.21.1, |
... | ... | |
42 | 44 |
library, version 2.x |
43 | 45 |
- ``hpc``, which comes with the compiler, so you should already have |
44 | 46 |
it |
47 |
- `shelltestrunner <http://joyful.com/shelltestrunner>`_, used for |
|
48 |
running unit-tests |
|
49 |
|
|
50 |
Under Debian Wheezy or later, these can be installed (on top of the |
|
51 |
required ones from the quick install document) via:: |
|
45 | 52 |
|
46 |
Under Debian, these can be installed (on top of the required ones from |
|
47 |
the quick install document) via:: |
|
53 |
$ apt-get install libghc-quickcheck2-dev hscolour hlint |
|
48 | 54 |
|
49 |
apt-get install libghc-quickcheck2-dev hscolour hlint |
|
55 |
Or alternatively via ``cabal``:: |
|
56 |
|
|
57 |
$ cabal install quickcheck hscolour hlint shelltestrunner |
|
50 | 58 |
|
51 | 59 |
|
52 | 60 |
Configuring for development |
53 | 61 |
--------------------------- |
54 | 62 |
|
55 |
.. highlight:: sh |
|
56 |
|
|
57 | 63 |
Run the following command (only use ``PYTHON=...`` if you need to use a |
58 | 64 |
different python version):: |
59 | 65 |
|
60 |
./autogen.sh && \ |
|
61 |
./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var |
|
66 |
$ ./autogen.sh && \
|
|
67 |
./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var
|
|
62 | 68 |
|
63 | 69 |
Haskell development notes |
64 | 70 |
------------------------- |
... | ... | |
68 | 74 |
|
69 | 75 |
You can run the Haskell linter :command:`hlint` via:: |
70 | 76 |
|
71 |
make hlint |
|
77 |
$ make hlint
|
|
72 | 78 |
|
73 | 79 |
This is not enabled by default (as the htools component is |
74 | 80 |
optional). The above command will generate both output on the terminal |
... | ... | |
78 | 84 |
When writing or debugging TemplateHaskell code, it's useful to see |
79 | 85 |
what the splices are converted to. This can be done via:: |
80 | 86 |
|
81 |
make HEXTRA="-ddump-splices" |
|
87 |
$ make HEXTRA="-ddump-splices"
|
|
82 | 88 |
|
83 | 89 |
Due to the way TemplateHaskell works, it's not straightforward to |
84 | 90 |
build profiling code. The recommended way is to run ``make hs-prof``, |
85 | 91 |
or alternatively the manual sequence is:: |
86 | 92 |
|
87 |
make clean |
|
88 |
make htools/htools HEXTRA="-osuf .o" |
|
89 |
rm htools/htools |
|
90 |
make htools/htools HEXTRA="-osuf .prof_o -prof -auto-all" |
|
93 |
$ make clean
|
|
94 |
$ make htools/htools HEXTRA="-osuf .o"
|
|
95 |
$ rm htools/htools
|
|
96 |
$ make htools/htools HEXTRA="-osuf .prof_o -prof -auto-all"
|
|
91 | 97 |
|
92 | 98 |
This will build the binary twice, per the TemplateHaskell |
93 | 99 |
documentation, the second one with profiling enabled. |
Also available in: Unified diff