[Mapserver-users] Procedimiento para instalar en Solaris 9

Isai Fararoni fararoni at yahoo.com
Wed Mar 19 13:01:52 EST 2003


INSTALACION DE MAPSERVER EN SOLARIS
Les comparto los problemas que tuve para instalarlo en
la version de Solaris 9 y como quedo finalmente
fararoni at yahoo.com


REQUISITOS: 
Ø	Tener instalado el Servidor Apache 
Ø	Tener instalado el compilador gcc (SMCgcc) Versión
3.2.2
Ø	Tener instaladas las librerías para gcc (SMClibgcc)
Versión 3.22
Ø	Tener instalado el GNU Make 3.80 
Por default Solaris trae otro compilador y su propio
make

Last login: Tue Mar 18 13:58:41 from 192.168.54.144:
Sun Microsystems Inc.   SunOS 5.9       Generic May
2002
POLUX#>

2. Si no uso la clave de usuario root, cambiarse de
usuario
#su - root
Sun Microsystems Inc.   SunOS 5.9       Generic May
2002

CONFIGURACIONES PREVIAS A LA INSTALACIÓN DE LAS
LIBRERÍAS
1.Confirmar que es gcc 3.2.2 o superior
# gcc --version
gcc (GCC) 3.2.2
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

2.Confirmar que es versión 3.80 del GNU Make o
superior
#>/usr/local/bin/make --version
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying
conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A
PARTICULAR PURPOSE.

3. Verificar que tiene instaladas las librerías de gcc
(SMClibgcc)
#pkginfo | grep libgcc
application SMClibgcc      libgcc

4. Verificar que tiene declarada la variable
LD_LIBRARY_PATH
#echo $LD_LIBRARY_PATH
/usr/local/lib

INSTALACIÓN DE LAS LIBRERÍAS

PRECONFIGURACIONES.
Instalar lo que falte

Agregar la línea al final de /etc/profile y agregar
------------------
LD_LIBRARY_PATH=$LA_LIBRARY_PATH:/usr/local/lib
:/usr/lib
------------------
*Reinicié el equipo para que tome este cambiom, si
alguien sabe como hacer sin reinicar que me diga.
*Si esta variable esta definida en algún otro lugar,
tambien que me avise.

Instalar el GNUMAKE
cd /librerias/make-3.80
1.- sh
2.- #./configure
3.- #make
4.- #make install
5.- #./make check
6.- #make clean
*Para desintalar usar : make distclean
*Por default queda instalado en /usr/local/bin/make

Instalar GCC
Esta libreria la puedes obtener de www.sunfreeware.com
1.- gzip -d gcc-3.2.2-sol9-sparc-local.gz
2.- #pkgadd -d ./gcc-3.2.2-sol9-sparc-local

Actualizar las librerías para gcc y c++ en caso de no
tener instalado 
0.- Ir al directorio donde esta descomprimida la
libreria (source code)
cd /export/home/gis/librerias
1.- #sh
2.- #pkgadd -d ./libgcc-3.2.2-sol9-sparc-local


AHORA VIENE EL MAPSERVER

Instalar FreeType. 
0.- Ir al directorio donde esta descomprimida la
libreria (source code)
# cd freetype-2.1.4rc2
1.- #sh
2.- ./configure
3.- /usr/local/bin/make
4.- /usr/local/bin/make install

Instalar  JPEG

cd jpeg-6b
1.-#./configure
2.-#/usr/local/bin/make
3.-#/usr/local/bin/make test
4.-#/usr/local/bin/make install
5.-# /usr/local/bin/make install-lib

Instalación de GD
www.boutell.com
cd gd-2.0.11
1.-#./configure
--with-freetype==/usr/local/include/freetype2
2.-#make
3.-#make check
4.-#make install
5.-#make clean
La libreria queda instalada en : /usr/local/include

 Instalar las librerias PROJ 4 - Para el manejo de
proyecciones
0.- Ir al directorio donde esta descomprimida la
librería (source code)
# cd proj-4.4.6
1.-#./configure
2.-#make
3.-#make check
4.-#make install
5.-#make clean

La libreria queda instalada en /usr/local/lib

Compilar e Instalar el Mapserver 3.6
0, moverse al directorio de las librerias
# cd mapserver-3.6.0
1.- # make
à Nota ejecutar el siguiente comando, solamente para
revisar que se generó correctamente el programa.  
POLUX#>./mapserv
This script can only be used to decode form results
and
should be initiated as a CGI process via a httpd
server.
#
2.- # cp mapserv /var/local/apache/cgi-bin/mapserv.exe

 
Compilar e Instalar el Mapserver 3.3
0, moverse al directorio de las librerias
# cd /export/home/gis/librerias/mapserver
1.- # make
#./mapserv -help
à Nota ejecutar el siguiente comando, solamente para
revisar que se generó correctamente el programa.  
#./mapserv
This script can only be used to decode form results
and
should be initiated as a CGI process via a httpd
server.
#

à Nota ejecutar el siguiente comando, solamente para
revisar que se genero correctamente el programa.  
#./mapserv
This script can only be used to decode form results
and
should be initiated as a CGI process via a httpd
server.
#

Nota. La aplicación puede no funcionar desde el web,
si ocurre, crear links simbolicos de las librerias
generadas al directorio /usr/lib. Debe quedar de la
siguiente manera. Si alguien sabe como hacer que las
librerias /usr/lib sean encontradas en algun path,
favor de hacermelo saber, porque yo use links
simbolicos aunque no creo que sea necesario.
El link va de los archivos en /usr/local/lib a
/usr/lib

lrwxrwxrwx   20 Mar 11 13:38 libfreetype.so ->
libfreetype.so.6.3.3
lrwxrwxrwx   20 Mar 11 13:38 libfreetype.so.6 ->
libfreetype.so.6.3.3
lrwxrwxrwx   18 Mar 12 14:18 libstdc++.so ->
libstdc++.so.5.0.2
lrwxrwxrwx   18 Mar 12 14:18 libstdc++.so.5 ->
libstdc++.so.5.0.2

a continuación pego el contenido del arhchivo Makefile
de Mapserver 3.6.0

# Generated automatically from Makefile.in by
configure.
# Run ./configure in the main MapServer directory to
turn this Makefile.in
# into a proper Makefile

LIB_INSTALL=/usr/local/lib/
HEADER_INSTALL=/usr/local/include/mapserver-3.0/

#
# mpatrol runtime memory debugger
#
MPATROL=  	
MPATROL_INC=	
MPATROL_LIB=	

#
# If you want to ignore missing datafile errors
uncomment the following
# line. This is especially useful with large tiled
datasets that may not
# have complete data for each tile.
#
#IGNORE_MISSING_DATA=-DIGNORE_MISSING_DATA
IGNORE_MISSING_DATA = -DIGNORE_MISSING_DATA

#
# Apparently these aren't as commonplace as I'd hoped.
Edit the
# following line to reflect the missing functions on
your platform.
#
# STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP
-DNEED_STRDUP
STRINGS= 

# Proj.4 distribution (cartographic projection
routines). Not required for normal use. (EXPERIMENTAL)
PROJ_INC= 
PROJ_LIB= 
PROJ=     

# GD distribution (graphics library GIF and/or PNG
support). (REQUIRED)
#
#   - Versions 1.3 to 1.5 write non-LZW GIF
(-DUSE_GD_1_3).
#   - Versions 1.6 and greater write PNG
(-DUSE_GD_1_6). Add -lpng -lz to GD_LIB line.
#
#
GDFONT_OBJ=gd-1.2/gdfontt.o gd-1.2/gdfonts.o
gd-1.2/gdfontmb.o gd-1.2/gdfontl.o gd-1.2/gdfontg.o
GD_INC=  -I/usr/local/include
GD_LIB=  -L/usr/local/lib -lgd -ljpeg -lfreetype -lpng
-L/lib -lz
GD=       -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP
-DUSE_GD_FT
GD_STATIC = 

# PDFlib distribution (PDF library w/ PDF support).
(EXPERIMENTAL)
#
#
#
PDF_INC=  
PDF_LIB=  
PDF=      
PDF_OBJ=  

# TIFF distribution (raster support for TIFF and
GEOTIFF imagery). (RECOMMENDED)
TIFF_INC= 
TIFF_LIB=  -ljpeg -lfreetype -lpng -L/lib -lz
TIFF=     

# JPEG distribution (raster support for grayscale JPEG
images, INPUT ONLY).
JPEG_INC= 
JPEG_LIB= -ljpeg
JPEG=     -DUSE_JPEG

# EPPL7 Support (this activates ERDAS as well)
Included in the distribution. Probably the best raster
alternative if
# you've got EPPL7 laying around. See
http://www.lmic.state.mn.us/ for more information.
(RECOMMENDED)
EPPL=     -DUSE_EPPL
EPPL_OBJ= epplib.o

# ESRI SDE Support. You MUST have the SDE Client
libraries and include files
# on your system someplace. The actual SDE server you
wish to connect to can
# be elsewhere.
SDE=	  
SDE_LIB=  
SDE_INC=  

# Optional OGR Support.  OGC Simple Feature inspired
interface for vector
# formats.  See
http://gdal.velocet.ca/projects/opengis/
OGR=	  
OGR_LIB=  
OGR_INC=  
OGR_STATIC= 

# Optional GDAL Support (provides read access to a
variety of raster formats)
# See http://www.remotesensing.org/gdal
GDAL=	  
GDAL_LIB=  
GDAL_INC=  

# Optional PostGIS Support.  See
http://postgis.refractions.net/
POSTGIS=      
POSTGIS_LIB=  
POSTGIS_INC=  

# Optional ORACLESPATIAL Support. Contact:
cabral at cttmar.univali.br
ORACLESPATIAL=      
ORACLESPATIAL_LIB=  
ORACLESPATIAL_INC=  

# w3c-libwww ... required for WMS Client Connections
WWW_INC= 
WWW_LIB= 

# OGC WMS Compatibility:  -DUSE_WMS (Requires PROJ4
support)
# OGC WMS Client Connections:  -DUSE_WMS_LYR (Requires
PROJ4 and libwww)
WMS=	   

#
# UofMN GIS/Image Processing Extension (very
experimental)
#
#EGIS=-DUSE_EGIS
#EGIS_INC=-I./egis/errLog -I./egis/imgSrc -I./egis
#EGIS_LIB=-L./egis/errLog -lerrLog -L./egis/imgSrc
-limgGEN -L./egis -legis
#MAKE_EGIS=egis
#MAKE_EGIS_CLEAN=egis_clean

#
# IMPORTANT NOTE ABOUT REGEX FOR PHP_MAPSCRIPT USERS:
#
# In order to compile the PHP_MAPSCRIPT module, we
have to make MapServer
# uses the same version of the REGEX library that PHP
was compiled with:
#
REGEX_OBJ=	
REGEX_INC=	

#
# Multithreading support.
#
THREAD=
THREAD_LIB=

#
# Pick a compiler, etc. Flex and bison are only
required if you need to modify the mapserver lexer
(maplexer.l) or expression parser (mapparser.y).
#
CXX=	gcc	
CC=     gcc
AR= ar rc
RANLIB= ranlib
LEX=    lex
YACC=   yacc
# NOTA -- agregue : -lstdc++
XTRALIBS=  -lm -lstdc++
RUNPATHS= 

CFLAGS= -O2  -Wall  \
        $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL)
$(PROJ) $(WMS) \
	$(ORACLESPATIAL) $(TIFF) $(JPEG) $(GD) $(PDF) $(SDE)
$(OGR) $(GDAL) \
	$(POSTGIS) $(MPATROL) $(THREAD) \
	$(GD_INC) $(PDF_INC) $(PROJ_INC) $(TIFF_INC)
$(JPEG_INC) $(EGIS_INC) $(SDE_INC) \
	$(REGEX_INC) $(MPATROL_INC) $(OGR_INC) $(GDAL_INC)
$(POSTGIS_INC) \
	$(WWW_INC) $(ORACLESPATIAL_INC)

# Link flags and shared libs only
LDFLAGS=  $(RUNPATHS) -L. -lmap $(GD_LIB) $(PDF_LIB)
$(TIFF_LIB) $(PROJ_LIB) \
          $(JPEG_LIB) $(EGIS_LIB) $(SDE_LIB)
$(OGR_LIB) $(GDAL_LIB) \
	  $(POSTGIS_LIB) $(WWW_LIB) $(ORACLESPATIAL_LIB)
$(MPATROL_LIB) \
	  $(THREAD_LIB) $(XTRALIBS)

# STATIC_LIBS is full filename with path of libs that
will be statically linked
STATIC_LIBS= $(GD_STATIC) $(OGR_STATIC)

RM= /bin/rm -f

OBJS= maptemplate.o mapbits.o maphash.o mapshape.o
mapxbase.o mapparser.o maplexer.o maptree.o
mapsearch.o mapstring.o mapsymbol.o mapfile.o
maplegend.o maputil.o mapscale.o mapquery.o maplabel.o
maperror.o mapprimitive.o mapproject.o mapraster.o
mapsde.o mapogr.o mappostgis.o maplayer.o
mapresample.o mapwms.o mapwmslayer.o
maporaclespatial.o mapgml.o mapprojhack.o mapthread.o
$(EPPL_OBJ) $(REGEX_OBJ) $(PDF_OBJ)

#
# --- You shouldn't have to edit anything else. ---
#
.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

all: $(MAKE_GD) $(MAKE_EGIS) libmap.a shp2img shp2pdf
legend \
	mapserv shptree shptreevis shptreetst scalebar
sortshp perlvars \
	tile4ms 

egis::
	cd egis/errLog; make; cd ..
	cd egis/imgSrc; make; cd ..
	cd egis; make; cd ..

php3_mapscript:: libmap.a
	cd mapscript/php3; $(MAKE); cd ../..

maplexer.o: maplexer.c map.h mapfile.h

maplexer.c: maplexer.l
	$(LEX) -Pmsyy -i -omaplexer.c maplexer.l

mapparser.o: mapparser.c map.h

mapparser.c: mapparser.y
	$(YACC) -p msyy -d -omapparser.c mapparser.y

mapogr.o: mapogr.cpp
	$(CXX) -c $(CFLAGS) mapogr.cpp -o mapogr.o

lib: libmap.a
libmap: libmap.a
libmap.a: map.h $(OBJS) map.h
	$(AR) libmap.a $(OBJS)
	$(RANLIB) libmap.a

shp2pdf: libmap.a shp2pdf.o map.h
	$(CC) $(CFLAGS) shp2pdf.o $(LDFLAGS) $(STATIC_LIBS)
-o shp2pdf

shp2img: libmap.a  shp2img.o map.h
	$(CC) $(CFLAGS) shp2img.o $(LDFLAGS) $(STATIC_LIBS)
-o shp2img

sym2img: libmap.a   sym2img.o map.h
	$(CC) $(CFLAGS) sym2img.o $(LDFLAGS) $(STATIC_LIBS)
-o sym2img

legend: libmap.a  legend.o map.h
	$(CC) $(CFLAGS) legend.o $(LDFLAGS) $(STATIC_LIBS) -o
legend

scalebar: libmap.a  scalebar.o map.h
	$(CC) $(CFLAGS) scalebar.o $(LDFLAGS) $(STATIC_LIBS)
-o scalebar

mapserv: mapserv.h libmap.a  mapserv.o cgiutil.o map.h
	$(CC) $(CFLAGS) mapserv.o cgiutil.o  $(LDFLAGS)
$(STATIC_LIBS) -o mapserv

shpindex: libmap.a shpindex.o map.h
	$(CC) $(CFLAGS) shpindex.o $(LDFLAGS) $(STATIC_LIBS)
-o shpindex

shptree: libmap.a shptree.o map.h
	$(CC) $(CFLAGS) shptree.o $(LDFLAGS) $(STATIC_LIBS)
-o shptree

shptreevis: libmap.a shptreevis.o map.h
	$(CC) $(CFLAGS) shptreevis.o $(LDFLAGS)
$(STATIC_LIBS) -o shptreevis

shptreetst: libmap.a shptreetst.o map.h
	$(CC) $(CFLAGS) shptreetst.o $(LDFLAGS)
$(STATIC_LIBS) -o shptreetst

sortshp: sortshp.o
	$(CC) $(CFLAGS) sortshp.o $(LDFLAGS) $(STATIC_LIBS)
-o sortshp

tile4ms: tile4ms.o
	$(CC) $(CFLAGS) tile4ms.o $(LDFLAGS) $(STATIC_LIBS)
-o tile4ms

perlvars:
	touch perlvars
	pwd > perlvars
	echo $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL)
$(PROJ) $(TTF) $(TIFF) $(JPEG) $(GD) $(SDE) $(OGR)
$(GDAL) >> perlvars
	echo -I. $(PROJ_INC) $(GD_INC) $(TTF_INC) $(TIFF_INC)
$(JPEG_INC) $(SDE_INC) $(OGR_INC) $(GDAL_INC) >>
perlvars
	echo $(LDFLAGS) >> perlvars
	echo $(STATIC_LIBS) >> perlvars

egis_clean:
	cd egis/errLog; $(MAKE) clean; cd ..
	cd egis/imgSrc; $(MAKE) clean; cd ..
	cd egis; $(MAKE) clean; cd ..

php3_mapscript_clean::
	cd mapscript/php3; $(MAKE) clean; cd ../..

install: libmap.a
	cp -f libmap.a $(LIB_INSTALL)
	cp -f map.h $(HEADER_INSTALL)

clean:	$(MAKE_EGIS_CLEAN) 
	rm -f libmap.a *.o shp2img shp2pdf mapserv legend
shptree shptreevis shptreetst scalebar sortshp
perlvars

distclean:
	$(MAKE) clean
	rm config.*

sorta-clean:
	rm -f *.o



=====

Isai Fararoni Ramirez 
fararoni at yahoo.com
Mexico D.F  Instituto Politécnico Nacional
Interest: Distribuited Objects, Virtual Reality, Networks, Security, Internet,GIS


_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx



More information about the mapserver-users mailing list