Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6899 closed defect (fixed)

cannot build gdal 2.2 with mysql (mariadb) support

Reported by: saultdon Owned by: warmerdam
Priority: normal Milestone: 2.2.1
Component: default Version: 2.2.0
Severity: normal Keywords:
Cc:

Description

Getting an error during compile against the 2.2 branch for GDAL (2.2.r38625) regarding mysql (mariadb 10.1.23).

g++ -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/gcore -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/alg -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr/ogrsf_frmts -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/gnm -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -march=native -O2 -pipe -fstack-protector-strong -fPIC  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wsuggest-override  -I.. -I../..  -I/usr/include/mysql -DGNM_ENABLED -D_FORTIFY_SOURCE=2 -I/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port -I/usr/include  -DGDAL_COMPILATION -c -o ../o/ogrmysqldriver.o ogrmysqldriver.cpp
In file included from /tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_progress.h:33:0,
                 from /tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr/ogrsf_frmts/ogrsf_frmts.h:34,
                 from ogr_mysql.h:63,
                 from ogrmysqldriver.cpp:29:
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h: In function ‘int CPLIsFinite(float)’:
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h:665:49: error: ‘finite’ is not a member of ‘std’
 static inline int CPLIsFinite(float f) { return std::isfinite(f); }
                                                 ^~~
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h:665:49: note: suggested alternative:
In file included from /usr/include/features.h:410:0,
                 from /usr/include/pthread.h:21,
                 from /usr/include/mysql/my_global.h:280,
                 from ogr_mysql.h:42,
                 from ogrmysqldriver.cpp:29:
/usr/include/bits/mathcalls.h:210:1: note:   ‘finite’
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 ^
In file included from /tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_progress.h:33:0,
                 from /tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr/ogrsf_frmts/ogrsf_frmts.h:34,
                 from ogr_mysql.h:63,
                 from ogrmysqldriver.cpp:29:
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h: In function ‘int CPLIsFinite(double)’:
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h:666:50: error: ‘finite’ is not a member of ‘std’
 static inline int CPLIsFinite(double f) { return std::isfinite(f); }
                                                  ^~~
/tmp/makepkg/gdal-filegdb/src/gdal-2.2/port/cpl_port.h:666:50: note: suggested alternative:
In file included from /usr/include/features.h:410:0,
                 from /usr/include/pthread.h:21,
                 from /usr/include/mysql/my_global.h:280,
                 from ogr_mysql.h:42,
                 from ogrmysqldriver.cpp:29:
/usr/include/bits/mathcalls.h:210:1: note:   ‘finite’
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 ^
make[3]: *** [../../../GDALmake.opt:645: ../o/ogrmysqldriver.o] Error 1
make[3]: Leaving directory '/tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr/ogrsf_frmts/mysql'
make[2]: *** [../../GDALmake.opt:658: mysql-target] Error 2
make[2]: Leaving directory '/tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr/ogrsf_frmts'
make[1]: *** [GNUmakefile:55: sublibs] Error 2
make[1]: Leaving directory '/tmp/makepkg/gdal-filegdb/src/gdal-2.2/ogr'
make: *** [GNUmakefile:73: ogr-target] Error 2

Change History (7)

comment:1 by Even Rouault, 7 years ago

I have tried on Ubuntu 16.04 with a self compiled mariadb 10.1.23 and cannot reproduce a build error. What is your OS and compiler version ?

Note that r38625 is on trunk, not on 2.2 branch

in reply to:  1 comment:2 by saultdon, 7 years ago

Replying to Even Rouault:

I have tried on Ubuntu 16.04 with a self compiled mariadb 10.1.23 and cannot reproduce a build error. What is your OS and compiler version ?

I have Arch Linux 64-bit

Linux archasus 4.11.2-1-ARCH #1 SMP PREEMPT Mon May 22 06:53:49 CEST 2017 x86_64 GNU/Linux

And the compiler is gcc 6.3.1

Note that r38625 is on trunk, not on 2.2 branch

Ah, maybe when makepkg (the build utility on arch linux) grabs the revision number it's using the trunk revision number but I do build from https://svn.osgeo.org/gdal/branches/2.2/gdal

I rebuilt mariadb just in case, but still get same error.

comment:3 by Even Rouault, 7 years ago

Maybe you can try adding #include "cpl_port.h" at top of ogr/ogrsf_frmts/mysql/ogr_mysql.h ? (just below #define OGR_MYSQL_H_INCLUDED )

in reply to:  3 comment:4 by saultdon, 7 years ago

Replying to Even Rouault:

Maybe you can try adding #include "cpl_port.h" at top of ogr/ogrsf_frmts/mysql/ogr_mysql.h ? (just below #define OGR_MYSQL_H_INCLUDED )

That worked - thanks! Should I close this ticket?

comment:5 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 38630:

MySQL: fix compilation issue with Arch Linux and mariadb 10.1.23 (fixes #6899)

comment:6 by Even Rouault, 7 years ago

In 38631:

MySQL: fix compilation issue with Arch Linux and mariadb 10.1.23 (fixes #6899)

comment:7 by Even Rouault, 7 years ago

Milestone: 2.2.1
Note: See TracTickets for help on using tickets.