[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
Mon Nov 10 01:28:52 EST 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 &quot;configure&quot; 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. &nbsp;When I installed the built GDAL libraries, they went into the install directory as &quot;gdal.a&quot;, &quot;ogr.a&quot;, &quot;ogrsf_frmts.a&quot;, and &quot;libgdal.1.1.so&quot;. &nbsp;Under Solaris, should the first three all be prefixed with &quot;lib&quot;, 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 &nbsp; conftest.c -lgdal.1.1 &nbsp; -lm -lstdc++ &nbsp;-L/riu/links/local/lib -lgdal.1.1 1&gt;&amp;5</font>
<br><font size=2 face="Courier">Undefined &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;first referenced</font>
<br><font size=2 face="Courier">&nbsp;symbol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;in file</font>
<br><font size=2 face="Courier">__eprintf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /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 &quot;configure&quot;</font>
<br><font size=2 face="Courier">#include &quot;confdefs.h&quot;</font>
<br><font size=2 face="Courier">/* Override any gcc2 internal prototype to avoid an error. &nbsp;*/</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">&nbsp; &nbsp; builtin and then its argument prototype would still apply. &nbsp;*/</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 &quot;conftest.c&quot; program</font>
<br><font size=2 face="Courier">#line 4732 &quot;configure&quot;</font>
<br><font size=2 face="Courier">#include &quot;confdefs.h&quot;</font>
<br><font size=2 face="Courier">/* Override any gcc2 internal prototype to avoid an error. &nbsp;*/</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">&nbsp; &nbsp; builtin and then its argument prototype would still apply. &nbsp;*/</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 &quot;gcc&quot; command above. &nbsp;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 &quot;-lgdal.1.1&quot; is essentially the library switch that is reported by the installed &quot;gdal-config&quot;.</font>
<br>
<br><font size=2 face="sans-serif">I'm not sure whether this error is because &quot;configure&quot; is not correctly set up, or whether this is to do with the dependence of &quot;gdal&quot; 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 &quot;configure&quot; from</font>
<br>
<br><font size=2 face="Courier">LIBS=&quot;$LIBS `$GDAL_CONFIG --libs`&quot;</font>
<br>
<br><font size=2 face="sans-serif">to</font>
<br>
<br><font size=2 face="Courier">LIBS=&quot;$LIBS `$GDAL_CONFIG --libs` -lgeotiff&quot;</font>
<br>
<br><font size=2 face="sans-serif">&quot;configure&quot; now runs to completion, and builds a &quot;Makefile&quot; which works. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">I hope this information might be of use to others. &nbsp;Any ideas for a permanent fix to &quot;configure&quot; 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 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NSW Agriculture<br>
Spatial Information Officer Systems &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 161 Kite St<br>
Resource Information Unit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Locked Bag 21<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ORANGE NSW 2800</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Australia<br>
ph: +61 2 6391 3697 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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