[
https://issues.apache.org/jira/browse/MADLIB-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15336342#comment-15336342
]
Heikki Linnakangas commented on MADLIB-1005:
--------------------------------------------
The problem here is the AggCheckCallContext function. It was introduced in
PostgreSQL 9.0. It hasn't existed in GPDB, as it's based on 8.2 for all
released versions. Because Madlib needs it, Madlib has implemented it itself in
src/ports/postgres/dbconnector/Compatibility.hpp.
In April, however, that function was backported to GPDB's master branch. So
GPDB 5.0 will have it. See
https://github.com/greenplum-db/gpdb/commit/0d748d9bcc9da728027f076da598924709acd475.
That broke Madlib, because Madlib's version of the function now clashes with
GPDB's.
To fix, Madlib's version of AggCheckCallContext should be inside a suitable
#ifdef block, so that it's only used when building with GPDB 4.3 and older, and
with GPDB 5.0, it uses the GPDB version instead. I'm not familiar how such
version #ifdefs are handled in Madlib, but there must be plenty in the source
tree to use as example.
> Cannot compile for greenplum (arch linux)
> -----------------------------------------
>
> Key: MADLIB-1005
> URL: https://issues.apache.org/jira/browse/MADLIB-1005
> Project: Apache MADlib
> Issue Type: Bug
> Components: Build System
> Reporter: Aleksandr Melnyk
>
> In file included from
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/../../postgres/dbconnector/dbconnector.hpp:272:0,
> from
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/dbconnector.hpp:35,
> from
> /home/gpadmin/incubator-madlib/src/modules/sample/weighted_sample.cpp:9:
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/../../postgres/dbconnector/AnyType_impl.hpp:
> In member function 'madlib::dbconnector::postgres::AnyType
> madlib::dbconnector::postgres::AnyType::operator[](uint16_t) const':
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/../../postgres/dbconnector/AnyType_impl.hpp:325:57:
> error: call of overloaded 'AggCheckCallContext(FunctionCallInfoData* const&,
> NULL)' is ambiguous
> isMutable = AggCheckCallContext(fcinfo, NULL);
> ^
> In file included from
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/dbconnector.hpp:33:0,
> from
> /home/gpadmin/incubator-madlib/src/modules/sample/weighted_sample.cpp:9:
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/Compatibility.hpp:61:1:
> note: candidate: int
> madlib::dbconnector::postgres::{anonymous}::AggCheckCallContext(FunctionCallInfo,
> MemoryContextData**)
> AggCheckCallContext(FunctionCallInfo fcinfo, MemoryContext *aggcontext) {
> ^~~~~~~~~~~~~~~~~~~
> In file included from
> /usr/local/projects/custom_builds/gpdb.master/include/postgresql/server/funcapi.h:19:0,
> from
> /home/gpadmin/incubator-madlib/src/ports/greenplum/dbconnector/dbconnector.hpp:17,
> from
> /home/gpadmin/incubator-madlib/src/modules/sample/weighted_sample.cpp:9:
> /usr/local/projects/custom_builds/gpdb.master/include/postgresql/server/fmgr.h:584:12:
> note: candidate: int AggCheckCallContext(FunctionCallInfo,
> MemoryContextData**)
> extern int AggCheckCallContext(FunctionCallInfo fcinfo,
> ^~~~~~~~~~~~~~~~~~~
> src/ports/greenplum/4.3ORCA/CMakeFiles/madlib_greenplum_4_3ORCA.dir/build.make:62:
> recipe for target
> 'src/ports/greenplum/4.3ORCA/CMakeFiles/madlib_greenplum_4_3ORCA.dir/__/__/__/modules/sample/weighted_sample.cpp.o'
> failed
> make[2]: ***
> [src/ports/greenplum/4.3ORCA/CMakeFiles/madlib_greenplum_4_3ORCA.dir/__/__/__/modules/sample/weighted_sample.cpp.o]
> Error 1
> CMakeFiles/Makefile2:728: recipe for target
> 'src/ports/greenplum/4.3ORCA/CMakeFiles/madlib_greenplum_4_3ORCA.dir/all'
> failed
> make[1]: ***
> [src/ports/greenplum/4.3ORCA/CMakeFiles/madlib_greenplum_4_3ORCA.dir/all]
> Error 2
> Makefile:149: recipe for target 'all' failed
> make: *** [all] Error 2
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)