[Gdal-dev] Error compiling gdal against mrsid dsdk on solaris

Julien Demaria dem at acri-st.fr
Thu Apr 13 11:05:37 EDT 2006


Hi,

My advice is to compile ALL your .c or .cpp using -fPIC, including all 
GDAL sources. So you have to recompile completely GDAL.

I successfully compiled GDAL with MRSID DSDK support but with 
Geo_DSDK-4.0.10.720 and gcc 2.95 (I'll test with the new DSDK gcc 3.2.3 
when I'll have time...) using these tips:
	- configure GDAL with --without-libtool (because I don't want rpath, 
and maybe for other things but I don't remember)
	- then change in GDALmake.opt these two variables to:
		PY_LD_SHARED = $(CXX) -shared
                 LD_SHARED    = $(CXX) -shared
	  to enable shared library
	- and then make all


Documentation is here:

Geo_DSDK-5.0.6.955/doc

and you can see in Geo_DSDK-5.0.6.955/doc/PLATFORMS.txt:

"
UNIX-SPECIFIC ISSUES
--------------------

  * LizardTech libraries and applications are built with certain 
compiler and
    linker flags set.  Please see the file examples/src/makefile for sample
    compile and link lines.  Your environment may require modifications to
    these settings.  Please be aware that:
      - we use fPIC/kPIC
      - we use -D_REENTRANT
      - if you are linking with GDAL, e.g. to use the supplied TIFF, JPG, or
        NITF support, you may need to link with -ldl
      - we use -lpthreads
"

and in Geo_DSDK-5.0.6.955/examples/src/makefile:

"
ifeq ($(LTI_TARGET),sparc-sun-solaris2.8)
   # solaris / sparc for gcc 2.95
   OS_CXX_FLAGS = -fPIC -O3
   OS_LD_FLAGS  = -lpthread -lrt
endif

ifeq ($(LTI_TARGET),solaris.sparc.sunpro)
   CXX=/opt/SUNWspro/bin/CC
   OS_CXX_FLAGS = -KPIC -xO3
   OS_LD_FLAGS  = -lpthread -lrt -lCrun -ldl
endif

ifeq ($(LTI_TARGET),solaris.sparc.gcc32)
   # solaris / sparc for gcc 3.2.3
   CXX=/usr/local/tools/gcc/3.2.3/bin/g++
   OS_CXX_FLAGS = -fPIC -O3
   OS_LD_FLAGS  = -lpthread -lrt
endif
"


Regards,

Julien


H.Porath at hzd.hessen.de a écrit :
> Hi Julien,
> 
> thanks for the hint, but unfortunately it did not work. We got the same error. Do you have other ideas regarding compile flags? Why do you know how MrSID SDK was compiled? Is there a documentation?
> 
> Regards,
> 
> Holger
> 
> -----Ursprüngliche Nachricht-----
> Von: Julien Demaria [mailto:dem at acri-st.fr] 
> Gesendet: Mittwoch, 12. April 2006 18:08
> An: Porath, Holger (HZD)
> Cc: gdal-dev at lists.maptools.org
> Betreff: Re: [Gdal-dev] Error compiling gdal against mrsid dsdk on solaris
> 
> 
> Hi,
> 
> I believe you have a PIC problem, you should add the -fPIC flag to gcc 
> for compiling all your .c and .cpp, because MrSID SDK is compiled with 
> -fPIC.
> 
> Regards,
> 
> Julien



More information about the Gdal-dev mailing list