[Mapserver-users] dynamic libraries and LDPATH

Madere, Colin colin.madere at ieminc.com
Thu Feb 20 18:30:14 EST 2003


I'm on Solaris 8, no such LD config file :)

I've got mapserv CGI to run by wrapping it in a shell script that sets
LD_LIBRARY_PATH for the .so it was looking for, however, with PHP and
Mapscript it is a .so that loads a .so that loads a .so :)  LD_LIBRARY_PATH
is not a solution there so I have to figure out how to get the linker to set
the paths to the shared objects that the php_mapscript.so needs.


> -----Original Message-----
> From:	Madere, Colin 
> Sent:	Thursday, February 20, 2003 5:29 PM
> To:	'lehrs at erau.edu'
> Subject:	RE: [Mapserver-users] dynamic libraries and LDPATH
> 
> I'm on Solaris 8, no such LD config file :)
> 
> I've got mapserv CGI to run by wrapping it in a shell script that sets
> LD_LIBRARY_PATH for the .so it was looking for, however, with PHP and
> Mapscript it is a .so that loads a .so that loads a .so :)
> LD_LIBRARY_PATH is not a solution there so I have to figure out how to get
> the linker to set the paths to the shared objects that the
> php_mapscript.so needs.
> 
> 	-----Original Message-----
> 	From:	lehrs at erau.edu [SMTP:lehrs at erau.edu]
> 	Sent:	Thursday, February 20, 2003 5:26 PM
> 	To:	Madere, Colin
> 	Subject:	RE: [Mapserver-users] dynamic libraries and LDPATH
> 
> 	Not sure if this will help,... tryp this
> 
> 	Look for the path that is listed.
> 	Then make sure this path is part of your runtime library path,
> 	for this you have two options, assuming you're running Linux:
> 
> 	AS ROOT
> 	1- add the path to the .so to the file /etc/ld.so.conf and run
> 'ldconfig' as
> 	root
> 
> 	or
> 
> 	This is from
> 	http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptBuild35
> 
> 
> 	-----Original Message-----
> 	From: mapserver-users-admin at lists.gis.umn.edu
> 	[mailto:mapserver-users-admin at lists.gis.umn.edu]On Behalf Of Madere,
> 	Colin
> 	Sent: Thursday, February 20, 2003 6:18 PM
> 	To: mapserver-users at lists.gis.umn.edu
> 	Subject: [Mapserver-users] dynamic libraries and LDPATH
> 
> 
> 	So I get an error trying to use Mapscript because when the .so is
> loaded by
> 	PHP it can't find the libwwwxml.so.0 (turning error output on shows
> the
> 	typical ld.so error when it can't find a library).  I've been
> through _tons_
> 	of these issues and have made things work by setting LD_LIBRARY_PATH
> (yes, I
> 	know this isn't the best solution but for my testing environment I
> was ok
> 	with it).
> 
> 	This does not, however, work for things that don't get the shell or
> user
> 	environment variables like CGIs or in this case a cgi that loads a
> library
> 	that loads a library :)
> 
> 	So I found out that setting LDFLAGS = -R<location of libs> would
> instruct
> 	the linker to link in the library paths so that runtime resolution
> wasn't
> 	necessary.  Considering the likely situation this stuff is to be
> used, I
> 	won't be changing where the libraries reside so this works for me.
> 	Unfortunately the configure/Makefile setup for Mapserver appears to
> use this
> 	variable only when checking compiler options for configuring and
> doesn't
> 	actually include it (LDFLAGS) when it compiles and links the project
> 	libraries and executables.
> 
> 	Looking at Makefile.in I see an LDFLAGS being set but it does not
> appear to
> 	check (or I couldn't find it in configure or the Makefile.in) for an
> 	environment LDFLAGS to add to this so any environment set LDFLAGS
> gets
> 	ignored.
> 
> 	Editing the Makefile after running configure to include my "-R<lib
> dir>"
> 	option in the LDFLAGS variable gets it in the linking commands and
> moves me
> 	to the next library error because another .so (not in that dir) can
> be
> 	found.  If I add that dir to the end prefixed with the separating :,
> the
> 	error remains so I'm a bit stuck.  Someone who knows a lot about the
> build
> 	process might check into the use of the environment LDFLAGS var in
> the
> 	configure/build for when the actual build process is happening,
> rather than
> 	just for the configure compiler checks...
> 
> 	It seems that LDFLAGS isn't being checked or used at all in the
> Mapscript
> 	stuff (which is my current problem).. is that maintained solely by
> the
> 	MapLab people?  Should I use that mailing list for compile/build
> issues with
> 	Mapscript?
> 
> 	Fighting to get all this running,
> 
> 	Colin
> 
> 	_______________________________________________
> 	Mapserver-users mailing list
> 	Mapserver-users at lists.gis.umn.edu
> 	http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list