9 | | MSYS supplies many utilities from UNIX world in Windows: |
10 | | |
11 | | 1. Download the '''MSYS installer''' from [http://prdownloads.sourceforge.net/mingw/MSYS-1.0.11-2004.04.30-1.exe here]. |
12 | | |
13 | | Install to c:\msys |
14 | | At the command prompt question for post install, type n and then enter. |
15 | | |
16 | | 2. Download the '''MSYS coreutils package''' from [http://downloads.sourceforge.net/mingw/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2 here]: -> MSYS Base System (currently MSYS-1.0.11) |
17 | | |
18 | | Unpack it to a temporary folder, then copy all the content of the coreutils-5.97 folder to c:\msys (overwrite the existing files when asked) |
19 | | |
20 | | 3. Download the '''MinGW installer''' from [http://downloads.sourceforge.net/mingw/MinGW-5.1.4.exe here] |
21 | | |
22 | | - Run and select "Download and Install, "Current Version"; |
23 | | - Install only "g++ compiler" and "MinGW Make"; |
24 | | - Install to c:\msys\mingw (so, into a new folder) - this will download various tools and install them |
25 | | |
26 | | 4. Download and install Python 2.x from [http://www.python.org/download/ here]: use their Windows installer to install it on your system (doesn't matter where). |
27 | | |
28 | | 5. Download and install wxPython from [http://www.wxpython.org/download.php#binaries here] (select version according to Python version taken above) |
29 | | |
30 | | 6. more? |
31 | | |
32 | | === Installing PROJ4 library === |
33 | | |
34 | | ''(untested)'' |
35 | | |
36 | | * Binaries: http://download.osgeo.org/osgeo4w/release/proj/proj-4.6.1-1.tar.bz2 |
37 | | |
38 | | Unpack it to c:\msys\. This will "insert" the files into the right directories. |
39 | | |
40 | | Question: How to use instead OSGeo4W-Proj4 binaries via installer? |
41 | | |
42 | | |
43 | | === Installing GDAL library === |
44 | | |
45 | | ''(untested)'' |
46 | | |
47 | | * Binaries: http://download.osgeo.org/osgeo4w/release/gdal/gdal16/gdal16-1.6.0-8.tar.bz2 |
48 | | |
49 | | Unpack it to c:\msys\. This will "insert" the files into the right directories. |
50 | | |
51 | | Question: How to use instead OSGeo4W-GDAL via installer? |
52 | | |
| 21 | 1. Run msys (there should be an icon on the desktop) |
| 22 | 2. type: |
| 23 | {{{ |
| 24 | mkdir /c/osgeo4w/apps/msys/osgeo4w |
| 25 | }}} |
| 26 | 3. Open c:\osgeo4w\apps\msys\etc\fstab.sample |
| 27 | 4. Add the line below and save as fstab |
| 28 | {{{ |
| 29 | c:\osgeo4w\ /osgeo4w |
| 30 | }}} |
| 31 | 5. Download the MinGW packages: |
| 32 | '''mingw32-make''' from [http://downloads.sourceforge.net/mingw/mingw32-make-3.81-20080326-3.tar.gz here] |
| 33 | '''gcc-core''' from [http://downloads.sourceforge.net/mingw/gcc-core-3.4.5-20060117-3.tar.gz here] |
| 34 | '''gcc-g++''' from [http://downloads.sourceforge.net/mingw/gcc-g++-3.4.5-20060117-3.tar.gz here] |
| 35 | '''w32api''' from [http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz here] |
| 36 | '''mingw-utils''' from [http://downloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz here] |
| 37 | |
| 38 | Unpack to c:\osgeo4w |
| 39 | |
| 40 | === Flex & Bison === |
| 41 | |
| 42 | Download: |
| 43 | '''flex''' from [http://downloads.sourceforge.net/gnuwin32/flex-2.5.4a-1-bin.zip here] |
| 44 | '''bison''' from [http://downloads.sourceforge.net/gnuwin32/bison-2.1-bin.zip here] |
| 45 | '''bison-deps''' from [http://downloads.sourceforge.net/gnuwin32/bison-2.1-dep.zip here] |
| 46 | |
| 47 | Unpack all to c:\osgeo4w |
| 48 | |
| 49 | === PDCurses === |
| 50 | |
| 51 | Download PDCurses from [http://downloads.sourceforge.net/pdcurses/PDCurses-3.3.tar.gz here] |
| 52 | |
| 53 | Unpack to c:\osgeo4w\usr\src\ |
| 54 | open c:\osgeo4w\usr\src\PDCurses-3.3\win32\mingwin32.mak |
| 55 | at line 80 replace |
| 56 | {{{ |
| 57 | -copy |
| 58 | }}} |
| 59 | with |
| 60 | {{{ |
| 61 | -cp |
| 62 | }}} |
| 63 | |
| 64 | Run msys (from desktop icon) and at the prompt type: |
| 65 | |
| 66 | {{{ |
| 67 | cd /osgeo4w/usr/src/PDCurses-3.3/win32 |
| 68 | make |
| 69 | install libcurses.a /osgeo4w/lib |
| 70 | install pdcurses.dll /osgeo4w/bin |
| 71 | cd .. |
| 72 | install -m 644 curses.h /osgeo4w/include |
| 73 | }}} |
| 74 | |
| 75 | === Zlib === |
| 76 | |
| 77 | Download '''zlib'' from [http://www.zlib.net/zlib-1.2.3.tar.gz here] |
| 78 | |
| 79 | Unpack to c:\osgeo4w\usr\src\ |
| 80 | Open c:\osgeo4w\usr\src\zlib-1.2.3\win32\Makefile.gcc |
| 81 | |
| 82 | Replace line 102 with: |
| 83 | |
| 84 | {{{ |
| 85 | INCLUDE_PATH=/osgeo4w/include |
| 86 | LIBRARY_PATH=/osgeo4w/lib |
| 87 | SHARED_LIBRARY_PATH=/osgeo4w/bin |
| 88 | }}} |
| 89 | |
| 90 | At lines 109-110 delete: |
| 91 | |
| 92 | {{{ |
| 93 | -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH) |
| 94 | -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH) |
| 95 | }}} |
| 96 | |
| 97 | After line 111 add: |
| 98 | |
| 99 | {{{ |
| 100 | -$(INSTALL) $(SHAREDLIB) $(SHARED_LIBRARY_PATH) |
| 101 | }}} |
| 102 | |
| 103 | After line 118 add: |
| 104 | |
| 105 | {{{ |
| 106 | -$(RM) $(SHARED_LIBRARY_PATH)/$(SHAREDLIB) |
| 107 | }}} |
| 108 | |
| 109 | Run msys (from desktop icon) and at the prompt type: |
| 110 | |
| 111 | {{{ |
| 112 | cd /osgeo4w/usr/src/zlib-1.2.3 |
| 113 | make -f win32/Makefile.gcc |
| 114 | make install -f win32/Makefile.gcc |
| 115 | }}} |
| 116 | |
| 117 | (As an aside, we could probably put the following files into a zlib-headers package: |
| 118 | /osgeo4w/include/zlib.h |
| 119 | /osgeo4w/include/zconf.h |
| 120 | /osgeo4w/bin/zlib1.dll |
| 121 | /osgeo4w/lib/libz.a |
| 122 | /osgeo4w/lib/libzdll.a) |
| 123 | |
| 124 | === Regex === |
| 125 | |
| 126 | Download regex from [http://downloads.sourceforge.net/gnuwin32/regex-2.7-bin.zip here] |
| 127 | Unpack to c:\osgeo4w |
| 128 | |
| 129 | === Libjpeg === |
| 130 | |
| 131 | Download libjpeg from [http://www.ijg.org/files/jpegsrc.v6b.tar.gz here] |
| 132 | Unpack to c:\osgeo4w\usr\src |
| 133 | |
| 134 | In MSYS console, type: |
| 135 | |
| 136 | {{{ |
| 137 | cd /osgeo4w/usr/src/jpeg-6b |
| 138 | ./configure --prefix=/osgeo4w --enable-shared |
| 139 | make |
| 140 | mkdir /osgeo4w/man/man1 |
| 141 | make install |
| 142 | }}} |
| 143 | |
| 144 | Because make procedure doesn't create the shared library (even if enabled by configure), we need to build it manually: |
| 145 | (As a hint, you can copy the below and paste int msys with Shift+Insert) |
| 146 | {{{ |
| 147 | COMOBJECTS="jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o" |
| 148 | CLIBOBJECTS="jcapimin.o jcapistd.o jctrans.o jcparam.o \ |
| 149 | jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o \ |
| 150 | jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o \ |
| 151 | jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o" |
| 152 | DLIBOBJECTS="jdapimin.o jdapistd.o jdtrans.o jdatasrc.o \ |
| 153 | jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o \ |
| 154 | jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o \ |
| 155 | jidctfst.o jidctflt.o jidctint.o jidctred.o \ |
| 156 | jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o" |
| 157 | LIBOBJECTS="$CLIBOBJECTS $DLIBOBJECTS $COMOBJECTS" |
| 158 | COBJECTS="cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o cdjpeg.o" |
| 159 | DOBJECTS="djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o cdjpeg.o" |
| 160 | TROBJECTS="jpegtran.o rdswitch.o cdjpeg.o transupp.o" |
| 161 | for i in *.exe ; do rm /osgeo4w/bin/$i ; done |
| 162 | rm *.exe |
| 163 | cd .libs |
| 164 | rm libjpeg.a |
| 165 | rm /osgeo4w/lib/libjpeg.a |
| 166 | cd .. |
| 167 | gcc -shared -s -o ./.libs/libjpeg.dll -lm -Wl,--out-implib,./.libs/libjpeg.a $LIBOBJECTS |
| 168 | gcc -s -g -O2 -o cjpeg.exe $COBJECTS -L./.libs/ -ljpeg |
| 169 | gcc -s -g -O2 -o djpeg.exe $DOBJECTS -L./.libs/ -ljpeg |
| 170 | gcc -s -g -O2 -o jpegtran.exe $TROBJECTS -L./.libs/ -ljpeg |
| 171 | gcc -s -g -O2 -o rdjpgcom.exe rdjpgcom.o -L./.libs/ -ljpeg |
| 172 | gcc -s -g -O2 -o wrjpgcom.exe wrjpgcom.o -L./.libs/ -ljpeg |
| 173 | cd .libs |
| 174 | install libjpeg.a /osgeo4w/lib |
| 175 | install libjpeg.dll /osgeo4w/bin |
| 176 | cd .. |
| 177 | for i in *.exe ; do install $i /osgeo4w/bin ; done |
| 178 | }}} |
| 179 | |
| 180 | (Again as an aside, we could put the following into a jpeg-headers package (with proper attributes?): |
| 181 | /osgeo4w/lib/libjpeg.a |
| 182 | /osgeo4w/bin/libjpeg.dll |
| 183 | /osgeo4w/bin/cjpeg.exe |
| 184 | /osgeo4w/bin/djpeg.exe |
| 185 | /osgeo4w/bin/jpegtran.exe |
| 186 | /osgeo4w/bin/rdjpgcom.exe |
| 187 | /osgeo4w/bin/wrjpgcom.exe) |
| 188 | |
| 189 | === PostgreSQL === |
| 190 | |
| 191 | Download pgsql from [http://ftp2.it.postgresql.org/mirrors/postgres/source/v8.3.1/postgresql-8.3.6.tar.gz here] |
| 192 | Unpack to c:\osgeo4w |
| 193 | open c:\osgeo4w\postgresql-8.3.6\src\test\regress\pg_regress.c |
| 194 | At line 51 |
| 195 | change: |
| 196 | char *bindir = PGBINDIR; |
| 197 | char *libdir = LIBDIR; |
| 198 | char *datadir = PGSHAREDIR; |
| 199 | |
| 200 | to: |
| 201 | char *bindir = "/osgeo4w/apps/pgsql/bin"; |
| 202 | char *libdir = "/osgeo4w/apps/pgsql/lib"; |
| 203 | char *datadir = "/osgeo4w/apps/pgsql/share"; |
| 204 | |
| 205 | In msys console type: |
| 206 | |
| 207 | {{{ |
| 208 | cd /osgeo4w/postgresql-8.3.6 |
| 209 | ./configure --prefix=/osgeo4w/apps/pgsql \ |
| 210 | --with-includes=/osgeo4w/include \ |
| 211 | --with-libraries=/osgeo4w/lib \ |
| 212 | --without-readline |
| 213 | make -f GNUmakefile |
| 214 | make install -f GNUmakefile |
| 215 | }}} |
| 216 | |
| 217 | === SQLite === |
| 218 | Download '''sqlite3''' from [http://www.sqlite.org/sqlite-amalgamation-3.5.9.tar.gz here] |
| 219 | Unpack to c:\osgeo4w\usr\src |
| 220 | |
| 221 | {{{ |
| 222 | ./configure --prefix=/osgeo4w/apps/sqlite |
| 223 | make |
| 224 | make install |
| 225 | }}} |
| 226 | |
| 227 | === GDAL === |
| 228 | |
| 229 | '''Untested''' |
| 230 | |
| 231 | Get gdal <http://download.osgeo.org/gdal/gdal-1.5.2.tar.gz> |
| 232 | Unpack to c:\osgeo4w\usr\src |
| 233 | Open c:\osgeo4w\usr\src\gdal-1.5.2\configure |
| 234 | At line 23832 replace: |
| 235 | |
| 236 | {{{ |
| 237 | expat_lib_flags="-L$expat_prefix/lib -lexpat" |
| 238 | }}} |
| 239 | with: |
| 240 | {{{ |
| 241 | LIBS="$LIBS -L$expat_prefix/lib -lexpat" |
| 242 | }}} |
| 243 | |
| 244 | In MSYS console, type: |
| 245 | {{{ |
| 246 | cd /usr/local/src/gdal-1.5.2 |
| 247 | ./configure --prefix=/osego4w \ |
| 248 | --without-grass \ |
| 249 | --with-sqlite3=/osgeo4w/apps/sqlite \ |
| 250 | --with-pg=/osgeo4w/apps/pgsql/bin/pg_config.exe |
| 251 | }}} |
| 252 | Open c:\msys\local\src\gdal-1.5.2\GNUmakefile |
| 253 | After line 4 add: |
| 254 | {{{ |
| 255 | GDAL_ROOT=. |
| 256 | }}} |
| 257 | Finally build and install GDAL: |
| 258 | {{{ |
| 259 | make -f GNUmakefile |
| 260 | make install -f GNUmakefile |
| 261 | }}} |
| 262 | |
| 263 | === Tcl/Tk (skip if only compiling grass7) === |
| 264 | |
| 265 | '''Untested''' |
| 266 | |
| 267 | Download Tcl from [http://prdownloads.sourceforge.net/tcl/tcl8.5.2-src.tar.gz here] |
| 268 | Download Tk from [http://prdownloads.sourceforge.net/tcl/tk8.5.2-src.tar.gz here] |
| 269 | Unpack both to c:\osgeo4w\usr\src |
| 270 | In the msys console type: |
| 271 | {{{ |
| 272 | cd /osgeo4w/usr/src/tcl8.5.2/win |
| 273 | ./configure --prefix=/osgeo4w/apps/tcl-tk --enable-shared |
| 274 | make |
| 275 | make install |
| 276 | cd /osgeo4w/apps/tcl-tk/bin |
| 277 | mv tclsh85.exe tclsh.exe |
| 278 | cd /osgeo4w/usr/src/tk8.5.2/win |
| 279 | ./configure --prefix=/osgeo4w/apps/tcl-tk --with-tcl=/osgeo4w/usr/src/tcl8.5.2/win --enable-shared |
| 280 | make |
| 281 | make install |
| 282 | cd /osgeo4w/apps/tcl-tk/bin |
| 283 | mv wish85.exe wish.exe |
183 | | The startup grass64.bat file should be in c:\msys\local\bin\grass64.bat |
184 | | |
185 | | If using the grass64.sh instead, add to that file: |
186 | | {{{ |
| 349 | The startup '''grass64.bat''' file should be in C:\OSGeo4W\apps\grass\bin |
| 350 | Open it and replace the contents with: |
| 351 | {{{ |
| 352 | @echo off |
| 353 | SET OSGEO4W_ROOT=C:\OSGeo4W |
| 354 | PATH %OSGEO4W_ROOT%\bin;%PATH% |
| 355 | for %%f in ("%OSGEO4W_ROOT%"\etc\ini\*.bat) do call "%%f" |
| 356 | |
| 357 | rem ######################################################################### |
| 358 | rem # |
| 359 | rem # GRASS Initialization |
| 360 | rem # |
| 361 | rem ######################################################################### |
| 362 | |
| 363 | set WINGISBASE=%OSGEO4W_ROOT%/apps/grass/grass-6.4xxx (change to the appropriate grass version) |
| 364 | "%WINGISBASE%"\etc\init.bat %* |
| 365 | }}} |
| 366 | |
| 367 | If you want to be able to use the console from within grass, you'll need a different startup file: |
| 368 | Create '''C:\OSGeo4W\apps\grass\bin\grass64''' with the following contents: |
| 369 | {{{ |
| 370 | #! /bin/sh |
| 371 | ############################################################################# |
| 372 | # |
| 373 | # MODULE: GRASS Initialization |
| 374 | # AUTHOR(S): Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th |
| 375 | # PURPOSE: The source file for this shell script is in |
| 376 | # lib/init/grass.src and is the grass startup script. It |
| 377 | # requires a source file because the definition of GISBASE |
| 378 | # is not known until compile time and is substituted from the |
| 379 | # Makefile. Any command line options are passed to Init.sh. |
| 380 | # COPYRIGHT: (C) 2000-2005 by the GRASS Development Team |
| 381 | # |
| 382 | # This program is free software under the GNU General Public |
| 383 | # License (>=v2). Read the file COPYING that comes with GRASS |
| 384 | # for details. |
| 385 | # |
| 386 | ############################################################################# |
| 387 | |
| 388 | trap "echo 'User break!' ; exit" 2 3 9 15 |
| 389 | |
| 390 | # Set the GISBASE variable |
| 391 | GISBASE=/c/OSGeo4W/apps/grass/grass-6.4xxx (change to the appropriate grass version) |
| 392 | export GISBASE |
| 393 | |
| 394 | # Set the PATH variable |
| 395 | PATH="/osgeo4w/apps/tcl-tk/bin:/osgeo4w/apps/sqlite/bin:/osgeo4w/apps/pgsql/lib:$PATH" |
| 396 | export PATH |
| 397 | |