RSGISLIB on Windows

285 views
Skip to first unread message

Jose Bengoa

unread,
Mar 17, 2015, 10:02:02 AM3/17/15
to rsgislib...@googlegroups.com
Hi,

I'm trying to install RSGISLIB on Windows and I'm having some issues. One of them is related to KEA lib and its use with GDAL.

I have already built binaries of KEA lib, obtaining libkea.dll, libkea.lib and libkea.exp (in src\Release) and binaries for GDAL (gdal_KEA.dll, gdal_KEA.lib and gdal_KEA.exp in gdal\Release). I've compiled with Visual Studio (2010 + SP1) and after installling HDF5 format and using CMake for creating the project for Visual Studio.

Then I've copied output files under gdal/Release to gdal\gdalplugins directory (gdal = GDAL directory) to enable KEA support. I've also tried to copy those files to C:\OSGeo\bin\gdalplugins and others directories.

The issue comes here: when try /> gdalinfo --versions, the list of formats suported by gdal does not include KEA format.
I've already built GDAL with ECW suport modifiying the Visual Studio project file to allow GDAL to support this format (uncommenting ECWDIR, ECWFLAGS, ECWLIB, ECW_PLUGIN = YES) and copied gdal_ECW_JP2ECW.dll to \gdalplugins directory, but I don't know if I must also change something in Visual Studio project to compile GDAL with KEA suport.

Nota: Next step will be to make it available for Python.

I don't know what I am missing or doing wrong. Any help?

Thank you

Jose Bengoa

Pete Bunting [pfb]

unread,
Mar 17, 2015, 10:51:38 AM3/17/15
to Jose Bengoa, rsgislib...@googlegroups.com
Hi Jose,

Try defining the GDAL_DRIVER_PATH environmental variable to the location of the GDAL driver. Alternatively, you could try downloading the gisinternals dev builds for GDAL that have recently included KEA already installed; this was paid for by Landcare Research, NZ. http://www.gisinternals.com/development.php

Best wishes,

Pete
> --
> You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
> To post to this group, send email to rsgislib...@googlegroups.com.
> Visit this group at http://groups.google.com/group/rsgislib-support.
> For more options, visit https://groups.google.com/d/optout.



****************************************************
* Dr Pete Bunting
* Senior Lecturer in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK
*
* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************

Jose Bengoa

unread,
Mar 19, 2015, 10:00:37 AM3/19/15
to rsgislib...@googlegroups.com, jben...@gmail.com, p...@aber.ac.uk
Thank you Pete, after trying different options the conclusion is that the problem was related to Windows environmental variables and compatibility of gdal version and KEALib. With gdal 2.00 it worked (binary distribution of GisInternals). I have not been able to load gdal_KEA.dll with gdal 1.11.2.

For python bindings I've also found some problems, probably related with path, but I'm not sure: at first it didn't worked, but after deleting some entries in the path and Environmental variables and writing them back it worked.

I included gdal instalation directory in first place in path (Windows environmenta variable), GDAL_DRIVER_PATH in System Variables and asigned PYTHONPATH only to my first instalation of python (C:\python27) but not to C:\OSGEO4W.

Thank you!

Pete Bunting [pfb]

unread,
Mar 19, 2015, 10:30:40 AM3/19/15
to Jose Bengoa, rsgislib...@googlegroups.com
Hi Jose, 

So it’s all compiled and working then? I’d recommend keeping an eye on the commit log via bitbucket as we do post fixes and new functions quite regularly. 

Great, let us know how you get on with it. 

Best wishes, 

Pete

****************************************************
* Dr Pete Bunting
* Senior Lecturer in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK

* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************

Jose Bengoa

unread,
Mar 21, 2015, 9:11:49 AM3/21/15
to rsgislib...@googlegroups.com, jben...@gmail.com, p...@aber.ac.uk
In the end I installed gdal 2.00 dev  from GisInternals (Windows binaries) because I was not able to use KEA lib with gdal 1.11.2.

I think that this problem comes from the Visual Studio (VS) versions used for compiling the different requirements. In case my experience is useful for somebody, I explain what I've done:

Following the instructions of KEA lib, I compiled it with Visual Studio 2010 Express + SP1 (although I wanted VS2008 for better compatibility with python27, it wasn't possible to compile KEA lib with VS2008). One of the requirements for KEALib is HDF5, but the binary of this library are available only for VS2012 and VS2013. There are sources available but the files needed to compile it are only for VS2012 and VS2013 (I used the VS2012 version).

Compilation of KeaLib runned apparently fine and gdal can read gdal_KEA.dll and this format is listed properly with >gdalinfo --formats. But when I try to read a KEA file (e.g. >gdalinfo N06W053_PALSAR_07_HH_utm.kea) it shows information about this file and then apears suddenly a Window from Microsoft Windows saying that gdalinfo.exe stopped working.

Trying to use KEA from python, I obtain similar results: I import gdal properly, and when I try to open a KEA file with gdal.Open(), Windows shows an error message and closes python.exe.

I arrived to the conclusion that the problem came from the compatibility of libraries compiled with different versions of Visual Studio but I don't remember now why I concluded this...

Best wishes, 

Jose

To post to this group, send email to rsgisli...@googlegroups.com.

Jose Bengoa

unread,
Mar 21, 2015, 10:11:40 AM3/21/15
to rsgislib...@googlegroups.com, jben...@gmail.com, p...@aber.ac.uk
I must correct myself: the problem with reading KEA files came from the version of HDF5. After changing from the one installed (1.8.14) to the one that must be used (1.8.12), Kea lib works with gdal 1.11.2 (compiled from sources with Visual Studio 2010).

Jose Bengoa

unread,
Mar 23, 2015, 8:51:05 AM3/23/15
to rsgislib...@googlegroups.com, jben...@gmail.com, p...@aber.ac.uk
Hello, once solved all the pre-requirements, I've compiled RSGISLib on Windows (with Visual Studio 2010 + SP1).

The output showed four fatal errors corresponding to four projects (out of 16 that includes the RSGISLib). The type of problem is the same in all of them:
  rsgislib\src\Release\rsgis_img.dll : fatal error LNK1169: one or more multiply defined symbols found
  rsgislib\src\Release\rsgis_vec.dll : fatal error LNK1169: one or more multiply defined symbols found
  rsgislib\src\Release\rsgis_modeling.dll : fatal error LNK1169: one or more multiply defined symbols found
  rsgislib\src\Release\rsgis_radar.dll : fatal error LNK1169: one or more multiply defined symbols found

These errors come after different errors building .obj in each project. For example, in rsgis_img.dll I get this:

------ Build started: Project: rsgis_img, Configuration: Release Win32 ------
rsgis_utils.lib(RSGISGEOSFactoryGenerator.obj) : error LNK2005: "public: static class rsgis::utils::RSGISGEOSFactoryGenerator * __cdecl rsgis::utils::RSGISGEOSFactoryGenerator::getInstance(void)" (?getInstance@RSGISGEOSFactoryGenerator@utils@rsgis@@SAPAV123@XZ) already defined in rsgis_geom.lib(rsgis_geom.dll)
rsgis_utils.lib(RSGISGEOSFactoryGenerator.obj) : error LNK2005: "public: class geos::geom::GeometryFactory * __thiscall rsgis::utils::RSGISGEOSFactoryGenerator::getFactory(void)" (?getFactory@RSGISGEOSFactoryGenerator@utils@rsgis@@QAEPAVGeometryFactory@geom@geos@@XZ) already defined in rsgis_geom.lib(rsgis_geom.dll)
     Creating library G:/_App/rsgislib/src/Release/rsgis_img.lib and object G:/_App/rsgislib/src/Release/rsgis_img.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
G:\_App\rsgislib\src\Release\rsgis_img.dll : fatal error LNK1169: one or more multiply defined symbols found


Any help to solve this?


Besides this, there are some warnings (form many .cpp) like:
  math\RSGISIntergration.cpp(135): warning C4554: '|' : check operator precedence for possible error; use parentheses to clarify precedence
  math\RSGISMatrices.cpp(259): warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence


Thank you!
Jose Bengoa


Pre-requirements accomplished:
Boost
HDF5
KEALib
GDAL/OGR
GEOS
Proj.4
CGAL
GNU Scientic Library (GSL)
FFTW
MuParser
Xerces

Daniel Clewley

unread,
Mar 23, 2015, 9:29:45 AM3/23/15
to Jose Bengoa, rsgislib...@googlegroups.com
Hi Jose,

Are you using the development version of RSGISLib from Bitbucket (the mercurial repo)? Did you follow all the steps in the guide Pete sent? 

Other than that I don't have any ideas, we don't really have much experience compiling under Windows.

Thanks,

Dan

Jose Bengoa

unread,
Mar 23, 2015, 9:51:54 AM3/23/15
to rsgislib...@googlegroups.com, jben...@gmail.com
Hi Dan,
Yes, I followed the steps of Pete's guide. I'm using the repository (petebunting-rsgislib-1f99dbbba537.zip) downloaded from https://bitbucket.org/petebunting/rsgislib/downloads (I haven't installed mercurial).

The errors could come from declaring the same public static class in different modules; e.g:

When compiling rsgis_img, one error message says:

public: static class rsgis::utils::RSGISGEOSFactoryGenerator * __cdecl rsgis::utils::RSGISGEOSFactoryGenerator::getInstance(void)
(...)
already defined in rsgis_geom.lib(rsgis_geom.dll)


I'm not C++ developer, so it's just a shot in the dark.

Jose
Reply all
Reply to author
Forward
0 new messages