Changes between Version 3 and Version 4 of SolarisStaticBuild
- Timestamp:
- Jan 26, 2009, 12:50:50 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SolarisStaticBuild
v3 v4 31 31 You will first need to create an independent development environment. We used /usr/local/static as the root directory for all library and binary installs. This will show up in the configure option --prefix=/usr/local/static 32 32 33 Development Software 1. libiconv GNU libiconv is a conversion library. This package is needed in static form for gcc and mapserv 34 33 === Development Software === 34 35 1. libiconv GNU libiconv is a conversion library. This package is needed in static form for gcc and mapserv 36 {{{ 35 37 $ tar zxvf libiconv-1.9.1.tar.gz 36 38 $ cd libiconv-1.9.1 37 39 $ configure --prefix=/usr/local/static --enable-static=yes 38 40 $ make; make install 39 41 }}} 40 42 2. gcc Yes you need a separate gcc with only static libraries. 41 43 {{{ 42 44 $ tar zxvf gcc-3.4.0.tar.gz 43 45 $ cd gcc-3.4.0 … … 49 51 $ make bootstrap 50 52 $ make install 51 53 }}} 52 54 Supporting programs and libraries Prior to compiling the remaining software you'll need to adjust the enviroment variables PATH and LD_LIBRARY_PATH. 53 55 54 56 In csh or tcsh: 55 57 {{{ 56 58 % setenv PATH "/usr/local/static/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/local/bin" 57 59 % setenv LD_LIBRARY_PATH "/usr/local/static/lib:/lib:/usr/lib:$ORACLE_HOME/lib" 58 60 }}} 59 61 In ksh or bash: 60 62 {{{ 61 63 $ export PATH="/usr/local/static/bin:/bin:/usr/bin:/usr/ccs/bin" 62 64 $ export LD_LIBRARY_PATH="/usr/local/static/lib:/lib:/usr/lib:$ORACLE_HOME/lib" 63 65 }}} 64 66 freetype 65 67 {{{ 66 68 $ tar zxvf freetype-2.1.4.tar.gz 67 69 $ cd freetype-2.1.4 … … 69 71 $ make 70 72 $ make install 71 72 jpeg If 'make test' doesn't complain, you're okay. 73 73 }}} 74 jpeg 75 76 If 'make test' doesn't complain, you're okay. 77 {{{ 74 78 $ tar zxvf jpegsrc.v6b.tar.gz 75 79 $ cd jpeg-6b … … 79 83 $ make install 80 84 $ make install-lib 81 82 zlib The test should tell you it went smoothly by printing '*** zlib test OK ***'. 83 85 }}} 86 zlib 87 88 The test should tell you it went smoothly by printing '*** zlib test OK ***'. 89 {{{ 84 90 $ tar zxvf zlib-1.1.4.tar.gz 85 91 $ cd zlib-1.1.4 … … 88 94 $ make test 89 95 $ make install 90 91 png For this one you have to copy the appropriate Makefile for your system from the scripts directory. There's a generic one for solaris that works. When you run 'make test', you should see 'PASS (9782 zero samples)' in the output and 'libpng passes test' at the very end if all went smoothly. As you can see we need to use sed to make some changes to three internal variables so the install and make will go where we want. 92 96 }}} 97 png 98 99 For this one you have to copy the appropriate Makefile for your system from the scripts directory. There's a generic one for solaris that works. When you run 'make test', you should see 'PASS (9782 zero samples)' in the output and 'libpng passes test' at the very end if all went smoothly. As you can see we need to use sed to make some changes to three internal variables so the install and make will go where we want. 100 {{{ 93 101 $ tar zxvf libpng-1.2.5.tar.gz 94 102 $ cd libpng-1.2.5 … … 102 110 $ make install-headers 103 111 $ make install-static 104 105 tiff This configure script is interactive, but you can turn that off with the --noninteractive flag. Since the prefix doesn't work for the man page install, I've included a sed command that fixes the problem. 106 112 }}} 113 tiff 114 115 This configure script is interactive, but you can turn that off with the --noninteractive flag. Since the prefix doesn't work for the man page install, I've included a sed command that fixes the problem. 116 {{{ 107 117 $ tar zxvf tiff-v3.6.0.tar.gz 108 118 $ cd tiff-v3.6.0 … … 112 122 $ make -f Makefile.1 install 113 123 $ rm /usr/local/static/lib/libtiff.so 114 115 gd Everything works fine here. gd needs the libiconv shared library to compile. 116 124 }}} 125 gd 126 127 Everything works fine here. gd needs the libiconv shared library to compile. 128 {{{ 117 129 $ tar zxvf gd-2.0.21gif.tar.gz 118 130 $ cd gd-2.0.21gif … … 120 132 $ make 121 133 $ make install 122 123 proj The usual with a little file moving. Proj has two parts, the main projection engine (proj-4.4.7.tar.gz) and datum support files (proj-nad27-1.1.tar). The datum files must be untarred into the nad subdirectory of proj, as follows: 124 134 }}} 135 proj 136 137 The usual with a little file moving. Proj has two parts, the main projection engine (proj-4.4.7.tar.gz) and datum support files (proj-nad27-1.1.tar). The datum files must be untarred into the nad subdirectory of proj, as follows: 138 {{{ 125 139 $ tar zxvf proj-4.4.7.tar.gz 126 140 $ cd proj-4.4.7/nad … … 130 144 $ make 131 145 $ make install 132 133 pdf Nothing special here. 134 146 }}} 147 pdf 148 149 Nothing special here. 150 {{{ 135 151 $ tar zxvf pdflib-4.0.3.tar.gz 136 152 $ cd pdflib-4.0.3 … … 139 155 $ make test 140 156 $ make install 141 142 curl This package in particular is used by mapserver 4.x.x instead of libwww which was used in previous mapserver versions. 143 157 }}} 158 curl 159 160 This package in particular is used by mapserver 4.x.x instead of libwww which was used in previous mapserver versions. 161 {{{ 144 162 $ tar zxvf curl-7.10.8.tar.gz 145 163 $ cd curl-7.10.8 … … 147 165 $ make 148 166 $ make install 149 150 gdal Almost done with supporting packages... 151 167 }}} 168 gdal 169 170 Almost done with supporting packages... 171 {{{ 152 172 $ tar zxvf gdal-1.2.0.tar.gz 153 173 $ cd gdal-1.2.0 … … 155 175 $ make 156 176 $ make install 157 158 ORACLE For Oracle connections, MapServer needs Oracle client version 8.1.7 or later, earlier versions will not work. 159 160 Installing MapServer The install process below assumes you would like to build MapServer with ORACLE support. Set the proper versions and locations for your installations of ORACLE and gd. Before you build, make sure ORACLE_HOME is correct and that $ORACLE_HOME/lib is in your LD_LIBRARY_PATH. In the examples below, Apache's web documents directory is /opt/html and its cgi-bin is /opt/cgi-bin. Set them to the appropriate directories on your system. 161 177 }}} 178 ORACLE 179 180 For Oracle connections, MapServer needs Oracle client version 8.1.7 or later, earlier versions will not work. 181 182 Installing !MapServer 183 184 The install process below assumes you would like to build MapServer with ORACLE support. Set the proper versions and locations for your installations of ORACLE and gd. Before you build, make sure ORACLE_HOME is correct and that $ORACLE_HOME/lib is in your LD_LIBRARY_PATH. In the examples below, Apache's web documents directory is /opt/html and its cgi-bin is /opt/cgi-bin. Set them to the appropriate directories on your system. 185 186 {{{ 162 187 $ tar zxvf mapserver-4.2.1.tar.gz 163 188 $ cd mapserver-4.2.1 164 189 $ ./configure --without-jpeg --with-gd=../gd-2.0.21gif --with-freetype=/usr/local/static --enable-force-freetype1 --with-zlib --with-png --with-pdf --without-tiff --without-eppl --with-proj --with-ogr --with-gdal=../gdal-1.2.0/apps/gdal-config --with-wmsclient --with-wfsclient --with-oraclespatial=$ORACLE_HOME --with-sde=/opt2/sde/sdeexe83 --with-sde-version=83 \ <-- if using SDE input 165 190 --with-wfs --enable-debug --without-httpd 166 167 Edit the Makefile Find the line that begins with: GDAL_LIB= Change the last part of the line to look like: gdal-1.2.0/.libs/libgdal.a -lNCSEcw -lNCSUtil The -lNCSEcw -lNCSUtil is needed if you are including ECW support $ make mapserv The resulting executable should have 755 permissions. If it doesn't, set it that way and then trying running it: $ chmod 755 mapserv $ ./mapserv You should get this message: This script can only be used to decode form results and should be initiated as a CGI process via a httpd server. Next, copy the executable into your cgi-bin directory and make it owned by the user id under which apache runs (normally apache or nobody). $ cp mapserv <webserver-root>/cgi-bin $ chown nobody:nobody <webserver-root>/cgi-bin/mapserv Now try accessing MapServer from a web page by going to this URL on your host: http://myhost/cgi-bin/mapserv This should produce the message: 191 }}} 192 Edit the Makefile 193 194 Find the line that begins with: GDAL_LIB= Change the last part of the line to look like: gdal-1.2.0/.libs/libgdal.a -lNCSEcw -lNCSUtil The -lNCSEcw -lNCSUtil is needed if you are including ECW support $ make mapserv The resulting executable should have 755 permissions. If it doesn't, set it that way and then trying running it: $ chmod 755 mapserv $ ./mapserv You should get this message: This script can only be used to decode form results and should be initiated as a CGI process via a httpd server. Next, copy the executable into your cgi-bin directory and make it owned by the user id under which apache runs (normally apache or nobody). $ cp mapserv <webserver-root>/cgi-bin $ chown nobody:nobody <webserver-root>/cgi-bin/mapserv Now try accessing MapServer from a web page by going to this URL on your host: http://myhost/cgi-bin/mapserv This should produce the message: 168 195 169 196 No query information to decode. QUERY_STRING is set, but empty. Next, install the MapScript perl module. MapScript for PHP is also available, but instructions for installing it are not included here. For this part, you will need to have Perl installed on your machine. $ cd mapscript/perl $ perl Makefile.PL $ make $ make install … … 171 198 Done! 172 199 173 Common Problems One common problem is getting Apache's environment variables right. In order to run MapServer, it needs to have the correct LD_LIBRARY_PATH. Set this by adding a line like the following to the beginning of Apache's httpd.conf file. setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/local/lib:/oracle/9.2/lib:/opt2/sde/sdeexe83/lib If you can run MapServer at the command line without any problems, but get 'Internal Server Error' when accessing it via the web, most likely your environment does not match Apache's. If Apache cannot run MapServer due to LD_LIBRARY_PATH problems, it will complain about a missing library. The resulting error in Apache's error log will probably look something like this: ld.so.1: mapserv: fatal: libclntsh.so.8.0: open failed: No such file or directory In this case, it was looking for an oracle library that it could not find. For such problems, make sure Apache also has ORACLE_HOME set in httpd.conf as well, like so: setenv ORACLE_HOME /oracle/9.2 A common problem with installing MapScript/perl is that it will not compile with some older versions of Perl. In testing, the MapScript Perl module compiled successfully using Perl v5.8.3. 200 == Common Problems == 201 202 One common problem is getting Apache's environment variables right. In order to run MapServer, it needs to have the correct LD_LIBRARY_PATH. Set this by adding a line like the following to the beginning of Apache's httpd.conf file. setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/local/lib:/oracle/9.2/lib:/opt2/sde/sdeexe83/lib If you can run MapServer at the command line without any problems, but get 'Internal Server Error' when accessing it via the web, most likely your environment does not match Apache's. If Apache cannot run MapServer due to LD_LIBRARY_PATH problems, it will complain about a missing library. The resulting error in Apache's error log will probably look something like this: ld.so.1: mapserv: fatal: libclntsh.so.8.0: open failed: No such file or directory In this case, it was looking for an oracle library that it could not find. For such problems, make sure Apache also has ORACLE_HOME set in httpd.conf as well, like so: setenv ORACLE_HOME /oracle/9.2 A common problem with installing MapScript/perl is that it will not compile with some older versions of Perl. In testing, the MapScript Perl module compiled successfully using Perl v5.8.3.