In the end, I made an upgrade to PostgreSQL 8.3 and clean installations of PostGIS and related libraries using binary packages. It still required some manual fixing of paths but I managed to get it going in the end.
Thanks. On Feb 27, 1:33 pm, Graham Dumpleton <graham.dumple...@gmail.com> wrote: > On Feb 27, 10:23 pm, "omat * gezgin.com" <o...@gezgin.com> wrote: > > > 'file' for liblwgeom.so and two of it dependencies (libgeos_c.1.dylib > > and libproj.0.dylib) reveals they are built only for i386. > > > Is this ok or should it be x86_64? as I built from source, how come > > they are built for the wrong architecture, if so? > > Hmmm, I think I have got a bit confused here and assumed that these > libraries were getting used by Python modules. > > In your original post you actually say you are running 'psql' when you > have the problem. Is that correct? > > If so, the issue is probably that 'psql' has x86_64 and so running as > that, but libraries it then uses aren't. > > What does 'file' on 'psql' yield? > > If you invoke 'psql' via the 'arch' program to force it to run as 32 > bit does it work. Ie., > > /usr/bin/arch -i386 psql ......... > > Replace '.....' with your options as appropriate. > > Graham > > > Thanks, > > omat > > > On Feb 27, 11:16 am, Graham Dumpleton <graham.dumple...@gmail.com> > > wrote: > > > > On Feb 27, 8:13 pm, "omat* gezgin.com" <o...@gezgin.com> wrote: > > > > > I am using the django's built-in development server. > > > > Odd then. > > > > All I can suggest is to run: > > > > otool -L /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so > > > > This will tell you want other libraries that is dependent upon. Then > > > run 'file' on any which are standard OS libraries/frameworks and > > > ensure that all those also have i386. Then repeat otool/file for each > > > of those in turn, until check the whole graph of dependent libraries > > > to see whether they have the correct architecture. > > > > Graham > > > > > Thanks. > > > > > On Feb 27, 12:48 am, Graham Dumpleton <graham.dumple...@gmail.com> > > > > wrote: > > > > > > On Feb 27, 12:29 am, "omat* gezgin.com" <o...@gezgin.com> wrote: > > > > > > > Thanks for the pointer. > > > > > > > But I checked the architecture of the liblwgeom.so with 'file' and > > > > > > the > > > > > > result is: > > > > > > /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so: Mach-O bundle > > > > > > i386 > > > > > > > which is the correct architecture for my Intel based macbook pro. > > > > > > But how is your application being run in the first place? A MacBook > > > > > Pro has 64 bit Intel CPU. If you are running with mod_wsgi or > > > > > mod_python under operating system supplied Apache, then because Apache > > > > > will run as 64 bit, all the libraries etc have to be available as 64 > > > > > bit as well. > > > > > > So, explain how Python gets run. Are you running command line Python > > > > > to see this error, running Django under Apache. > > > > > > Graham > > > > > > > I am lost. > > > > > > > On Feb 26, 1:25 pm, Graham Dumpleton <graham.dumple...@gmail.com> > > > > > > wrote: > > > > > > > > On Feb 26, 10:07 pm,omat<o...@gezgin.com> wrote: > > > > > > > > > Hi all, > > > > > > > > > Following the instructions on > > > > > > > > inhttp://geodjango.org/docs/install.html, > > > > > > > > i managed to get to "Creating a Spatial Database Template" > > > > > > > > section. > > > > > > > > > But when trying to execute the line below (as postgres user of > > > > > > > > course): > > > > > > > > $ psql -d template_postgis -f `pg_config > > > > > > > > --sharedir`/lwpostgis.sql > > > > > > > > > it complained that it cannot find "liblwgeom". > > > > > > > > > I found the lwpostgis.sql under directory: > > > > > > > > /usr/local/pgsql_saved_0804141532/share/ > > > > > > > > which does not look very right. I examined the file and it has: > > > > > > > > ... > > > > > > > > CREATE OR REPLACE FUNCTION histogram2d_in(cstring) > > > > > > > > RETURNS histogram2d > > > > > > > > AS '$libdir/liblwgeom', 'lwhistogram2d_in' > > > > > > > > LANGUAGE 'C' IMMUTABLE STRICT; -- WITH (isstrict); > > > > > > > > ... > > > > > > > > > $libdir shell variable is ''. I located the liblwgeom.so which > > > > > > > > is > > > > > > > > refered in the sql file here: > > > > > > > > /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so > > > > > > > > > When I tried to run the sql command above on the > > > > > > > > template_postgis db, > > > > > > > > fixing the paths manually, I get: > > > > > > > > > ERROR: could not load library > > > > > > > > "/usr/local/pgsql_saved_0804141532/lib/ > > > > > > > > liblwgeom.so": dlopen(/usr/local/pgsql_saved_0804141532/lib/ > > > > > > > > liblwgeom.so, 10): no suitable image found. Did find: > > > > > > > > /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so: > > > > > > > > mach-o, but wrong > > > > > > > > architecture > > > > > > > > > Can it be that a conflicting version already existed and caused > > > > > > > > problems? Or what? > > > > > > > > > I took the "build from source" path as instructed in the install > > > > > > > > documentation. I am using PostgreSQL 8.2 / PostGIS 1.3.5 on Mac > > > > > > > > OS X > > > > > > > > Leopard (10.5.6) > > > > > > > > Read: > > > > > > > > http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX > > > > > > > > Various sections in this cover aspects of this problem which > > > > > > > would be > > > > > > > relevant, even if you aren't usingmod_wsgi. > > > > > > > > It is all because MacOS X can run on different architectures. > > > > > > > That is, > > > > > > > PPC and Intel, plus 32 bit and 64 bit variants of same. Your > > > > > > > library > > > > > > > doesn't have required architecture for what application that is > > > > > > > using > > > > > > > it is running as. > > > > > > > > Use 'file' command on the library to work out what architectures > > > > > > > it > > > > > > > does provide. You then need to recompile stuff so it also includes > > > > > > > other architectures that may be required. > > > > > > > > There are some pointers in that document about how to compile for > > > > > > > all > > > > > > > architectures. > > > > > > > > Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---