Bugs item #2833831, was opened at 2009-08-07 19:36
Message generated for change (Comment added) made by stmane
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2833831&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Mapi
Group: Clients CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Nobody/Anonymous (nobody)
Summary: mapilib/Mapi.h missing HAVE_LONG_LONG

Initial Comment:
/opt/monetdb-head/include/MonetDB/mapilib/Mapi.h:182: error: expected 
declaration specifiers or '...' before 'mapi_int64'
/opt/monetdb-head/include/MonetDB/mapilib/Mapi.h:186: error: expected '=', ',', 
';', 'asm' or '__attribute__' before 'mapi_fetch_all_rows'
/opt/monetdb-head/include/MonetDB/mapilib/Mapi.h:188: error: expected '=', ',', 
';', 'asm' or '__attribute__' before 'mapi_get_row_count'
/opt/monetdb-head/include/MonetDB/mapilib/Mapi.h:189: error: expected '=', ',', 
';', 'asm' or '__attribute__' before 'mapi_get_last_id'
/opt/monetdb-head/include/MonetDB/mapilib/Mapi.h:190: error: expected '=', ',', 
';', 'asm' or '__attribute__' before 'mapi_rows_affected'

It seems HAVE_LONG_LONG is not defined. Thus the compilation of client programs 
break.

----------------------------------------------------------------------

>Comment By: Stefan Manegold (stmane)
Date: 2009-08-12 22:19

Message:
Ok, the following patch might do the trick --- before checking it in, I'd
like to (have) verif(y|ied), though, that it indeed makes sense to assume
that (all) Windows compilers provide type __int64, while (all) Unix
compilers provide type long long ...

$ cvs diff clients/src/mapilib/Mapi.mx
Index: clients/src/mapilib/Mapi.mx
===================================================================
RCS file: /cvsroot/monetdb/clients/src/mapilib/Mapi.mx,v
retrieving revision 1.79.2.2
diff -u -r1.79.2.2 Mapi.mx
--- clients/src/mapilib/Mapi.mx 6 Aug 2009 07:03:15 -0000       1.79.2.2
+++ clients/src/mapilib/Mapi.mx 12 Aug 2009 20:09:24 -0000
@@ -1120,6 +1120,10 @@
 
 /* avoid using "#ifdef WIN32" so that this file does not need our
config.h */
 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+#if defined(__ICL) && __ICL >= 1010
+#define HAVE_LONG_LONG 1
+#endif
+#define HAVE___INT64 1
 #ifndef LIBMAPI
 #define mapi_export extern __declspec(dllimport)
 #else
@@ -1127,6 +1131,7 @@
 #endif
 #else
 #define mapi_export extern
+#define HAVE_LONG_LONG 1
 #endif
 


----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-08-11 18:46

Message:
The major point is actually a few lines above:
/* avoid using "#ifdef WIN32" so that this file does not need our config.h
*/

So adding the actual platform check inside the headerfile would be an
effective solution. Or making the header file platform specific. Removing
all ifdefs and providing only a header for that specific MonetDB
installation. Since the actual data files are not portable between
platforms why should the header file be? 

Anyway this piece was somewhere on a forum, and has resemblance with what
is already there:

#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ulong64;
typedef signed __int64 long64;
#else
typedef unsigned long long ulong64;
typedef signed long long long64;
#endif

The main point now: there is no else, that makes it break when nothing is
defined.

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-08-11 18:22

Message:
Until we re-design our code base and setup to ensure portability to oh so
many different platforms, I'm afraid with MonetDB we have to live with the
situation as it is now.

Any detailed constructive ideas and/or hand-on help to simplify things
while keeping the functionality and (in this case) portability (at least)
as-is are more than welcome.


----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-08-11 18:11

Message:
In my perspective such 'innovations' are not required my programming
against MySQL or PostgreSQL. Including a single header is enough to target
their client interface. Just including <monetdb.h> or <mapi.h> is so much
more userfriendly...

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-08-11 15:18

Message:
... of course, if your are compiling clients from sources, and you don't
have/want your own separate project source tree, and you don't mind
changing your CVS checkout or untared sources of clients locally, you can
also simply put your own client programs into some sub-directory in the
clients tree, alter the related Makefile.ag's (if CVS checkout) or
Makefile.in's (if untared source) accordingly, and then simply include the
clients clients_config.h ...


----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-08-11 15:13

Message:
clients_config.h is created by configure, hence is cannot be "installed",
since it has to reflect the environment of the machine you are compiling
on, not the machine the release was built on.

The type to be used in this case is the very 64-bit integer type that your
platform provides; hence, your configure needs to tell Mapi.h (via your
X_config.h) which 64-bit integer type your platform has.

I agree that we should document this in the Mapi documentation
accordingly, once (before) we release the Aug2009 release.


----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-08-11 14:56

Message:
'Client programs' are ambigious I agree. Anyway this 'change' ought to be
documented. At least in the next changelog, because such configuration was
not a requirement before. And I think the same type should be used, so the
previously mentioned client(s)_config.h should be installed?

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-08-11 14:48

Message:
Ah, it's about other client programs (than those provided with the MonetDB
code base) that use Mapi.h --- sorry, I didn't get this ...

Well, the proper solution would IMHO be to create a setup for your project
X that is similar to the standard MonetDB setup, in particular also coming
with a configure in a "MonetDB style", that checks the cofniguration of
your platform and creates its own X_config.h accordingly. Your client
programs should then include this X_config.h as the very first include, and
thsuu before including Mapi.h.

See our "template" CVS module for a sample "template" starting point for
your project X setup.


----------------------------------------------------------------------

Comment By: Stefan de Konink (skinkie)
Date: 2009-08-11 14:38

Message:
Projectmembers of your team are aware of the issue, since more people
complained privately. It is unrelated to the compilation of MonetDB, but it
hits for anyone that does external development. Now I have heard yesterday
that it would be solved by including client(s)_config.h but since this
header is not installed, there is nothing to include.

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-08-11 14:16

Message:
Compilation of clients seems to work fine on all our nightly testing
platforms, both with th Aug2009 release branch ("Stable") and the
development trunk (CVS HEAD, "Current"):
http://monetdb.cwi.nl/testing/projects/monetdb/Stable/clients/.Makes3/index_short.html
http://monetdb.cwi.nl/testing/projects/monetdb/Current/clients/.Makes3/index_short.html

Could you please give more details about which client programs fail to
compile in which environment (OS, compiler, MonetDB version)?

Thanks!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2833831&group_id=56967

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to