[postgis-users] compile on solaris 11 sparc

Doug McComber doug.mccomber at gmail.com
Fri Sep 2 10:02:32 PDT 2011


On 09/ 2/11 04:59 AM, Martin Spott wrote:
> As an alternative, you might try building 64-bit binaries of everything, at
> least this is what I'm doing on Solaris and the result is working properly.
> Just set an appropriate environment - I guess these should work for GCC:
>
> CC="gcc -m64"
> CXX="g++ -m64"
> CPP="gcc -m64 -E"
>
>
> Cheers,
> 	Martin.

I've got this in my profile:

    # 64 bit compiling
    CC="gcc"
    CXX="g++"
    CPP="gcc"
    CFLAGS="-m64"
    CPPFLAGS="-m64"
    CXXFLAGS="-m64"

    # 3rd party libray
    LDFLAGS="-L/usr/local/lib"

and ran source ~/.profile

Despite that I found I had to add some of that to the configure command 
(shouldn't have to log out after sourcing profile right?) like so:

    ./configure CC=gcc CFLAGS=-m64 CPPFLAGS=-m64 CXXFLAGS=-m64 
LDFLAGS=-L/usr/local/lib --with-geosconfig=/usr/local/bin/geos-config

This completes without error.  The only warnings I saw were about 
dblatex and CUnit.  The final output of configure being:

   PostGIS is now configured for sparc-sun-solaris2.11

  -------------- Compiler Info -------------
   C compiler:           gcc -m64
   C++ compiler:         g++ -m64

  -------------- Dependencies --------------
   GEOS config:          /usr/local/bin/geos-config
   GEOS version:         3.3.0
   PostgreSQL config:    /usr/postgres/9.0-pgdg/bin/64/pg_config
   PostgreSQL version:   PostgreSQL 9.0.4
   PROJ4 version:        47
   Libxml2 config:       /usr/bin/xml2-config
   Libxml2 version:      2.7.6
   PostGIS debug level:  0

  -------- Documentation Generation --------
   xsltproc:             /usr/bin/xsltproc
   xsl style sheets:
   dblatex:
   convert:              /usr/bin/convert

Make starts out well but dies with an error complaining about not 
finding SunStudio!

gcc -m64  -fPIC -DPIC  -Wall -Wmissing-prototypes  -c -o g_util.o g_util.c
gcc -m64  -fPIC -DPIC  -Wall -Wmissing-prototypes  -c -o lwgeodetic.o 
lwgeodetic.c
gcc -m64  -fPIC -DPIC  -Wall -Wmissing-prototypes  -c -o lwtree.o lwtree.c
gcc -m64  -fPIC -DPIC  -Wall -Wmissing-prototypes  -ffloat-store -c -o 
lwspheroid.o lwspheroid.c
ar rs liblwgeom.a measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o 
lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o 
lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o 
lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o 
lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o g_box.o g_coord.o 
g_geometry.o g_ptarray.o g_serialized.o g_util.o lwgeodetic.o lwtree.o 
lwspheroid.o  	
ar: creating liblwgeom.a
make[1]: Leaving directory `/home/doug/sources/postgis-1.5.3/liblwgeom'
make -C postgis
make[1]: Entering directory `/home/doug/sources/postgis-1.5.3/postgis'
/opt/studio11/SUNWspro/bin/cc -Xa -E -traditional-cpp postgis.sql.in.c | 
grep -v '^#' > postgis.sql.in
/bin/sh: line 1: /opt/studio11/SUNWspro/bin/cc: not found
make[1]: *** [postgis.sql.in] Error 1
make[1]: *** Deleting file `postgis.sql.in'
make[1]: Leaving directory `/home/doug/sources/postgis-1.5.3/postgis'
make: *** [postgis] Error 2

This is a Solaris 11 box I should mention and gcc was installed from the 
Oracle Solaris 11 repository as opposed to a 3rd-party package or from 
source.  I don't have Sun Studio installed (never did) and other 
programs compiled without problem (Proj 4 and GEOS).  This error 
"/opt/studio11/SUNWspro/bin/cc: not found" appears to be PostGIS 
specific (according to Google anyway).  Suggestions?

Thanks,
Doug



More information about the postgis-users mailing list