[MDEV-6869] Error when compiling for Mac OS X 10.9 Created: 2014-10-14  Updated: 2018-01-02  Resolved: 2018-01-02

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Storage Engine - TokuDB
Affects Version/s: 10.0.14
Fix Version/s: 10.0.34, 10.2.12, 10.1.31

Type: Bug Priority: Minor
Reporter: Jorge F. Hernandez Assignee: Daniel Black
Resolution: Fixed Votes: 1
Labels: upstream
Environment:

Mac OS X 10.9


Issue Links:
Duplicate
is duplicated by MDEV-7526 TokuDB doesn't build on OS X Closed

 Description   

Hey guys,

I'm getting this error:

make[2]: *** [storage/connect/CMakeFiles/connect.dir/ha_connect.cc.o] Error 1
make[1]: *** [storage/connect/CMakeFiles/connect.dir/all] Error 2
make: *** [all] Error 2

When I try to compile Maria DB using instructions from https://mariadb.com/kb/en/mariadb/documentation/getting-started/compiling-mariadb-from-source/generic-build-instructions/

Any idea why?

Thanks.



 Comments   
Comment by Elena Stepanova [ 2014-10-14 ]

Were there any errors before? Can you provide the complete build output, or at least a considerable last part of it?

Comment by Jorge F. Hernandez [ 2014-10-14 ]

Is this good enough or do yo need more:

/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.h:70:17: warning: 
      'ARRAY::GetIntValue' hides overloaded virtual function
      [-Woverloaded-virtual]
          int   GetIntValue(int n);
                ^
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/xobject.h:53:18: note: 
      hidden overloaded virtual function 'XOBJECT::GetIntValue' declared here:
      different number of parameters (0 vs 1)
  virtual int    GetIntValue(void);
                 ^
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/ha_connect.cc:137:
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/filamdbf.h:13:
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/filamap.h:107:42: error: 
      cast from pointer to smaller type 'int' loses information
  virtual int   GetNextPos(void) {return (int)Fpos + Nrec;}
                                         ^~~~~~~~~
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/ha_connect.cc:138:
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/tabxcl.h:4:
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/tabutil.h:117:16: warning: 
      'PRXCOL::Init' hides overloaded virtual function [-Woverloaded-virtual]
          bool Init(PGLOBAL g, PTDBASE tp = NULL);
               ^
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/xobject.h:60:18: note: 
      hidden overloaded virtual function 'XOBJECT::Init' declared here:
      different number of parameters (1 vs 2)
  virtual bool   Init(PGLOBAL) {return false;}
                 ^
3 warnings and 1 error generated.
make[2]: *** [storage/connect/CMakeFiles/connect.dir/ha_connect.cc.o] Error 1
make[1]: *** [storage/connect/CMakeFiles/connect.dir/all] Error 2
make: *** [all] Error 2

Comment by Elena Stepanova [ 2014-10-14 ]

I think it should be enough, now we can see what the error was:

In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/ha_connect.cc:137:
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/filamdbf.h:13:
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/filamap.h:107:42: error: 
      cast from pointer to smaller type 'int' loses information
  virtual int   GetNextPos(void) {return (int)Fpos + Nrec;}

Comment by Olivier Bertrand [ 2014-10-14 ]

This was already fixed for MDEV-6834.

Comment by Jorge F. Hernandez [ 2014-10-14 ]

is there a patch file to correct this or do I have to wait until 10.0.15 is released?

Comment by Olivier Bertrand [ 2014-10-14 ]

No patch file but you can manually make the change in filamap.h; replace line 107 by:

  virtual int   GetNextPos(void) {return GetPos() + 1;}

Comment by Jorge F. Hernandez [ 2014-10-14 ]

I think there is still something wrong, I replaced line 107:

virtual int GetNextPos(void)

{return (int)Fpos + Nrec;}

With the one you sent me and now I'm getting this:

In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.cpp:39:
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.h:70:17: warning:
'ARRAY::GetIntValue' hides overloaded virtual function
[-Woverloaded-virtual]
int GetIntValue(int n);
^
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/xobject.h:53:18: note:
hidden overloaded virtual function 'XOBJECT::GetIntValue' declared here:
different number of parameters (0 vs 1)
virtual int GetIntValue(void);
^
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.cpp:132:26: error:
cast from pointer to smaller type 'int' loses information
par->AddValue(g, (int)parmp->Value);
^~~~~~~~~~~~~~~~~
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.cpp:193:47: warning:
implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
Value = AllocateValue(g, type, Len, prec, NULL);
~~~~~~~~~~~~~ ^~~~
false
/Users/jorge/Downloads/mariadb-10.0.14/storage/connect/array.cpp:616:44: warning:
implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
Value = AllocateValue(g, Type, Len, 0, NULL);
~~~~~~~~~~~~~ ^~~~
false
3 warnings and 1 error generated.
make[2]: *** [storage/connect/CMakeFiles/connect.dir/array.cpp.o] Error 1
make[1]: *** [storage/connect/CMakeFiles/connect.dir/all] Error 2
make: *** [all] Error 2

Comment by Olivier Bertrand [ 2014-10-15 ]

Indeed I forgot this one, sorry about that. It is a little more complicated to fix:
in global.h line 207 add an union to the declaration of PARM that becomes:

typedef struct _parm {
  union {
    void *Value;
    int   Intval;
    }; // end union
  short Type, Domain;
  PPARM Next;
  } PARM;

In filamtxt.cpp in the function AddListValue (line 280) the case for TYPE_VOID becomes:

    case TYPE_VOID:
      pp->Intval = *(int*)val;
      break;

Finally to remove your error, in array.cpp (132) the case becomes:

      case TYPE_VOID:
        // Integer stored inside pp->Value
        par->AddValue(g, parmp->Intval);
        break;

I hope this will do the job. Of course all this will be done in the new version.

Comment by Jorge F. Hernandez [ 2014-10-15 ]

Almost there, that fixed that problem at 4X%, but now at 70% I'm getting this:

In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/tokudb/ft-index/locktree/locktree.cc:99:
In file included from /Users/jorge/Downloads/mariadb-10.0.14/storage/tokudb/ft-index/locktree/locktree.h:94:
/Users/jorge/Downloads/mariadb-10.0.14/storage/tokudb/ft-index/buildheader/db.h:323:1: error: 
      empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
struct __toku_db_lsn {
^
1 error generated.
make[2]: *** [storage/tokudb/ft-index/locktree/CMakeFiles/locktree_static.dir/locktree.cc.o] Error 1
make[1]: *** [storage/tokudb/ft-index/locktree/CMakeFiles/locktree_static.dir/all] Error 2
make: *** [all] Error 2

Thanks

Comment by Elena Stepanova [ 2014-10-15 ]

Are you actually planning to use TokuDB? Maybe it's simpler to disable it entirely if you aren't?

Comment by Jorge F. Hernandez [ 2014-10-15 ]

I'm not, but since I'm using the instructions from https://mariadb.com/kb/en/mariadb/documentation/getting-started/compiling-mariadb-from-source/generic-build-instructions/ it enables it by default, even though the first thing it says is that TokuDB is not compatible with the build platform.

How can I disable it? I'm not familiar with cmake and I don't see a configure file that I could use to configure the build.

Thanks

Comment by Jorge F. Hernandez [ 2014-10-15 ]

Never mind, I found it in the same page, I'm trying now using configure with "--disable-tokudb" to see if it works.

Comment by Elena Stepanova [ 2014-10-15 ]

It's a 5.3 approach, if it doesn't work, please try to add -DWITH_TOKUDB_STORAGE_ENGINE=OFF -DWITHOUT_TOKUDB_STORAGE_ENGINE=ON to whatever else cmake options you use.

Comment by Jorge F. Hernandez [ 2014-10-15 ]

You are correct, it did not work, Thanks for the new args for the build, I'm trying them now.

Comment by Jorge F. Hernandez [ 2014-10-15 ]

That worked, thanks a million.

Comment by Elena Stepanova [ 2014-10-15 ]

You're welcome.
I'm re-opening the bug due to the last mentioned TokuDB error.

I suppose OS X is still not supported (it wasn't some time ago), but I'd expect TokuDB to be automatically disabled then.

Upd: According to Rich Prohaska, OS X is not supported indeed.

Comment by Daniel Black [ 2017-12-30 ]

looking at travis in 10.2, both tokudb and connect storage engines are being compiled ok. Close?

Generated at Thu Feb 08 07:15:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.