Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#59007 closed defect (fixed)

mariadb-10.2: error: use of undeclared identifier 'finite'; did you mean 'isfinite'?

Reported by: iefdev (Eric F) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: mariadb-10.2

Description

Since +openssl was removed from 10.1, I wanted to install 10.2. It almost finished, but failed at the end.

I have clang-5.0 as my default compiler (Lion). And it said:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.2/mariadb-10.2/work/mariadb-10.2.25/sql/item_func.h:244:12: error: use of undeclared identifier 'finite'; did you mean 'isfinite'?
:info:build     return isfinite(value) ? value : raise_float_overflow();
:info:build            ^
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.2/mariadb-10.2/work/mariadb-10.2.25/include/my_global.h:816:21: note: expanded from macro 'isfinite'
:info:build #define isfinite(x) finite(x)
:info:build                     ^
:info:build /opt/local/libexec/llvm-5.0/include/c++/v1/math.h:465:1: note: 'isfinite' declared here
:info:build isfinite(_A1 __lcpp_x) _NOEXCEPT
:info:build ^
:info:build [ 97%] Building CXX object storage/spider/CMakeFiles/spider.dir/spd_conn.cc.o

Same on clang-{6,7}.0

clang-8.0, which I started with when clang-5.0 faild, reported: error: expected unqualified-id - and stopped halfway through.

I used:

sudo port install mariadb-10.2 +openssl configure.compiler=macports-clang-8.0

…and worked my way down to 6.

Adding the logs (4)

Attachments (4)

mariadb-10.2_clang5_main.log (6.1 MB) - added by iEFdev 5 years ago.
mariadb-10.2_clang8_main.log (4.1 MB) - added by iEFdev 5 years ago.
mariadb-10.2_clang7_main.log (6.1 MB) - added by iEFdev 5 years ago.
mariadb-10.2_clang6_main.log (6.1 MB) - added by iEFdev 5 years ago.

Change History (13)

Changed 5 years ago by iEFdev

Changed 5 years ago by iEFdev

Changed 5 years ago by iEFdev

Changed 5 years ago by iEFdev

comment:1 Changed 5 years ago by kencu (Ken)

You could look at that file and see why they redefined that function name

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mariadb-10.2/mariadb-10.2/work/mariadb-10.2.25/include/my_global.h:816:21: note: expanded from macro 'isfinite'
:info:build #define isfinite(x) finite(x)

but probably I would try just disabling that #define isfinite(x) finite(x) given that you don't have finite and you do have isfinite in the first place, and see what happens.

Don't forget to run the test if you want to be real sure everything is good with your setup.

I am often surprised by the less-than-stellar test suite performance of software that builds. FYI.

comment:2 in reply to:  1 Changed 5 years ago by iEFdev

Replying to kencu:

You could look at that file and see why they redefined that function name

Thanks Ken. Here's the full code block (include/my_global.h):

#ifndef isfinite
#ifdef HAVE_FINITE
#define isfinite(x) finite(x)
#else
#define finite(x) (1.0 / fabs(x) > 0.0)
#endif /* HAVE_FINITE */
#elif (__cplusplus >= 201103L)
#include <cmath>
static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */

So, commenting out, like…

#ifndef isfinite
/* #ifdef HAVE_FINITE
#define isfinite(x) finite(x)
#else */
#define finite(x) (1.0 / fabs(x) > 0.0)
/* #endif /* HAVE_FINITE */
#elif (__cplusplus >= 201103L)
#include <cmath>
static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */

…or just 0 it?

Last edited 5 years ago by iEFdev (previous) (diff)

comment:3 Changed 5 years ago by iEFdev

Ended up removing the 2 lines instead. If it's useful - here's a patch.

  • include/my_global.h

    diff -Naurb ../mariadb-10.2.25.orig/include/my_global.h ./include/my_global.h
    old new  
    813813
    814814#ifndef isfinite
    815815#ifdef HAVE_FINITE
    816 #define isfinite(x) finite(x)
    817 #else
    818816#define finite(x) (1.0 / fabs(x) > 0.0)
    819817#endif /* HAVE_FINITE */
    820818#elif (__cplusplus >= 201103L)

<offtopic>Except that I had to use --skip-version-check when running mysql_upgrade, so it still shows 10.1.41-MariaDB</offtopic> - it seems like it installed fine now.

comment:4 Changed 5 years ago by michaelld (Michael Dickens)

Is this still an issue with the recent MariaDB-10.2 work including update to 10.2.27 ?

comment:5 Changed 5 years ago by kencu (Ken)

I just ran a quick install on my 10.6.8 / libc++ system (which I guess I will nickname: the Bulletproof Bulldozer), which is set up in a similar way, and it installed 10.2.15 without a hiccup.

So, all bueno, from my point of view:

$ port -v installed mariadb-10.2
The following ports are currently installed:
  mariadb-10.2 @10.2.25_1 (active) platform='darwin 10' archs='x86_64' date='2019-09-20T15:00:45-0700'

comment:6 Changed 5 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

@kencu: Thanks! I'm traveling so I can't test until Monday earliest ... and, honestly, it'll take me a few days to catch up after being gone for a week!

comment:7 Changed 5 years ago by michaelld (Michael Dickens)

@iEFdev: I closed this ticket as fixed. If that's not the case, please reopen and post another build log.

comment:8 in reply to:  7 Changed 5 years ago by iEFdev

Replying to michaelld:

@iEFdev: I closed this ticket as fixed. If that's not the case, please reopen and post another build log.

Thanks Michael!

The code is still in there, but it did finish the install/upgrade. 👍 (using clang5 as my default)

There were quite a few warnings though. I've kept the log incase you want/need that one later.


$ grep 'warning: ' main.log | wc -l
     116
$ grep 'warning' main.log | wc -l
     295
$ port installed mariadb-10.2
The following ports are currently installed:
  mariadb-10.2 @10.2.27_0 (active)

comment:9 Changed 5 years ago by michaelld (Michael Dickens)

@iEFdev: Great! Thanks for reporting back. Warnings are OK ... for now. I should be able to replicate your build warnings on my various OSX build systems (10.[4-5] PPC & 10.[5-15] Intel).

Note: See TracTickets for help on using tickets.