[Mapserver-users] GDAL/libgeotiff configure problem on Solaris 2.8/gcc 3.3

richard.roger at agric.nsw.gov.au richard.roger at agric.nsw.gov.au
Sun Nov 9 22:28:52 PST 2003


This is a multipart message in MIME format.
--=_alternative 00239949CA256DDA_=
Content-Type: text/plain; charset="us-ascii"

I have built mapserver-4.0.1 successfully (but with some trouble) on 
Solaris 2.8 using gcc 3.3.

I had already successfully built and installed libgd-2.0.15, libjpeg, 
libpng-1.2.5, libtiff-3.6.0, libgeotiff-1.2.1, libgdal-1.1.9, 
libcurl-7.10.8 but I got a "configure" error related to using gdal / ogr, 
caused by a dependence on libgeotiff.

[I have not managed to include xercesc support in GDAL, but use GDAL for 
its OGR library.  When I installed the built GDAL libraries, they went 
into the install directory as "gdal.a", "ogr.a", "ogrsf_frmts.a", and 
"libgdal.1.1.so".  Under Solaris, should the first three all be prefixed 
with "lib", please? ]

On running ./configure in my Mapserver directory (with appropriate 
options), I got this error.

configure:4664: checking whether we should include OGR support...
configure:4724: checking for OGRRegisterAll in -lgdal.1.1
configure:4743: gcc -o conftest -g -O2   conftest.c -lgdal.1.1   -lm 
-lstdc++  -L/riu/links/local/lib -lgdal.1.1 1>&5
Undefined                       first referenced
 symbol                             in file
__eprintf                           /riu/links/local/lib/libgeotiff.so
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 4732 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char OGRRegisterAll();

int main() {
OGRRegisterAll()
; return 0; }

I isolated the "conftest.c" program
#line 4732 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char OGRRegisterAll();

int main() {
OGRRegisterAll()
; return 0; }

and built it with the "gcc" command above.  It failed, of course.

The build failed, too, with the simpler command :

gcc -o conftest conftest.c -lgdal.1.1

but it succeeded with

gcc -o conftest conftest.c -lgdal.1.1 -lgeotiff

The "-lgdal.1.1" is essentially the library switch that is reported by the 
installed "gdal-config".

I'm not sure whether this error is because "configure" is not correctly 
set up, or whether this is to do with the dependence of "gdal" on 
libtiff/libgeotiff, or a mistake on my part.

I have worked around this problem by changing line 4721 of "configure" 
from

LIBS="$LIBS `$GDAL_CONFIG --libs`"

to

LIBS="$LIBS `$GDAL_CONFIG --libs` -lgeotiff"

"configure" now runs to completion, and builds a "Makefile" which works. 

I hope this information might be of use to others.  Any ideas for a 
permanent fix to "configure" would be welcomed, I'm sure.

Regards

Richard E. Roger

Dr. R. E. Roger                         NSW Agriculture
Spatial Information Officer Systems                161 Kite St
Resource Information Unit                   Locked Bag 21
                                        ORANGE NSW 2800
                                                Australia
ph: +61 2 6391 3697                      fax: +61 2 6391 3740

This message is intended for the addressee named and may contain 
confidential information. If you are not the intended recipient or 
received it in error, please delete the message and notify sender. Views 
expressed are those of the individual sender and are not necessarily the 
views of their organisation.
--=_alternative 00239949CA256DDA_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">I have built mapserver-4.0.1 successfully (but with some trouble) on Solaris 2.8 using gcc 3.3.</font>
<br>
<br><font size=2 face="sans-serif">I had already successfully built and installed libgd-2.0.15, libjpeg, libpng-1.2.5, libtiff-3.6.0, libgeotiff-1.2.1, libgdal-1.1.9, libcurl-7.10.8 but I got a "configure" error related to using gdal / ogr, caused by a dependence on libgeotiff.</font>
<br>
<br><font size=2 face="sans-serif">[I have not managed to include xercesc support in GDAL, but use GDAL for its OGR library.  When I installed the built GDAL libraries, they went into the install directory as "gdal.a", "ogr.a", "ogrsf_frmts.a", and "libgdal.1.1.so".  Under Solaris, should the first three all be prefixed with "lib", please? ]</font>
<br>
<br><font size=2 face="sans-serif">On running ./configure in my Mapserver directory (with appropriate options), I got this error.</font>
<br>
<br><font size=2 face="Courier">configure:4664: checking whether we should include OGR support...</font>
<br><font size=2 face="Courier">configure:4724: checking for OGRRegisterAll in -lgdal.1.1</font>
<br><font size=2 face="Courier">configure:4743: gcc -o conftest -g -O2   conftest.c -lgdal.1.1   -lm -lstdc++  -L/riu/links/local/lib -lgdal.1.1 1>&5</font>
<br><font size=2 face="Courier">Undefined                        first referenced</font>
<br><font size=2 face="Courier"> symbol                              in file</font>
<br><font size=2 face="Courier">__eprintf                           /riu/links/local/lib/libgeotiff.so</font>
<br><font size=2 face="Courier">ld: fatal: Symbol referencing errors. No output written to conftest</font>
<br><font size=2 face="Courier">collect2: ld returned 1 exit status</font>
<br><font size=2 face="Courier">configure: failed program was:</font>
<br><font size=2 face="Courier">#line 4732 "configure"</font>
<br><font size=2 face="Courier">#include "confdefs.h"</font>
<br><font size=2 face="Courier">/* Override any gcc2 internal prototype to avoid an error.  */</font>
<br><font size=2 face="Courier">/* We use char because int might match the return type of a gcc2</font>
<br><font size=2 face="Courier">    builtin and then its argument prototype would still apply.  */</font>
<br><font size=2 face="Courier">char OGRRegisterAll();</font>
<br>
<br><font size=2 face="Courier">int main() {</font>
<br><font size=2 face="Courier">OGRRegisterAll()</font>
<br><font size=2 face="Courier">; return 0; }</font>
<br>
<br><font size=2 face="sans-serif">I isolated the "conftest.c" program</font>
<br><font size=2 face="Courier">#line 4732 "configure"</font>
<br><font size=2 face="Courier">#include "confdefs.h"</font>
<br><font size=2 face="Courier">/* Override any gcc2 internal prototype to avoid an error.  */</font>
<br><font size=2 face="Courier">/* We use char because int might match the return type of a gcc2</font>
<br><font size=2 face="Courier">    builtin and then its argument prototype would still apply.  */</font>
<br><font size=2 face="Courier">char OGRRegisterAll();</font>
<br>
<br><font size=2 face="Courier">int main() {</font>
<br><font size=2 face="Courier">OGRRegisterAll()</font>
<br><font size=2 face="Courier">; return 0; }</font>
<br>
<br><font size=2 face="sans-serif">and built it with the "gcc" command above.  It failed, of course.</font>
<br>
<br><font size=2 face="sans-serif">The build failed, too, with the simpler command :</font>
<br>
<br><font size=2 face="Courier">gcc -o conftest conftest.c -lgdal.1.1</font>
<br>
<br><font size=2 face="sans-serif">but it succeeded with</font>
<br>
<br><font size=2 face="Courier">gcc -o conftest conftest.c -lgdal.1.1 -lgeotiff</font>
<br>
<br><font size=2 face="sans-serif">The "-lgdal.1.1" is essentially the library switch that is reported by the installed "gdal-config".</font>
<br>
<br><font size=2 face="sans-serif">I'm not sure whether this error is because "configure" is not correctly set up, or whether this is to do with the dependence of "gdal" on libtiff/libgeotiff, or a mistake on my part.</font>
<br>
<br><font size=2 face="sans-serif">I have worked around this problem by changing line 4721 of "configure" from</font>
<br>
<br><font size=2 face="Courier">LIBS="$LIBS `$GDAL_CONFIG --libs`"</font>
<br>
<br><font size=2 face="sans-serif">to</font>
<br>
<br><font size=2 face="Courier">LIBS="$LIBS `$GDAL_CONFIG --libs` -lgeotiff"</font>
<br>
<br><font size=2 face="sans-serif">"configure" now runs to completion, and builds a "Makefile" which works.  </font>
<br>
<br><font size=2 face="sans-serif">I hope this information might be of use to others.  Any ideas for a permanent fix to "configure" would be welcomed, I'm sure.</font>
<br>
<br><font size=2 face="sans-serif">Regards</font>
<br>
<br><font size=2 face="sans-serif">Richard E. Roger</font>
<br>
<br><font size=2 face="sans-serif">Dr. R. E. Roger                                NSW Agriculture<br>
Spatial Information Officer Systems                   161 Kite St<br>
Resource Information Unit                    Locked Bag 21<br>
                                        ORANGE NSW 2800</font>
<br><font size=2 face="sans-serif">                                                Australia<br>
ph: +61 2 6391 3697                         fax: +61 2 6391 3740<br>
<br>
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient or received it in error, please delete the message and notify sender. Views expressed are those of the individual sender and are not necessarily the views of their organisation.</font>
--=_alternative 00239949CA256DDA_=--



More information about the MapServer-users mailing list