[GRASS5] grass5 on darwin - problem w/init
Glynn Clements
glynn.clements at virgin.net
Tue Sep 10 11:26:44 EDT 2002
andy agena wrote:
> > 1. Do you have a libedit.a in the directory:
> >
> > /Users/andya/Desktop/grass-5_0_0_src_0/grass-5.0.0/src/libes/
> > LIB.powerpc-apple-darwin6.0?
>
> this file does exist.
[And this is confirmed by your make.log]
OK, so that isn't the problem.
> > If not, there should have been an error for src/libes/edit. OTOH, if
> > that file exists, then ...
> >
> > 2. Do you have a libedit.a, libedit.dylib, or libedit.<anything> (or,
> > for that matter, anything else which looks like a library and is
> > called something-edit-something) in /sw/lib, or in any "system"
> > library directory?
>
> my libedit.dylib was in /usr/local, so i: ln -s /usr/lib/libedit.dylib
> /sw/lib/libedit.dylib
This appears to be the problem; there is another "libedit", and that
is being used instead of the GRASS library of the same name.
The first instance of the problem is in src/general/init, when
compiling etc/set_data:
gcc
-L/Users/andyagena/Desktop/grass-5_0_0_src_0/grass-5.0.0/src/libes/LIB.powerpc-apple-darwin6.0
-L/sw/lib -o
/Users/andyagena/Desktop/grass-5_0_0_src_0/grass-5.0.0/dist.powerpc-apple-darwin6.0/etc/set_data
OBJ.powerpc-apple-darwin6.0/set_data.o
OBJ.powerpc-apple-darwin6.0/mke_mapset.o
OBJ.powerpc-apple-darwin6.0/mke_loc.o
OBJ.powerpc-apple-darwin6.0/chk_dbase.o
OBJ.powerpc-apple-darwin6.0/other.o -ledit -lgis -lvask -lncurses
-ltermcap -lz
This is presumably picking up libedit.dylib instead of GRASS'
libedit.a.
I had thought that the fact that the switch:
-L/Users/andyagena/Desktop/grass-5_0_0_src_0/grass-5.0.0/src/libes/LIB.powerpc-apple-darwin6.0
came first would ensure that any libraries found there would take
precedence, but obviously not.
It may be that the linker prefers *.dylib to *.a, regardless of
location. In which case, the only solution would be to change the
name. Try changing the corresponding lines in src/CMD/generic/make.mid
from:
DEPEDITLIB = $(LIBDIR)/libedit.a
EDITLIB = -ledit
to:
DEPEDITLIB = $(LIBDIR)/libgedit.a
EDITLIB = -lgedit
Then re-compile (you might need to run "make clean" first).
If this fixes the problem, then I really need to find out more about
the details of how linking works on MacOS X. Simply hoping that name
clashes don't occur isn't really a solution.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list