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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
|
========================================================================
Agda 2
========================================================================
Table of contents:
* Installing Agda
* Configuring the Emacs mode
* Prerequisites
* Installing the Epic backend's dependencies
* Installing a suitable version of Emacs under Windows
------------------------------------------------------------------------
Installing Agda
------------------------------------------------------------------------
Note that this README only discusses installation of Agda, not its
standard library. See the Agda Wiki for information about the
library.
There are several ways to install Agda:
* Using a binary package, prepared for your platform.
Recommended if such a package exists. See the Agda Wiki.
* Using a released source package, available from Hackage.
(Note that if you want to install the development version of Agda,
then you should use the next method.)
Install the prerequisites mentioned below, then run the following
commands:
cabal update
cabal install Agda-executable
agda-mode setup
The last command tries to set up Emacs for use with Agda. As an
alternative you can copy the following text to your .emacs file:
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
* Using the source tar balls available from the Agda Wiki, or the
development version of the code available from our darcs repository.
1) Install the prerequisites mentioned below.
2a) Run the following commands in the top-level directory of the
Agda source tree:
cabal update
cabal install
agda-mode setup
cd src/main
cabal install
The third command tries to set up Emacs for use with Agda. As an
alternative you can copy the following text to your .emacs file:
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
If you want to have more control over where files are installed
then you can give various flags to cabal install, see
cabal install --help.
2b) Instead of following 2a you can try to install Agda (including
batch-mode tool and Emacs mode) by running the following
command:
make install
------------------------------------------------------------------------
Configuring the Emacs mode
------------------------------------------------------------------------
If you want to you can customise the Emacs mode. Just start Emacs and
type the following:
M-x load-library RET agda2-mode RET
M-x customize-group RET agda2 RET
This is useful if you want to change the Agda search path, in which
case you should change the agda2-include-dirs variable.
If you want some specific settings for the Emacs mode you can add them
to agda2-mode-hook. For instance, if you do not want to use the Agda
input method (for writing various symbols like ∀≥ℕ→π⟦⟧) you can add
the following to your .emacs:
(add-hook 'agda2-mode-hook
'(lambda ()
; If you do not want to use any input method:
(inactivate-input-method)
; If you want to use the X input method:
(set-input-method "X")
))
Note that, on some systems, the Emacs mode changes the default font of
the current frame in order to enable many Unicode symbols to be
displayed. This only works if the right fonts are available, though.
If you want to turn off this feature, then you should customise the
agda2-fontset-name variable.
------------------------------------------------------------------------
Prerequisites
------------------------------------------------------------------------
You need recent versions of the following programs/libraries:
GHC: http://www.haskell.org/ghc/
cabal-install: http://www.haskell.org/cabal/
Alex: http://www.haskell.org/alex/
Happy: http://www.haskell.org/happy/
GNU Emacs: http://www.gnu.org/software/emacs/
haskell-mode: http://projects.haskell.org/haskellmode-emacs/
You should also make sure that programs installed by cabal-install are
on your shell's search path.
For instructions on installing a suitable version of Emacs under
Windows, see below.
Non-Windows users need to ensure that the development files for the C
libraries zlib and ncurses are installed (see http://zlib.net and
http://www.gnu.org/software/ncurses/). Your package manager may be
able to install these files for you. For instance, on Debian or Ubuntu
it should suffice to run
apt-get install zlib1g-dev libncurses5-dev
as root to get the correct files installed.
------------------------------------------------------------------------
Installing the Epic backend's dependencies
------------------------------------------------------------------------
The Epic backend is experimental and requires that the Epic program is
installed. You can install this program by giving the epic flag to
cabal:
* When installing from Hackage:
cabal update
cabal install Agda -fepic
cabal install Agda-executable
agda-mode setup
* When installing using a source tar ball, following the instructions
in 2a) above:
cabal update
cabal install -fepic
agda-mode setup
cd src/main
cabal install
* When installing using a source tar ball, following the instructions
in 2b) above:
make CABAL_OPTIONS=-fepic install
You can also install Epic directly:
cabal install epic
Note that Epic depends on other software:
The Boehm garbage collector:
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
The GNU Multiple Precision Arithmetic Library:
http://gmplib.org/
GCC, the GNU Compiler Collection:
http://gcc.gnu.org/
For more information about Epic:
http://www.cs.st-andrews.ac.uk/~eb/epic.php
------------------------------------------------------------------------
Installing a suitable version of Emacs under Windows
------------------------------------------------------------------------
Note that Agda code often uses mathematical and other symbols
available from the Unicode character set. In order to be able to
display these characters you may want to follow the procedure below
when installing Emacs under Windows.
1. Install NTEmacs 22.
Download from
http://ntemacs.sourceforge.net/
the self-extracting executable
ntemacs22-bin-20070819.exe
When executed, it asks where to extract itself. This can be
anywhere you like, but here we write the top directory for ntemacs as
c:/pkg/ntemacs
in the following.
What follows is tested only on this version. Other versions may
work but you have to figure out yourself how to use Unicode fonts
on your version.
2. Install ucs-fonts and mule-fonts for emacs.
Download from
http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
the tar file
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
Let us write the top directory of extracted files as
c:/pkg/ucs-fonts
Next we create some derived fonts.
cd c:/pkg/ucs-fonts/submission
make all-bdfs
This gives an error message about missing fonts, but ignore it.
Download from
http://www.meadowy.org/
the tar file
http://www.meadowy.org/meadow/dists/3.00/packages/mule-fonts-1.0-4-pkg.tar.bz2
The untarred top directory is named "packages", but we are only
interested in the subdirectory "packages/fonts". Let us assume
we moved this subdirectory to
c:/pkg/mule-fonts
Add the following to your .emacs
;;;;;;;;; start of quoted elisp code
(setq bdf-directory-list
'(
"c:/pkg/ucs-fonts/submission"
"c:/pkg/mule-fonts/intlfonts"
"c:/pkg/mule-fonts/efonts"
"c:/pkg/mule-fonts/bitmap"
"c:/pkg/mule-fonts/CDAC"
"c:/pkg/mule-fonts/AkrutiFreeFonts"
))
(setq w32-bdf-filename-alist
(w32-find-bdf-fonts bdf-directory-list))
(create-fontset-from-fontset-spec
"-*-fixed-Medium-r-Normal-*-15-*-*-*-c-*-fontset-bdf,
ascii:-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1,
latin-iso8859-2:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-2,
latin-iso8859-3:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-3,
latin-iso8859-4:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-4,
cyrillic-iso8859-5:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-5,
greek-iso8859-7:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-7,
latin-iso8859-9:-*-Fixed-*-r-*-*-15-*-*-*-c-*-iso8859-9,
mule-unicode-0100-24ff:-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO10646-1,
mule-unicode-2500-33ff:-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO10646-1,
mule-unicode-e000-ffff:-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO10646-1,
japanese-jisx0208:-JIS-Fixed-Medium-R-Normal--16-150-75-75-C-160-JISX0208.1983-0,
japanese-jisx0208-1978:-Misc-Fixed-Medium-R-Normal--16-150-75-75-C-160-JISC6226.1978-0,
japanese-jisx0212:-Misc-Fixed-Medium-R-Normal--16-150-75-75-C-160-JISX0212.1990-0,
latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
katakana-jisx0201:-Sony-Fixed-Medium-R-Normal--16-120-100-100-C-80-JISX0201.1976-0,
thai-tis620:-Misc-Fixed-Medium-R-Normal--24-240-72-72-C-120-TIS620.2529-1,
lao:-Misc-Fixed-Medium-R-Normal--24-240-72-72-C-120-MuleLao-1,
tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0,
tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1,
korean-ksc5601:-Daewoo-Mincho-Medium-R-Normal--16-120-100-100-C-160-KSC5601.1987-0,
chinese-gb2312:-ISAS-Fangsong ti-Medium-R-Normal--16-160-72-72-c-160-GB2312.1980-0,
chinese-cns11643-1:-HKU-Fixed-Medium-R-Normal--16-160-72-72-C-160-CNS11643.1992.1-0,
chinese-big5-1:-ETen-Fixed-Medium-R-Normal--16-150-75-75-C-160-Big5.ETen-0,
chinese-big5-2:-ETen-Fixed-Medium-R-Normal--16-150-75-75-C-160-Big5.ETen-0
" t)
(setq font-encoding-alist
(append '(
("JISX0208" (japanese-jisx0208 . 0))
("JISX0212" (japanese-jisx0212 . 0))
("CNS11643.1992.1-0" (chinese-cns11643-1 . 0))
("GB2312" (chinese-gb2312 . 0))
("KSC5601" (korean-ksc5601 . 0))
("VISCII" (vietnamese-viscii-lower . 0))
("MuleArabic-0" (arabic-digit . 0))
("MuleArabic-1" (arabic-1-column . 0))
("MuleArabic-2" (arabic-2-column . 0))
("muleindian-1" (indian-1-column . 0))
("muleindian-2" (indian-2-column . 0))
("MuleTibetan-0" (tibetan . 0))
("MuleTibetan-1" (tibetan-1-column . 0))
) font-encoding-alist))
;;;;;;; end of quoted elisp code
To test the fonts, try
M-x eval-expression RET
(set-default-font "fontset-bdf") RET
M-x view-hello-file
You should see all the characters without white-boxes.
|