[packages/gdal] - updated to 1.11.0 - updated format-security patch - added grass patch (allows to use default prefi
qboosh
qboosh at pld-linux.org
Tue May 13 16:10:54 CEST 2014
commit 0316feee17d6aaf76378d9c94b03675e4fbe4b46
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue May 13 16:13:28 2014 +0200
- updated to 1.11.0
- updated format-security patch
- added grass patch (allows to use default prefix for grass 5.7+)
- added sse patch (use -msse only for SSE variants, just like AVX); allows to use SSE-capable binaries on non-SSE CPUs
- added link patch (link ruby binding with just built libgdal instead of system one)
- force PHP swig files rebuild (fixes build with php 5.5)
gdal-bug-5284.patch | 168 --------------
gdal-format-security.patch | 37 +++
gdal-grass.patch | 43 ++++
gdal-link.patch | 29 +++
gdal-sse.patch | 561 +++++++++++++++++++++++++++++++++++++++++++++
gdal.spec | 68 ++++--
6 files changed, 717 insertions(+), 189 deletions(-)
---
diff --git a/gdal.spec b/gdal.spec
index 8988a60..2519269 100644
--- a/gdal.spec
+++ b/gdal.spec
@@ -7,6 +7,8 @@
# - libkml (1.3.0 needed, not released yet)
# - wait for newer pcidsk, switch to external again
# - csharp, java
+# - DDS (--with-dds, BR [lib]crunch: http://code.google.com/p/crunch/)
+# - SOSI (--with-sosi, BR: libfyba libfygm libfyut: https://github.com/kartverket/fyba)
# - additional, proprietary(?) formats support:
# - FMEObjects (http://www.safe.com/support/support-resources/fme-downloads/)
# - ESRI FileGDBAPI (http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api)
@@ -16,15 +18,17 @@
# - MSG/EUMETSAT (http://www.eumetsat.int/Home/Main/DataAccess/SupportSoftwareTools/index.htm)
# - Oracle/OCI >= 10.0.1 (for georaster); Oracle/OCI >= 8.1.7 (as DB)
# - Ingres (--with-ingres=/path)
-# - Informix DB
+# - Informix DB (--with-idb)
# - DWGdirect (members only? http://www.opendwg.org/)
# - ESRI SDE (http://www.esri.com/software/arcgis/arcsde/index.html)
#
# Conditional build:
%bcond_without armadillo # Armadillo support for faster TPS transform
%bcond_without epsilon # EPSILON wavelet compression support
+%bcond_with grass # GRASS support (note: dependency loop)
%bcond_without gta # GTA format support
%bcond_without mysql # MySQL DB support
+%bcond_with oci # ORACLE OCI DB and Georaster support
%bcond_without odbc # ODBC DB support
%bcond_without opencl # OpenCL (GPU) support
%bcond_without openjpeg # OpenJPEG 2 (JPEG2000) support
@@ -33,7 +37,7 @@
%bcond_without spatialite # SpatiaLite support
%bcond_without xerces # Xerces support
%bcond_without java # Java and MDB support
-%bcond_with php # PHP binding
+%bcond_without php # PHP binding
%bcond_without ruby # Ruby binding
%if %{with podofo}
@@ -42,18 +46,20 @@
Summary: Geospatial Data Abstraction Library
Summary(pl.UTF-8): Biblioteka abstrakcji danych dotyczących powierzchni Ziemi
Name: gdal
-Version: 1.10.1
-Release: 6
+Version: 1.11.0
+Release: 1
License: BSD-like
Group: Libraries
Source0: http://download.osgeo.org/gdal/%{version}/%{name}-%{version}.tar.xz
-# Source0-md5: f354c614aea76e5630e4edbf06e5c292
+# Source0-md5: 31f2c4a7230b40e5fdc3cf12a100f96b
Patch0: %{name}-perl.patch
Patch1: %{name}-python_install.patch
Patch2: %{name}-php.patch
Patch3: %{name}-fpic.patch
Patch4: %{name}-format-security.patch
-Patch5: gdal-bug-5284.patch
+Patch5: %{name}-grass.patch
+Patch6: %{name}-sse.patch
+Patch7: %{name}-link.patch
URL: http://www.gdal.org/
%{?with_opencl:BuildRequires: OpenCL-devel >= 1.0}
%{?with_armadillo:BuildRequires: armadillo-devel}
@@ -65,13 +71,16 @@ BuildRequires: doxygen >= 1.4.2
%{?with_epsilon:BuildRequires: epsilon-compressor-devel}
BuildRequires: expat-devel >= 1.95.0
BuildRequires: freexl-devel >= 1.0
-BuildRequires: geos-devel >= 2.2.0
+BuildRequires: gcc >= 6:4.1
+BuildRequires: geos-devel >= 3.1.0
BuildRequires: giflib-devel >= 4.0
+%{?with_grass:BuildRequires: grass-devel >= 5.7}
BuildRequires: hdf-devel >= 4.0
BuildRequires: hdf5-devel
BuildRequires: jasper-devel
%{?with_java:BuildRequires: jdk}
%{?with_java:BuildRequires: jpackage-utils}
+BuildRequires: json-c-devel >= 0.11
BuildRequires: libcsf-devel
BuildRequires: libdap-devel >= 3.10
BuildRequires: libgeotiff-devel >= 1.2.1
@@ -85,11 +94,13 @@ BuildRequires: libtiff-devel >= 4.0
BuildRequires: libtool
BuildRequires: libuuid-devel
BuildRequires: libwebp-devel
-BuildRequires: libxml2-devel
+BuildRequires: libxml2-devel >= 2
%{?with_mysql:BuildRequires: mysql-devel}
BuildRequires: netcdf-devel >= 4.1
BuildRequires: ogdi-devel >= 3.1
%{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2.0.0-2}
+# 8.1.7 for DB support, 10.0.1 for georaster
+%{?with_oci:BuildRequires: oracle-instantclient-devel >= 10.0.1}
#BuildRequires: pcidsk-devel > 0.3
BuildRequires: perl-devel
%{?with_php:BuildRequires: php-devel}
@@ -109,6 +120,7 @@ BuildRequires: rpmbuild(macros) >= 1.344
BuildRequires: sed >= 4.0
BuildRequires: sqlite3-devel >= 3.0.0
BuildRequires: swig-perl
+BuildRequires: swig-php >= 2.0.12-2
BuildRequires: swig-python >= 1.3
%{?with_ruby:BuildRequires: swig-ruby}
BuildRequires: texlive-dvips
@@ -118,7 +130,7 @@ BuildRequires: texlive-latex
BuildRequires: xz-devel
BuildRequires: zlib-devel >= 1.1.4
Requires: freexl >= 1.0
-Requires: geos >= 2.2.0
+Requires: geos >= 3.1.0
Requires: libgeotiff >= 1.2.1
Requires: libpng >= 2:1.2.8
Requires: libtiff >= 4.0
@@ -152,11 +164,12 @@ Requires: curl-devel
%{?with_epsilon:Requires: epsilon-compressor-devel}
Requires: expat-devel >= 1.95.0
Requires: freexl-devel >= 1.0
-Requires: geos-devel >= 2.2.0
+Requires: geos-devel >= 3.1.0
Requires: giflib-devel >= 4.0
Requires: hdf-devel >= 4.0
Requires: hdf5-devel
Requires: jasper-devel
+Requires: json-c-devel >= 0.11
Requires: libcsf-devel
Requires: libdap-devel >= 3.10
Requires: libgeotiff-devel >= 1.2.1
@@ -168,7 +181,7 @@ Requires: libstdc++-devel
Requires: libtiff-devel >= 4.0
Requires: libuuid-devel
Requires: libwebp-devel
-Requires: libxml2-devel
+Requires: libxml2-devel >= 2
%{?with_mysql:Requires: mysql-devel}
Requires: netcdf-devel >= 4
Requires: ogdi-devel >= 3.1
@@ -255,18 +268,24 @@ osr.
%prep
%setup -q
-%{__aclocal}
-%{__autoconf}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch5 -p3
-
-# need to regenerate (old ones don't support perl 5.10)
-%{__rm} swig/perl/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp}
-
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+
+# need to regenerate (old ones don't support perl 5.10 or php 5.5)
+%{__rm} swig/{perl,php}/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp}
+
+%{__sed} -i \
+ -e 's/^CC=gcc/CC=%{__cc}/' \
+ -e 's/^CXX=g++/CXX=%{__cxx}/' \
+ -e 's/^CFLAGS=-fpic/CFLAGS=%{rpmcflags} -fPIC/' \
+ -e 's/^LDFLAGS=-shared/LDFLAGS=%{rpmldflags} -shared/' \
+ swig/php/GNUmakefile
# Build with fPIC to allow Ruby bindings
# Xcompiler should normally achieve that -- http://trac.osgeo.org/gdal/ticket/3978
# http://trac.osgeo.org/gdal/ticket/1994
@@ -295,12 +314,14 @@ sed -i -e 's#^mandir=.*##g' configure.in
--with-dods-root=/usr \
%{?with_armadillo:--with-armadillo} \
%{?with_epsilon:--with-epsilon} \
+ %{?with_grass:--with-grass} \
%{!?with_gta:--without-gta} \
--with-hide-internal-symbols \
%{?with_java:--with-java=%{java_home}} \
--with-liblzma \
%{?with_java:--with-mdb --with-jvm-lib-add-rpath} \
%{?with_mysql:--with-mysql} \
+ %{?with_oci:--with-oci --with-oci-include=/usr/include/oracle/client --with-oci-lib=%{_libdir}} \
%{?with_opencl:--with-opencl} \
--with-perl \
%{?with_php:--with-php} \
@@ -314,7 +335,6 @@ sed -i -e 's#^mandir=.*##g' configure.in
%{?with_xerces:--with-xerces} \
--with-xerces-inc=/usr/include/xercesc \
--with-xerces-lib="-lxerces-c" \
- --without-grass \
--without-libgrass
# --with-rasdaman
# --with-pcidsk=/usr (needs > 0.3)
@@ -369,8 +389,8 @@ EOF
%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/OSR/.packlist
# some doxygen trash
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdalmove.dox
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal_{edit,fillnodata,polygonize,proximity,sieve}.dox
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal{compare,move}.dox
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal_{calc,edit,fillnodata,polygonize,proximity,sieve}.dox
%clean
rm -rf $RPM_BUILD_ROOT
@@ -403,6 +423,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/gdaladdo
%attr(755,root,root) %{_bindir}/gdalbuildvrt
%attr(755,root,root) %{_bindir}/gdalchksum.py
+%attr(755,root,root) %{_bindir}/gdalcompare.py
%attr(755,root,root) %{_bindir}/gdaldem
%attr(755,root,root) %{_bindir}/gdalenhance
%attr(755,root,root) %{_bindir}/gdalident.py
@@ -420,6 +441,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/nearblack
%attr(755,root,root) %{_bindir}/ogr2ogr
%attr(755,root,root) %{_bindir}/ogrinfo
+%attr(755,root,root) %{_bindir}/ogrlineref
%attr(755,root,root) %{_bindir}/ogrtindex
%attr(755,root,root) %{_bindir}/pct2rgb.py
%attr(755,root,root) %{_bindir}/rgb2pct.py
@@ -428,6 +450,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %ghost %{_libdir}/libgdal.so.1
%{_datadir}/gdal
%{_mandir}/man1/gdal2tiles.1*
+%{_mandir}/man1/gdal_calc.1*
%{_mandir}/man1/gdal_contour.1*
%{_mandir}/man1/gdal_edit.1*
%{_mandir}/man1/gdal_fillnodata.1*
@@ -442,6 +465,7 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/gdal_utilities.1*
%{_mandir}/man1/gdaladdo.1*
%{_mandir}/man1/gdalbuildvrt.1*
+%{_mandir}/man1/gdalcompare.1*
%{_mandir}/man1/gdaldem.1*
%{_mandir}/man1/gdalinfo.1*
%{_mandir}/man1/gdallocationinfo.1*
@@ -455,6 +479,7 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/ogr2ogr.1*
%{_mandir}/man1/ogr_utilities.1*
%{_mandir}/man1/ogrinfo.1*
+%{_mandir}/man1/ogrlineref.1*
%{_mandir}/man1/ogrtindex.1*
%{_mandir}/man1/pct2rgb.1*
%{_mandir}/man1/rgb2pct.1*
@@ -465,6 +490,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/gdal-config
%attr(755,root,root) %{_libdir}/libgdal.so
%{_libdir}/libgdal.la
+%{_pkgconfigdir}/gdal.pc
%{_includedir}/cpl_*.h
%{_includedir}/cplkeywordparser.h
%{_includedir}/gdal*.h
diff --git a/gdal-bug-5284.patch b/gdal-bug-5284.patch
deleted file mode 100644
index c01b55c..0000000
--- a/gdal-bug-5284.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-Index: /trunk/gdal/configure
-===================================================================
---- /trunk/gdal/configure (revision 26534)
-+++ /trunk/gdal/configure (revision 26582)
-@@ -723,4 +723,5 @@
- II_SYSTEM
- HAVE_INGRES
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
- MYSQL_LIB
- MYSQL_INC
-@@ -23308,4 +23309,32 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-+
-+ # Check if mysql headers declare load_defaults
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking load_defaults() in MySQL" >&5
-+$as_echo_n "checking load_defaults() in MySQL... " >&6; }
-+ rm -f testmysql.*
-+ echo '#include "my_global.h"' > testmysql.cpp
-+ echo '#include "my_sys.h"' >> testmysql.cpp
-+ echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5
-+$as_echo "yes, found in my_sys.h" >&6; }
-+ else
-+ echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
-+ echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5
-+$as_echo "yes, found in library but not in header" >&6; }
-+ MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes
-+ else
-+ HAVE_MYSQL=no
-+ MYSQL_LIB=
-+ MYSQL_INC=
-+ as_fn_error $? "Cannot find load_defaults()" "$LINENO" 5
-+ fi
-+ fi
-+ rm -f testmysql.*
-+ rm -f testmysql
-+
- ;;
- esac
-@@ -23317,4 +23346,6 @@
-
- MYSQL_LIB=$MYSQL_LIB
-+
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
-
-
-Index: /trunk/gdal/configure.in
-===================================================================
---- /trunk/gdal/configure.in (revision 26534)
-+++ /trunk/gdal/configure.in (revision 26582)
-@@ -2462,4 +2462,29 @@
- MYSQL_INC="`$MYSQL_CONFIG --include`"
- AC_MSG_RESULT([yes])
-+
-+ # Check if mysql headers declare load_defaults
-+ AC_MSG_CHECKING([load_defaults() in MySQL])
-+ rm -f testmysql.*
-+ echo '#include "my_global.h"' > testmysql.cpp
-+ echo '#include "my_sys.h"' >> testmysql.cpp
-+ echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ AC_MSG_RESULT([yes, found in my_sys.h])
-+ else
-+ echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
-+ echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ AC_MSG_RESULT([yes, found in library but not in header])
-+ MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes
-+ else
-+ HAVE_MYSQL=no
-+ MYSQL_LIB=
-+ MYSQL_INC=
-+ AC_MSG_ERROR([Cannot find load_defaults()])
-+ fi
-+ fi
-+ rm -f testmysql.*
-+ rm -f testmysql
-+
- ;;
- esac
-@@ -2469,4 +2494,5 @@
- AC_SUBST(MYSQL_INC,$MYSQL_INC)
- AC_SUBST(MYSQL_LIB,$MYSQL_LIB)
-+AC_SUBST(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION,$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION)
-
- dnl ---------------------------------------------------------------------------
-Index: /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile
-===================================================================
---- /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile (revision 15888)
-+++ /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile (revision 26582)
-@@ -8,4 +8,9 @@
- CPPFLAGS := -I.. -I../.. $(GDAL_INCLUDE) $(MYSQL_INC) $(CPPFLAGS)
-
-+ifeq ($(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION),yes)
-+CPPFLAGS += -DMYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
-+endif
-+
-+
- default: $(O_OBJ:.o=.$(OBJ_EXT))
-
-Index: /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp
-===================================================================
---- /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp (revision 26506)
-+++ /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp (revision 26582)
-@@ -37,4 +37,14 @@
- #include "cpl_string.h"
-
-+/* Recent versions of mysql no longer declare load_defaults() in my_sys.h */
-+/* but they still have it in the lib. Very fragile... */
-+#ifdef MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
-+extern "C" {
-+int load_defaults(const char *conf_file, const char **groups,
-+ int *argc, char ***argv);
-+void free_defaults(char **argv);
-+}
-+#endif
-+
- CPL_CVSID("$Id$");
- /************************************************************************/
-Index: /trunk/gdal/GDALmake.opt.in
-===================================================================
---- /trunk/gdal/GDALmake.opt.in (revision 26296)
-+++ /trunk/gdal/GDALmake.opt.in (revision 26582)
-@@ -127,4 +127,5 @@
- MYSQL_LIB = @MYSQL_LIB@
- MYSQL_INC = @MYSQL_INC@
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION = @MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION@
- LIBS += $(MYSQL_LIB)
-
-Index: /trunk/gdal/configure
-===================================================================
---- /trunk/gdal/configure (revision 26582)
-+++ /trunk/gdal/configure (revision 26583)
-@@ -23317,5 +23317,5 @@
- echo '#include "my_sys.h"' >> testmysql.cpp
- echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-- if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5
- $as_echo "yes, found in my_sys.h" >&6; }
-@@ -23323,5 +23323,5 @@
- echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
- echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-- if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5
- $as_echo "yes, found in library but not in header" >&6; }
-Index: /trunk/gdal/configure.in
-===================================================================
---- /trunk/gdal/configure.in (revision 26582)
-+++ /trunk/gdal/configure.in (revision 26583)
-@@ -2469,10 +2469,10 @@
- echo '#include "my_sys.h"' >> testmysql.cpp
- echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-- if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
- AC_MSG_RESULT([yes, found in my_sys.h])
- else
- echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
- echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
-- if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then
-+ if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
- AC_MSG_RESULT([yes, found in library but not in header])
- MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes
diff --git a/gdal-format-security.patch b/gdal-format-security.patch
index 2783f10..063e571 100644
--- a/gdal-format-security.patch
+++ b/gdal-format-security.patch
@@ -9,3 +9,40 @@
}
}
+--- gdal-1.11.0/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp.orig 2014-04-16 22:04:02.000000000 +0200
++++ gdal-1.11.0/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp 2014-05-10 17:33:52.404601057 +0200
+@@ -459,7 +459,7 @@
+ if (nEPSG == 0)
+ {
+ CPLError( CE_Warning, CPLE_NotSupported,
+- CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld) not supported", iVCS) );
++ "SXF. Vertical coordinate system (SXF index %ld) not supported", iVCS );
+ return;
+ }
+
+@@ -468,14 +468,14 @@
+ if (eImportFromEPSGErr != OGRERR_NONE)
+ {
+ CPLError( CE_Warning, CPLE_None,
+- CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld, EPSG %d) import from EPSG error", iVCS, nEPSG) );
++ "SXF. Vertical coordinate system (SXF index %ld, EPSG %d) import from EPSG error", iVCS, nEPSG );
+ return;
+ }
+
+ if (sr->IsVertical() != 1)
+ {
+ CPLError( CE_Warning, CPLE_None,
+- CPLString().Printf("SXF. Coordinate system (SXF index %ld, EPSG %d) is not Vertical", iVCS, nEPSG) );
++ "SXF. Coordinate system (SXF index %ld, EPSG %d) is not Vertical", iVCS, nEPSG );
+ return;
+ }
+
+@@ -484,7 +484,7 @@
+ if (eSetVertCSErr != OGRERR_NONE)
+ {
+ CPLError( CE_Warning, CPLE_None,
+- CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld, EPSG %d) set error", iVCS, nEPSG) );
++ "SXF. Vertical coordinate system (SXF index %ld, EPSG %d) set error", iVCS, nEPSG );
+ return;
+ }
+ }
diff --git a/gdal-grass.patch b/gdal-grass.patch
new file mode 100644
index 0000000..a27c814
--- /dev/null
+++ b/gdal-grass.patch
@@ -0,0 +1,43 @@
+--- gdal-1.11.0/configure.in.orig 2014-05-11 06:25:06.870303219 +0200
++++ gdal-1.11.0/configure.in 2014-05-11 09:17:12.103421341 +0200
+@@ -718,25 +718,33 @@
+
+ # Check for GRASS 5.7.0 or later library use.
+ # TODO: separate libs for rasters and vectors
+-if test "$with_grass" != "yes" -a "$with_grass" != "no" ; then
++if test "$with_grass" != "no" ; then
+
+- AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
++ if test "$with_grass" = "yes" ; then
++ GRASS_I=
++ GRASS_L=
++ GRASS_GISBASE="$prefix"
++ else
++ GRASS_I="-I$with_grass/include"
++ GRASS_L="-L$with_grass/lib"
++ GRASS_GISBASE="$with_grass"
++ fi
++ AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime)
+ if test "$GRASS_SETTING" = "no" ; then
+- AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
++ AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime)
+ fi
+
+ if test "$GRASS_SETTING" != "no" ; then
+ if test "$GRASS_SETTING" = "grass70+" ; then
+ G_RASTLIBS="-lgrass_raster -lgrass_imagery"
+ G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+- LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
++ LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+ else
+ G_RASTLIBS="-lgrass_I"
+ G_VECTLIBS="-lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+- LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
++ LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+ fi
+- GRASS_INCLUDE="-I$with_grass/include"
+- GRASS_GISBASE="$with_grass"
++ GRASS_INCLUDE="$GRASS_I"
+ HAVE_GRASS=yes
+ else
+ AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries not found!])
diff --git a/gdal-link.patch b/gdal-link.patch
new file mode 100644
index 0000000..9a9f7e6
--- /dev/null
+++ b/gdal-link.patch
@@ -0,0 +1,29 @@
+--- gdal-1.11.0/swig/ruby/RubyMakefile.mk.orig 2014-05-11 22:02:00.429131553 +0200
++++ gdal-1.11.0/swig/ruby/RubyMakefile.mk 2014-05-12 19:26:05.824192351 +0200
+@@ -64,10 +64,10 @@
+ for i in $(RUBY_MODULES) ; do $(INSTALL) $$i $(DESTDIR)$(INSTALL_DIR) ; done
+
+ $(RUBY_MODULES_MAC): %.bundle: %_wrap.o
+- $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
++ $(LD) $(LDFLAGS) $(GDAL_SLIB_LINK) $(LIBS) $(RUBY_LIB) $< -o $@
+
+ $(RUBY_MODULES_LIN): %.so: %_wrap.o
+- $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
++ $(LD) $(LDFLAGS) $(GDAL_SLIB_LINK) $(LIBS) $(RUBY_LIB) $< -o $@
+
+ %.o: %.cpp
+ $(CXX) $(CFLAGS) -fPIC $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
+--- gdal-1.11.0/GDALmake.opt.in.orig 2014-04-16 22:04:49.000000000 +0200
++++ gdal-1.11.0/GDALmake.opt.in 2014-05-12 19:25:43.287526155 +0200
+@@ -100,7 +100,11 @@
+
+ GDAL_LIB = $(GDAL_ROOT)/libgdal.a
+ GDAL_SLIB = $(GDAL_ROOT)/libgdal.$(SO_EXT)
++ifeq ($(HAVE_LIBTOOL), yes)
++GDAL_SLIB_LINK = $(GDAL_ROOT)/libgdal.la
++else
+ GDAL_SLIB_LINK = -L$(GDAL_ROOT) -lgdal
++endif
+
+ # Mac OS X Framework definition
+ MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
diff --git a/gdal-sse.patch b/gdal-sse.patch
new file mode 100644
index 0000000..692affa
--- /dev/null
+++ b/gdal-sse.patch
@@ -0,0 +1,561 @@
+--- gdal-1.11.0/alg/gdalgrid_priv.h.orig 2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/gdalgrid_priv.h 2014-05-11 20:50:49.579220569 +0200
+@@ -51,6 +51,21 @@
+ const float *pafZ;
+ } GDALGridExtraParameters;
+
++#ifdef HAVE_SSE_AT_COMPILE_TIME
++int CPLHaveRuntimeSSE();
++
++CPLErr
++GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
++ const void *poOptions,
++ GUInt32 nPoints,
++ const double *unused_padfX,
++ const double *unused_padfY,
++ const double *unused_padfZ,
++ double dfXPoint, double dfYPoint,
++ double *pdfValue,
++ void* hExtraParamsIn );
++#endif
++
+ #ifdef HAVE_AVX_AT_COMPILE_TIME
+ int CPLHaveRuntimeAVX();
+
+--- gdal-1.11.0/alg/gdalgridsse.cpp.orig 1970-01-01 01:00:00.000000000 +0100
++++ gdal-1.11.0/alg/gdalgridsse.cpp 2014-05-11 21:54:46.609140595 +0200
+@@ -0,0 +1,210 @@
++#include "gdalgrid.h"
++#include "gdalgrid_priv.h"
++
++#ifdef HAVE_SSE_AT_COMPILE_TIME
++#include <xmmintrin.h>
++
++/************************************************************************/
++/* CPLHaveRuntimeSSE() */
++/************************************************************************/
++
++#define CPUID_SSE_EDX_BIT 25
++
++#if (defined(_M_X64) || defined(__x86_64))
++
++int CPLHaveRuntimeSSE()
++{
++ return TRUE;
++}
++
++#elif defined(__GNUC__) && defined(__i386__)
++
++int CPLHaveRuntimeSSE()
++{
++ int cpuinfo[4] = {0,0,0,0};
++ GCC_CPUID(1, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
++ return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
++}
++
++#elif defined(_MSC_VER) && defined(_M_IX86)
++
++#if _MSC_VER <= 1310
++static void inline __cpuid(int cpuinfo[4], int level)
++{
++ __asm
++ {
++ push ebx
++ push esi
++
++ mov esi,cpuinfo
++ mov eax,level
++ cpuid
++ mov dword ptr [esi], eax
++ mov dword ptr [esi+4],ebx
++ mov dword ptr [esi+8],ecx
++ mov dword ptr [esi+0Ch],edx
++
++ pop esi
++ pop ebx
++ }
++}
++#else
++#include <intrin.h>
++#endif
++
++int CPLHaveRuntimeSSE()
++{
++ int cpuinfo[4] = {0,0,0,0};
++ __cpuid(cpuinfo, 1);
++ return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
++}
++
++#else
++
++int CPLHaveRuntimeSSE()
++{
++ return FALSE;
++}
++#endif
++
++/************************************************************************/
++/* GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE() */
++/************************************************************************/
++
++CPLErr
++GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
++ const void *poOptions,
++ GUInt32 nPoints,
++ const double *unused_padfX,
++ const double *unused_padfY,
++ const double *unused_padfZ,
++ double dfXPoint, double dfYPoint,
++ double *pdfValue,
++ void* hExtraParamsIn )
++{
++ size_t i = 0;
++ GDALGridExtraParameters* psExtraParams = (GDALGridExtraParameters*) hExtraParamsIn;
++ const float* pafX = psExtraParams->pafX;
++ const float* pafY = psExtraParams->pafY;
++ const float* pafZ = psExtraParams->pafZ;
++
++ const float fEpsilon = 0.0000000000001f;
++ const float fXPoint = (float)dfXPoint;
++ const float fYPoint = (float)dfYPoint;
++ const __m128 xmm_small = _mm_load1_ps((float*)&fEpsilon);
++ const __m128 xmm_x = _mm_load1_ps((float*)&fXPoint);
++ const __m128 xmm_y = _mm_load1_ps((float*)&fYPoint);
++ __m128 xmm_nominator = _mm_setzero_ps();
++ __m128 xmm_denominator = _mm_setzero_ps();
++ int mask = 0;
++
++#if defined(__x86_64) || defined(_M_X64)
++ /* This would also work in 32bit mode, but there are only 8 XMM registers */
++ /* whereas we have 16 for 64bit */
++#define LOOP_SIZE 8
++ size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
++ for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
++ {
++ __m128 xmm_rx = _mm_sub_ps(_mm_load_ps(pafX + i), xmm_x); /* rx = pafX[i] - fXPoint */
++ __m128 xmm_rx_4 = _mm_sub_ps(_mm_load_ps(pafX + i + 4), xmm_x);
++ __m128 xmm_ry = _mm_sub_ps(_mm_load_ps(pafY + i), xmm_y); /* ry = pafY[i] - fYPoint */
++ __m128 xmm_ry_4 = _mm_sub_ps(_mm_load_ps(pafY + i + 4), xmm_y);
++ __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx), /* r2 = rx * rx + ry * ry */
++ _mm_mul_ps(xmm_ry, xmm_ry));
++ __m128 xmm_r2_4 = _mm_add_ps(_mm_mul_ps(xmm_rx_4, xmm_rx_4),
++ _mm_mul_ps(xmm_ry_4, xmm_ry_4));
++ __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2); /* invr2 = 1.0f / r2 */
++ __m128 xmm_invr2_4 = _mm_rcp_ps(xmm_r2_4);
++ xmm_nominator = _mm_add_ps(xmm_nominator, /* nominator += invr2 * pafZ[i] */
++ _mm_mul_ps(xmm_invr2, _mm_load_ps(pafZ + i)));
++ xmm_nominator = _mm_add_ps(xmm_nominator,
++ _mm_mul_ps(xmm_invr2_4, _mm_load_ps(pafZ + i + 4)));
++ xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2); /* denominator += invr2 */
++ xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2_4);
++ mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)) | /* if( r2 < fEpsilon) */
++ (_mm_movemask_ps(_mm_cmplt_ps(xmm_r2_4, xmm_small)) << 4);
++ if( mask )
++ break;
++ }
++#else
++#define LOOP_SIZE 4
++ size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
++ for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
++ {
++ __m128 xmm_rx = _mm_sub_ps(_mm_load_ps((float*)pafX + i), xmm_x); /* rx = pafX[i] - fXPoint */
++ __m128 xmm_ry = _mm_sub_ps(_mm_load_ps((float*)pafY + i), xmm_y); /* ry = pafY[i] - fYPoint */
++ __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx), /* r2 = rx * rx + ry * ry */
++ _mm_mul_ps(xmm_ry, xmm_ry));
++ __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2); /* invr2 = 1.0f / r2 */
++ xmm_nominator = _mm_add_ps(xmm_nominator, /* nominator += invr2 * pafZ[i] */
++ _mm_mul_ps(xmm_invr2, _mm_load_ps((float*)pafZ + i)));
++ xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2); /* denominator += invr2 */
++ mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)); /* if( r2 < fEpsilon) */
++ if( mask )
++ break;
++ }
++#endif
++
++ /* Find which i triggered r2 < fEpsilon */
++ if( mask )
++ {
++ for(int j = 0; j < LOOP_SIZE; j++ )
++ {
++ if( mask & (1 << j) )
++ {
++ (*pdfValue) = (pafZ)[i + j];
++ return CE_None;
++ }
++ }
++ }
++
++ /* Get back nominator and denominator values for XMM registers */
++ float afNominator[4], afDenominator[4];
++ _mm_storeu_ps(afNominator, xmm_nominator);
++ _mm_storeu_ps(afDenominator, xmm_denominator);
++
++ float fNominator = afNominator[0] + afNominator[1] +
++ afNominator[2] + afNominator[3];
++ float fDenominator = afDenominator[0] + afDenominator[1] +
++ afDenominator[2] + afDenominator[3];
++
++ /* Do the few remaining loop iterations */
++ for ( ; i < nPoints; i++ )
++ {
++ const float fRX = pafX[i] - fXPoint;
++ const float fRY = pafY[i] - fYPoint;
++ const float fR2 =
++ fRX * fRX + fRY * fRY;
++
++ // If the test point is close to the grid node, use the point
++ // value directly as a node value to avoid singularity.
++ if ( fR2 < 0.0000000000001 )
++ {
++ break;
++ }
++ else
++ {
++ const float fInvR2 = 1.0f / fR2;
++ fNominator += fInvR2 * pafZ[i];
++ fDenominator += fInvR2;
++ }
++ }
++
++ if( i != nPoints )
++ {
++ (*pdfValue) = pafZ[i];
++ }
++ else
++ if ( fDenominator == 0.0 )
++ {
++ (*pdfValue) =
++ ((GDALGridInverseDistanceToAPowerOptions*)poOptions)->dfNoDataValue;
++ }
++ else
++ (*pdfValue) = fNominator / fDenominator;
++
++ return CE_None;
++}
++
++
++#endif
+--- gdal-1.11.0/alg/gdalgrid.cpp.orig 2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/gdalgrid.cpp 2014-05-11 21:27:49.735840961 +0200
+@@ -36,10 +36,6 @@
+ #include "cpl_multiproc.h"
+ #include "gdalgrid_priv.h"
+
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-#include <xmmintrin.h>
+-#endif
+-
+ CPL_CVSID("$Id: gdalgrid.cpp 27110 2014-03-28 21:29:20Z rouault $");
+
+ #define TO_RADIANS (3.14159265358979323846 / 180.0)
+@@ -53,74 +49,6 @@
+ #endif /* DBL_MAX */
+
+ /************************************************************************/
+-/* CPLHaveRuntimeSSE() */
+-/************************************************************************/
+-
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-
+-#define CPUID_SSE_EDX_BIT 25
+-
+-#if (defined(_M_X64) || defined(__x86_64))
+-
+-static int CPLHaveRuntimeSSE()
+-{
+- return TRUE;
+-}
+-
+-#elif defined(__GNUC__) && defined(__i386__)
+-
+-static int CPLHaveRuntimeSSE()
+-{
+- int cpuinfo[4] = {0,0,0,0};
+- GCC_CPUID(1, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
+- return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
+-}
+-
+-#elif defined(_MSC_VER) && defined(_M_IX86)
+-
+-#if _MSC_VER <= 1310
+-static void inline __cpuid(int cpuinfo[4], int level)
+-{
+- __asm
+- {
+- push ebx
+- push esi
+-
+- mov esi,cpuinfo
+- mov eax,level
+- cpuid
+- mov dword ptr [esi], eax
+- mov dword ptr [esi+4],ebx
+- mov dword ptr [esi+8],ecx
+- mov dword ptr [esi+0Ch],edx
+-
+- pop esi
+- pop ebx
+- }
+-}
+-#else
+-#include <intrin.h>
+-#endif
+-
+-static int CPLHaveRuntimeSSE()
+-{
+- int cpuinfo[4] = {0,0,0,0};
+- __cpuid(cpuinfo, 1);
+- return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
+-}
+-
+-#else
+-
+-static int CPLHaveRuntimeSSE()
+-{
+- return FALSE;
+-}
+-
+-#endif
+-
+-#endif // HAVE_SSE_AT_COMPILE_TIME
+-
+-/************************************************************************/
+ /* GDALGridGetPointBounds() */
+ /************************************************************************/
+
+@@ -394,148 +322,6 @@
+ }
+
+ /************************************************************************/
+-/* GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE() */
+-/************************************************************************/
+-
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-
+-static CPLErr
+-GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
+- const void *poOptions,
+- GUInt32 nPoints,
+- const double *unused_padfX,
+- const double *unused_padfY,
+- const double *unused_padfZ,
+- double dfXPoint, double dfYPoint,
+- double *pdfValue,
+- void* hExtraParamsIn )
+-{
+- size_t i = 0;
+- GDALGridExtraParameters* psExtraParams = (GDALGridExtraParameters*) hExtraParamsIn;
+- const float* pafX = psExtraParams->pafX;
+- const float* pafY = psExtraParams->pafY;
+- const float* pafZ = psExtraParams->pafZ;
+-
+- const float fEpsilon = 0.0000000000001f;
+- const float fXPoint = (float)dfXPoint;
+- const float fYPoint = (float)dfYPoint;
+- const __m128 xmm_small = _mm_load1_ps((float*)&fEpsilon);
+- const __m128 xmm_x = _mm_load1_ps((float*)&fXPoint);
+- const __m128 xmm_y = _mm_load1_ps((float*)&fYPoint);
+- __m128 xmm_nominator = _mm_setzero_ps();
+- __m128 xmm_denominator = _mm_setzero_ps();
+- int mask = 0;
+-
+-#if defined(__x86_64) || defined(_M_X64)
+- /* This would also work in 32bit mode, but there are only 8 XMM registers */
+- /* whereas we have 16 for 64bit */
+-#define LOOP_SIZE 8
+- size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
+- for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
+- {
+- __m128 xmm_rx = _mm_sub_ps(_mm_load_ps(pafX + i), xmm_x); /* rx = pafX[i] - fXPoint */
+- __m128 xmm_rx_4 = _mm_sub_ps(_mm_load_ps(pafX + i + 4), xmm_x);
+- __m128 xmm_ry = _mm_sub_ps(_mm_load_ps(pafY + i), xmm_y); /* ry = pafY[i] - fYPoint */
+- __m128 xmm_ry_4 = _mm_sub_ps(_mm_load_ps(pafY + i + 4), xmm_y);
+- __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx), /* r2 = rx * rx + ry * ry */
+- _mm_mul_ps(xmm_ry, xmm_ry));
+- __m128 xmm_r2_4 = _mm_add_ps(_mm_mul_ps(xmm_rx_4, xmm_rx_4),
+- _mm_mul_ps(xmm_ry_4, xmm_ry_4));
+- __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2); /* invr2 = 1.0f / r2 */
+- __m128 xmm_invr2_4 = _mm_rcp_ps(xmm_r2_4);
+- xmm_nominator = _mm_add_ps(xmm_nominator, /* nominator += invr2 * pafZ[i] */
+- _mm_mul_ps(xmm_invr2, _mm_load_ps(pafZ + i)));
+- xmm_nominator = _mm_add_ps(xmm_nominator,
+- _mm_mul_ps(xmm_invr2_4, _mm_load_ps(pafZ + i + 4)));
+- xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2); /* denominator += invr2 */
+- xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2_4);
+- mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)) | /* if( r2 < fEpsilon) */
+- (_mm_movemask_ps(_mm_cmplt_ps(xmm_r2_4, xmm_small)) << 4);
+- if( mask )
+- break;
+- }
+-#else
+-#define LOOP_SIZE 4
+- size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
+- for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
+- {
+- __m128 xmm_rx = _mm_sub_ps(_mm_load_ps((float*)pafX + i), xmm_x); /* rx = pafX[i] - fXPoint */
+- __m128 xmm_ry = _mm_sub_ps(_mm_load_ps((float*)pafY + i), xmm_y); /* ry = pafY[i] - fYPoint */
+- __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx), /* r2 = rx * rx + ry * ry */
+- _mm_mul_ps(xmm_ry, xmm_ry));
+- __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2); /* invr2 = 1.0f / r2 */
+- xmm_nominator = _mm_add_ps(xmm_nominator, /* nominator += invr2 * pafZ[i] */
+- _mm_mul_ps(xmm_invr2, _mm_load_ps((float*)pafZ + i)));
+- xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2); /* denominator += invr2 */
+- mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)); /* if( r2 < fEpsilon) */
+- if( mask )
+- break;
+- }
+-#endif
+-
+- /* Find which i triggered r2 < fEpsilon */
+- if( mask )
+- {
+- for(int j = 0; j < LOOP_SIZE; j++ )
+- {
+- if( mask & (1 << j) )
+- {
+- (*pdfValue) = (pafZ)[i + j];
+- return CE_None;
+- }
+- }
+- }
+-
+- /* Get back nominator and denominator values for XMM registers */
+- float afNominator[4], afDenominator[4];
+- _mm_storeu_ps(afNominator, xmm_nominator);
+- _mm_storeu_ps(afDenominator, xmm_denominator);
+-
+- float fNominator = afNominator[0] + afNominator[1] +
+- afNominator[2] + afNominator[3];
+- float fDenominator = afDenominator[0] + afDenominator[1] +
+- afDenominator[2] + afDenominator[3];
+-
+- /* Do the few remaining loop iterations */
+- for ( ; i < nPoints; i++ )
+- {
+- const float fRX = pafX[i] - fXPoint;
+- const float fRY = pafY[i] - fYPoint;
+- const float fR2 =
+- fRX * fRX + fRY * fRY;
+-
+- // If the test point is close to the grid node, use the point
+- // value directly as a node value to avoid singularity.
+- if ( fR2 < 0.0000000000001 )
+- {
+- break;
+- }
+- else
+- {
+- const float fInvR2 = 1.0f / fR2;
+- fNominator += fInvR2 * pafZ[i];
+- fDenominator += fInvR2;
+- }
+- }
+-
+- if( i != nPoints )
+- {
+- (*pdfValue) = pafZ[i];
+- }
+- else
+- if ( fDenominator == 0.0 )
+- {
+- (*pdfValue) =
+- ((GDALGridInverseDistanceToAPowerOptions*)poOptions)->dfNoDataValue;
+- }
+- else
+- (*pdfValue) = fNominator / fDenominator;
+-
+- return CE_None;
+-}
+-#endif // HAVE_SSE_AT_COMPILE_TIME
+-
+-/************************************************************************/
+ /* GDALGridMovingAverage() */
+ /************************************************************************/
+
+@@ -1766,7 +1552,9 @@
+ pabyX = pabyY = pabyZ = NULL;
+ }
+ }
++# ifdef HAVE_SSE_AT_COMPILE_TIME
+ else
++# endif
+ #endif
+
+ #ifdef HAVE_SSE_AT_COMPILE_TIME
+--- gdal-1.11.0/alg/GNUmakefile.orig 2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/GNUmakefile 2014-05-11 21:56:55.699137906 +0200
+@@ -16,6 +16,10 @@
+ CPPFLAGS := -DHAVE_AVX_AT_COMPILE_TIME $(CPPFLAGS)
+ endif
+
++ifeq ($(HAVE_SSE_AT_COMPILE_TIME),yes)
++CPPFLAGS := -DHAVE_SSE_AT_COMPILE_TIME $(CPPFLAGS)
++endif
++
+ ifeq ($(HAVE_GEOS),yes)
+ CPPFLAGS := -DHAVE_GEOS=1 $(GEOS_CFLAGS) $(CPPFLAGS)
+ endif
+@@ -26,11 +30,14 @@
+
+ CPPFLAGS := $(GDAL_INCLUDE) $(CPPFLAGS) $(OPENCL_FLAGS)
+
+-default: $(OBJ:.o=.$(OBJ_EXT)) gdalgridavx.$(OBJ_EXT)
++default: $(OBJ:.o=.$(OBJ_EXT)) gdalgridavx.$(OBJ_EXT) gdalgridsse.$(OBJ_EXT)
+
+ gdalgridavx.$(OBJ_EXT): gdalgridavx.cpp
+ $(CXX) $(CXXFLAGS) $(AVXFLAGS) $(CPPFLAGS) -c -o $@ $<
+
++gdalgridsse.$(OBJ_EXT): gdalgridsse.cpp
++ $(CXX) $(CXXFLAGS) $(SSEFLAGS) $(CPPFLAGS) -c -o $@ $<
++
+ clean:
+ $(RM) *.o $(O_OBJ)
+
+--- gdal-1.11.0/configure.in.orig 2014-05-11 20:11:46.272602746 +0200
++++ gdal-1.11.0/configure.in 2014-05-11 22:00:20.125800312 +0200
+@@ -240,12 +240,12 @@
+ echo '#endif' >> detectsse.cpp
+ if test -z "`${CXX} ${CXXFLAGS} -o detectsse detectsse.cpp 2>&1`" ; then
+ AC_MSG_RESULT([yes])
+- SSEFLAGS="-DHAVE_SSE_AT_COMPILE_TIME"
++ SSEFLAGS=""
+ HAVE_SSE_AT_COMPILE_TIME=yes
+ else
+ if test -z "`${CXX} ${CXXFLAGS} -msse -o detectsse detectsse.cpp 2>&1`" ; then
+ AC_MSG_RESULT([yes])
+- SSEFLAGS="-msse -DHAVE_SSE_AT_COMPILE_TIME"
++ SSEFLAGS="-msse"
+ HAVE_SSE_AT_COMPILE_TIME=yes
+ else
+ AC_MSG_RESULT([no])
+@@ -279,16 +279,14 @@
+ esac
+ fi
+
+- if test "$HAVE_SSE_AT_COMPILE_TIME" = "yes"; then
+- CFLAGS="$CFLAGS $SSEFLAGS"
+- CXXFLAGS="$CXXFLAGS $SSEFLAGS"
+- fi
+-
+ rm -f detectsse*
+ else
+ AC_MSG_RESULT([no])
+ fi
+
++AC_SUBST(SSEFLAGS,$SSEFLAGS)
++AC_SUBST(HAVE_SSE_AT_COMPILE_TIME,$HAVE_SSE_AT_COMPILE_TIME)
++
+ dnl ---------------------------------------------------------------------------
+ dnl Check AVX availability
+ dnl ---------------------------------------------------------------------------
+--- gdal-1.11.0/GDALmake.opt.in.orig 2014-05-12 19:27:07.164191074 +0200
++++ gdal-1.11.0/GDALmake.opt.in 2014-05-12 20:39:04.850767745 +0200
+@@ -37,6 +37,8 @@
+ $(PCIDSK_LIB) $(RASDAMAN_LIB) $(CHARLS_LIB) $(SOSI_LIB) \
+ $(OPENCL_LIB) $(JVM_LIB) $(LIBICONV) $(FGDB_LIB) $(LIBXML2_LIB)
+
++SSEFLAGS = @SSEFLAGS@
++HAVE_SSE_AT_COMPILE_TIME = @HAVE_SSE_AT_COMPILE_TIME@
+ AVXFLAGS = @AVXFLAGS@
+ HAVE_AVX_AT_COMPILE_TIME = @HAVE_AVX_AT_COMPILE_TIME@
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gdal.git/commitdiff/0316feee17d6aaf76378d9c94b03675e4fbe4b46
More information about the pld-cvs-commit
mailing list