[Mapserver-users] Perl Mapscript fails on OS X

Marvin Humphrey marvin at rectangular.com
Tue Nov 25 00:17:42 EST 2003


Hello,

I installed Mapserver on my Mac OS X box, (OS version 10.2.8) from the 
nice install package at http://www.serverlogistics.com/mapserver.php

Everything seemed to go smoothly at first.  The Itasca demo worked just 
as it was supposed to.  However, I ran into a problem when trying to 
determine the extents for a shapefile.  shpinfo.pl fails, with the 
following error message...

% perl -c shpinfo.pl 
-file=/Library/WebServer/Documents/itasca/data/lakespy2.shp
dyld: perl multiple definitions of symbol _main
perl definition of _main
/Library/MapServer/lib/libgd.2.dylib(libgd.2.0.0.dylib-master.o) 
definition of _main
Trace/BPT trap

Checking the archives of this list, I discovered that other people had 
experienced similar problems, but nobody had any easy answers.  A 
recompile of the Perl Mapscript seemed to be required.

But when I tried that, the configure file barked that I hadn't built 
Mapserver and therefore it couldn't find a necessary directory. (It 
must not have been able to detect the Server Logistics install.)  So I 
figured I'd temporarily rename /Library/MapServer and 
/Library/Receipts/Mapserver.pkg, compile Mapserver, compile Perl 
Mapscript, then put back the proven good install of Mapserver from 
Server Logistics.

Unfortunately, Mapserver wouldn't compile without gd.  So I downloaded 
and attempted to compile gd.  That failed, telling me that I needed to 
install FIVE other libraries before it would cooperate.

So at this point, it looked like I'd have to...

install zlib, libpng, FreeType 2.x, JPEG library, and XPM...

so that I could install gd...

so that I could install Mapserver (only to remove this installation 
later)...

so that I could install Perl mapscript...

...hoping against hope that no new, unforseen problems would crop up 
during any of those installs, and that something, somewhere in the 
recompilation rigamarole would fix the multiple definition problem or 
allow me to tease it out.

I gave up.  I didn't want to discover whether zlib, libpng, Freetype, 
JPEG library, and XPM would each require me to install 5 other 
libraries before they'd cooperate.  :)

Now what?  Guessing the extents for shapefiles is not an option.

Here's an alternate path that deadended: using ogrinfo, a utility which 
uses the gdal library.  Sadly, gdal doesn't like OS X.  I guess a 
couple people have managed it, but their reports showed that the 
gdal/OSX combo was really fiddly and difficult.  My cursory attempt at 
downloading gdal and compiling it failed at the linking stage.

internal link edit command failed
make[1]: *** [libgdal.1.1.dylib] Error 1
make: *** [check-lib] Error 2

And another dead end: I have GRASS 5 installed on my machine, and I've 
used it to make a bunch of maps already.  The Mapserver tutorial at 
http://terrasip.gis.umn.edu/projects/tutorial/example1-1.html is 
tantalizing -- it says "There are also other freely available GIS data 
viewers that might work."  I figured GRASS *has* to have something 
which will print out extents for a shape file... but no, if it does I 
haven't found it yet...

Any other suggestions as far as my immediate problem of trying to 
determine the extents of a shapefile?

Long term, I'm bummed that I can't get at the perl mapscript without a 
major hassle, 'cause I know a little Perl, but I don't know any php.  
What next?

-- Marvin




More information about the mapserver-users mailing list