[gdal-dev] Building gdal on solaris 11

Andrew Watkins andrew at dcs.bbk.ac.uk
Mon Jun 27 07:38:49 PDT 2016


On 06/27/16 12:50, Even Rouault wrote:
> Le lundi 27 juin 2016 12:44:07, Andrew Watkins a écrit :
>> Hello,
>>
>> I am trying to build postgis on Solaris 11, but having problems with
>> gdal part.
>>
>> I have seen people have said they have compiled it, but worst luck they
>> have never given any details.
>>
>> I have tried old and new versions but no luck. Any ideas?
>>
>> gdal 2.1.0
>> ==========
>> # CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" ./configure
>> # gmake
>>
>> libtool: compile:  g++ -I/export/src/databases/gdal-2.1.0/port
>> -I/export/src/databases/gdal-2.1.0/gcore
>> -I/export/src/databases/gdal-2.1.0/alg
>> -I/export/src/databases/gdal-2.1.0/ogr
>> -I/export/src/databases/gdal-2.1.0/ogr/ogrsf_frmts
>> -I/export/src/databases/gdal-2.1.0/gnm
>> -I/export/src/databases/gdal-2.1.0/apps -m64 -Wall -Wextra -Winit-self
>> -Wunused-parameter -Wformat -Werror=format-security
>> -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla
>> -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual
>> -fno-operator-names -DLERC -I libLERC
>> -I/export/src/databases/gdal-2.1.0/port
>> -I/export/src/databases/gdal-2.1.0/gcore
>> -I/export/src/databases/gdal-2.1.0/alg
>> -I/export/src/databases/gdal-2.1.0/ogr
>> -I/export/src/databases/gdal-2.1.0/ogr/ogrsf_frmts
>> -I/export/src/databases/gdal-2.1.0/gnm
>> -I/export/src/databases/gdal-2.1.0/apps -DOGR_ENABLED
>> -I/export/src/databases/gdal-2.1.0/port -DGDAL_COMPILATION -c
>> marfa_dataset.cpp  -fPIC -DPIC -o ../o/.libs/marfa_dataset.o
>> marfa_dataset.cpp: In member function 'CPLXMLNode*
>> GDAL_MRF::GDALMRFDataset::BuildConfig()':
>> marfa_dataset.cpp:1072:14: error: expected unqualified-id before numeric
>> constant
>> marfa_dataset.cpp:1072:14: error: expected initializer before numeric
>> constant
>> marfa_dataset.cpp:1074:66: error: invalid conversion from 'int' to
>> 'CPLXMLNode*'
>> marfa_dataset.cpp:1074:66: error:   initializing argument 1 of
>> 'CPLXMLNode* CPLCreateXMLElementAndValue(CPLXMLNode*, const char*, const
>> char*)'
> Interesting... Wondering if "CS" might not be defined in a Solaris header.
> could you try replacing CS at line 1072 and 1074 of
> frmts/mrf/marfa_dataset.cpp with "cachedSource" for example ?
>
> So :
> 	CPLXMLNode *cachedSource = CPLCreateXMLNode(config, CXT_Element,
> "CachedSource");
> 	// Should wrap the string in CDATA, in case it is XML
> 	CPLXMLNode *S = CPLCreateXMLElementAndValue(cachedSource, "Source",
> source);
>
> You can also disable the MRF driver with ./configure --without-mrf
>
>
>> gmake[2]: *** [../o/marfa_dataset.lo] Error 1
>> gmake[2]: Leaving directory `/export/src/databases/gdal-2.1.0/frmts/mrf'
>> gmake[1]: *** [mrf-install-obj] Error 2
>> gmake[1]: Leaving directory `/export/src/databases/gdal-2.1.0/frmts'
>> gmake: *** [frmts-target] Error 2
>>
>>
>> gdal 1.11.4
>> ===========
>> # CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" ./configure
>> # gmake
>>
>> /bin/sh /export/src/databases/gdal-1.11.4/libtool --mode=compile
>> --tag=CC gcc -m64 -DHAVE_SSE_AT_COMPILE_TIME  -Wall
>> -Wdeclaration-after-statement -I/export/src/databases/gdal-1.11.4/port
>> -I/export/src/databases/gdal-1.11.4/gcore
>> -I/export/src/databases/gdal-1.11.4/alg
>> -I/export/src/databases/gdal-1.11.4/ogr
>> -I/export/src/databases/gdal-1.11.4/ogr/ogrsf_frmts
>> -I/export/src/databases/gdal-1.11.4/frmts/vrt -DOGR_ENABLED
>> -I/export/src/databases/gdal-1.11.4/port  -c -o gdalserver.lo gdalserver.c
>> libtool: compile:  gcc -m64 -DHAVE_SSE_AT_COMPILE_TIME -Wall
>> -Wdeclaration-after-statement -I/export/src/databases/gdal-1.11.4/port
>> -I/export/src/databases/gdal-1.11.4/gcore
>> -I/export/src/databases/gdal-1.11.4/alg
>> -I/export/src/databases/gdal-1.11.4/ogr
>> -I/export/src/databases/gdal-1.11.4/ogr/ogrsf_frmts
>> -I/export/src/databases/gdal-1.11.4/frmts/vrt -DOGR_ENABLED
>> -I/export/src/databases/gdal-1.11.4/port -c gdalserver.c  -fPIC -DPIC -o
>> .libs/gdalserver.o
>> In file included from /usr/include/stdio.h:15:0,
>>                    from
>> /export/src/databases/gdal-1.11.4/port/cpl_port.h:144,
>>                    from gdalserver.c:33:
>> /usr/include/sys/feature_tests.h:358:2: error: #error "Compiler or
>> options invalid; UNIX 03 and POSIX.1-2001 applications     require the
>> use of c99"
>> gmake[1]: *** [gdalserver.lo] Error 1
>> gmake[1]: Leaving directory `/export/src/databases/gdal-1.11.4/apps'
>> gmake: *** [apps-target] Error 2
> I see that in GDAL 2.1.0, I've done a related fix :
> https://trac.osgeo.org/gdal/changeset/32152 . I guess this was before the
> inclusion of the MRF driver.
>
>>
>>
>> Thanks,
>>
>> Andrew

That worked like a dream!

> Interesting... Wondering if "CS" might not be defined in a Solaris header.
> could you try replacing CS at line 1072 and 1074 of
> frmts/mrf/marfa_dataset.cpp with "cachedSource" for example ?
>
> So :
> 	CPLXMLNode *cachedSource = CPLCreateXMLNode(config, CXT_Element,
> "CachedSource");
> 	// Should wrap the string in CDATA, in case it is XML
> 	CPLXMLNode *S = CPLCreateXMLElementAndValue(cachedSource, "Source",
> source);
Replacing "CS" with "cachedSource" solved the problem.

Cheers.

Andrew

-- 
Andrew Watkins * Birkbeck, University of London * Computer Science *
* http://notallmicrosoft.blogspot.com *
* UKOUG Systems SIG Chair *
* UKOUG Tech committee *
* tel: 020 7631 6720 *

  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160627/f8e74121/attachment.html>


More information about the gdal-dev mailing list