hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject [03/50] incubator-hawq git commit: Support --enable-orca [#105338218]
Date Mon, 21 Mar 2016 22:01:32 GMT
Support --enable-orca [#105338218]

fix gpopt interface change
fix boost_thread to use boost_thread_mt on OSX
fix version detection using ivy.xml


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/a48600a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/a48600a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/a48600a1

Branch: refs/heads/HAWQ-459
Commit: a48600a125eed2a3da00133d6f5f8dad22d4a6a4
Parents: 29a9beb
Author: Jacob Frank <jfrank@pivotal.io>
Authored: Tue Mar 8 17:49:07 2016 -0800
Committer: C.J. Jameson <cjameson@pivotal.io>
Committed: Mon Mar 14 12:24:56 2016 -0700

----------------------------------------------------------------------
 configure                          | 34 --------------------------------
 configure.in                       | 35 ---------------------------------
 src/backend/Makefile               | 19 +++++++++---------
 src/backend/gpopt/Makefile         | 25 ++++++++++-------------
 src/backend/gpopt/gpopt.mk         | 24 ++++++++++++----------
 src/bin/gpcheckhdfs/Makefile       |  2 +-
 src/bin/gpfilesystem/hdfs/Makefile |  2 +-
 7 files changed, 36 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index 5135536..5669406 100755
--- a/configure
+++ b/configure
@@ -731,11 +731,6 @@ with_perl
 with_tcl
 enable_thread_safety
 INCLUDES
-ORCA_DEPENDS_OPTIMIZER_VER
-ORCA_DEPENDS_LIBGPOS_VER
-ORCA_DEPENDS_XERCES_VER
-ORCA_DEPENDS_OBJDIR_DEFAULT
-ORCA_DEPENDS_DIR_INTER
 enable_orca
 enable_email
 enable_gphdfs
@@ -5522,35 +5517,6 @@ fi
 
 
 
-if test "$enable_orca" = yes ; then
-
-	if test -z "$ORCA_DEPENDS_DIR" ; then
-		as_fn_error $? "orca is enabled but ORCA_DEPENDS_DIR is not set" "$LINENO" 5]
-	fi
-
-	if test -z "$ORCA_OBJDIR_DEFAULT" ; then
-		as_fn_error $? "orca is enabled but ORCA_OBJDIR_DEFAULT is not set" "$LINENO" 5]
-	fi
-
-	if test -z "$XERCES_VER" ; then
-		as_fn_error $? "orca is enabled but XERCES_VER is not set" "$LINENO" 5]
-	fi
-
-	if test -z "$LIBGPOS_VER" ; then
-		as_fn_error $? "orca is enabled but LIBGPOS_VER is not set" "$LINENO" 5]
-	fi
-
-	if test -z "$OPTIMIZER_VER" ; then
-		as_fn_error $? "orca is enabled but OPTIMIZER_VER is not set" "$LINENO" 5]
-	fi
-
-    ORCA_DEPENDS_DIR_INTER="$ORCA_DEPENDS_DIR"
-    ORCA_DEPENDS_OBJDIR_DEFAULT="$ORCA_OBJDIR_DEFAULT"
-    ORCA_DEPENDS_XERCES_VER="$XERCES_VER"
-    ORCA_DEPENDS_LIBGPOS_VER="$LIBGPOS_VER"
-    ORCA_DEPENDS_OPTIMIZER_VER="$OPTIMIZER_VER"
-fi
-
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/configure.in
----------------------------------------------------------------------
diff --git a/configure.in b/configure.in
index cda7bad..489187e 100644
--- a/configure.in
+++ b/configure.in
@@ -639,41 +639,6 @@ PGAC_ARG_BOOL(enable, orca, no, [  --enable-orca        enable Pivotal
Query Opt
                          [Define to 1 to build with Pivotal Query Optimizer. (--enable-orca)])])
 AC_SUBST(enable_orca)
 
-if test "$enable_orca" = yes ; then
-
-	if test -z "$ORCA_DEPENDS_DIR" ; then
-		AC_MSG_ERROR([orca is enabled but ORCA_DEPENDS_DIR is not set])]
-	fi
-
-	if test -z "$ORCA_OBJDIR_DEFAULT" ; then
-		AC_MSG_ERROR([orca is enabled but ORCA_OBJDIR_DEFAULT is not set])]
-	fi
-	
-	if test -z "$XERCES_VER" ; then
-		AC_MSG_ERROR([orca is enabled but XERCES_VER is not set])]
-	fi
-	
-	if test -z "$LIBGPOS_VER" ; then
-		AC_MSG_ERROR([orca is enabled but LIBGPOS_VER is not set])]
-	fi
-	
-	if test -z "$OPTIMIZER_VER" ; then
-		AC_MSG_ERROR([orca is enabled but OPTIMIZER_VER is not set])]
-	fi
-
-    ORCA_DEPENDS_DIR_INTER="$ORCA_DEPENDS_DIR"
-    ORCA_DEPENDS_OBJDIR_DEFAULT="$ORCA_OBJDIR_DEFAULT"
-    ORCA_DEPENDS_XERCES_VER="$XERCES_VER"
-    ORCA_DEPENDS_LIBGPOS_VER="$LIBGPOS_VER"
-    ORCA_DEPENDS_OPTIMIZER_VER="$OPTIMIZER_VER"
-fi
-
-AC_SUBST(ORCA_DEPENDS_DIR_INTER)
-AC_SUBST(ORCA_DEPENDS_OBJDIR_DEFAULT)
-AC_SUBST(ORCA_DEPENDS_XERCES_VER)
-AC_SUBST(ORCA_DEPENDS_LIBGPOS_VER)
-AC_SUBST(ORCA_DEPENDS_OPTIMIZER_VER)
-
 #
 # Include directories
 #

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/src/backend/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 8460b76..f462510 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -52,15 +52,15 @@ LIBS := $(filter-out -lpgport, $(LIBS)) $(LDAP_LIBS_BE) $(CONNECTEMCLIB)
 
 # The backend doesn't need everything that's in LIBS, however
 LIBS := $(filter-out -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))
-LIBS := -lprotobuf -lboost_thread -lboost_system -lboost_date_time -lstdc++ -lhdfs3 -lgsasl
-lxml2 $(LIBS)
+LIBS := -lprotobuf -lboost_thread-mt -lboost_system -lboost_date_time -lstdc++ -lhdfs3 -lgsasl
-lxml2 $(LIBS)
 
 # adding orca libraries
 ifeq ($(enable_orca),yes)
-LIBS := $(LIBS) -L$(ORCA_DEPENDS_DIR_INTER)/libgpos/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpos
-LIBS := $(LIBS) -L$(ORCA_DEPENDS_DIR_INTER)/lib -lxerces-c
-LIBS := $(LIBS) -L$(ORCA_DEPENDS_DIR_INTER)/libnaucrates/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lnaucrates
-LIBS := $(LIBS) -L$(ORCA_DEPENDS_DIR_INTER)/libgpdbcost/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpdbcost
-LIBS := $(LIBS) -L$(ORCA_DEPENDS_DIR_INTER)/libgpopt/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpopt
+LIBS := $(LIBS) -lgpos
+LIBS := $(LIBS) -lxerces-c
+LIBS := $(LIBS) -lnaucrates
+LIBS := $(LIBS) -lgpdbcost
+LIBS := $(LIBS) -lgpopt
 LIBS := $(LIBS) -L$(top_builddir)/src/backend/gpopt -ldxltranslators
 endif
 
@@ -213,9 +213,6 @@ ifeq ($(MAKE_DLL), true)
 	$(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
 endif
 endif
-ifeq ($(enable_orca),yes)
-	$(MAKE) -C gpopt install
-endif
 	$(MAKE) -C catalog install-data
 	$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
 	$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
@@ -228,6 +225,10 @@ endif
 	${INSTALL_DATA} $(srcdir)/utils/misc/etc/slaves ${sysconfdir}
 	${INSTALL_DATA} $(srcdir)/utils/misc/etc/template-hawq-site.xml ${sysconfdir}
 	${INSTALL_DATA} $(srcdir)/utils/misc/etc/gpcheck.cnf ${sysconfdir}
+ifeq ($(enable_orca), yes)
+	$(MAKE) -C gpopt $@ INSTLOC=$(DESTDIR)$(libdir)
+endif
+
 
 install-bin: postgres $(POSTGRES_IMP) installdirs
 	$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/src/backend/gpopt/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/Makefile b/src/backend/gpopt/Makefile
index b587ffd..a7ffa87 100644
--- a/src/backend/gpopt/Makefile
+++ b/src/backend/gpopt/Makefile
@@ -39,29 +39,24 @@ else
 	GPOPT_UDF_FLAGS := -shared
 endif
 
-LIBGPOS_DIR = $(ORCA_DEPENDS_DIR_INTER)/libgpos
-LIBNAUCRATES_DIR = $(ORCA_DEPENDS_DIR_INTER)/libnaucrates
-LIBGPDBCOST_DIR = $(ORCA_DEPENDS_DIR_INTER)/libgpdbcost
-LIBGPOPT_DIR = $(ORCA_DEPENDS_DIR_INTER)/libgpopt
-
 include $(top_srcdir)/src/backend/common.mk
 
 libdxltranslators.$(LDSFX): $(SUBDIROBJS) $(OBJS)
 	$(CXX) $(CXXFLAGS) $(LDLIBFLAGS) \
-	  -L$(LIBGPOS_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpos \
-	  -L$(ORCA_DEPENDS_DIR_INTER)/lib -lxerces-c \
-	  -L$(LIBNAUCRATES_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lnaucrates \
-	  -L$(LIBGPDBCOST_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpdbcost \
-	  -L$(LIBGPOPT_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpopt -lpthread -o $@ \
+	  -lgpos \
+	  -lxerces-c \
+	  -lnaucrates \
+	  -lgpdbcost \
+	  -lgpopt -lpthread -o $@ \
 	  $(SUBDIROBJS) $(OBJS)
 
 libgpoptudf.$(LDSFX): $(SUBDIROBJS)
 	$(CXX) $(CXXFLAGS) $(GPOPT_UDF_FLAGS) \
-	  -L$(ORCA_DEPENDS_DIR_INTER)/lib -lxerces-c \
-	  -L$(LIBGPOS_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpos \
-	  -L$(LIBNAUCRATES_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lnaucrates \
-	  -L$(LIBGPDBCOST_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpdbcost \
-	  -L$(LIBGPOPT_DIR)/$(ORCA_DEPENDS_OBJDIR_DEFAULT) -lgpopt \
+	  -lxerces-c \
+	  -lgpos \
+	  -lnaucrates \
+	  -lgpdbcost \
+	  -lgpopt \
 	  -o $@ ./utils/funcs.o
 
 install:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/src/backend/gpopt/gpopt.mk
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/gpopt.mk b/src/backend/gpopt/gpopt.mk
index 6c77d2f..0099667 100644
--- a/src/backend/gpopt/gpopt.mk
+++ b/src/backend/gpopt/gpopt.mk
@@ -25,6 +25,8 @@
 
 UNAME = $(shell uname)
 UNAME_P = $(shell uname -p)
+UNAME_M = $(shell uname -m)
+
 ARCH_OS = GPOS_$(UNAME)
 ARCH_CPU = GPOS_$(UNAME_P)
 
@@ -41,8 +43,9 @@ ifeq "$(BLD_TYPE)" "opt"
 	GPOPT_flags = -O3 -fno-omit-frame-pointer -g3
 endif
 
-ARCH_BIT = GPOS_64BIT
-ifeq (Darwin, $(UNAME))
+ifeq (x86_64, $(UNAME_M))
+	ARCH_BIT = GPOS_64BIT
+else
 	ARCH_BIT = GPOS_32BIT
 endif
 
@@ -52,14 +55,15 @@ else
 	ARCH_FLAGS = -m64
 endif
 
+GREP_SED_VAR = $(top_builddir)/src/backend/gpopt/ivy.xml | sed -e 's|\(.*\)rev="\(.*\)"[
]*conf\(.*\)|\2|'
+
+XERCES_VER  = $(shell grep "\"xerces-c\""   $(GREP_SED_VAR))
+LIBGPOS_VER = $(shell grep "\"libgpos\""    $(GREP_SED_VAR))
+OPTIMIZER_VER = $(shell grep "\"optimizer\""  $(GREP_SED_VAR))
+
 BLD_FLAGS = $(ARCH_FLAGS) -D$(ARCH_BIT) -D$(ARCH_CPU) -D$(ARCH_OS) $(GPOPT_flags)
 override CPPFLAGS := -fPIC $(CPPFLAGS)
 override CPPFLAGS := $(BLD_FLAGS)  $(CPPFLAGS)
-override CPPFLAGS := -DGPOS_VERSION=\"$(ORCA_DEPENDS_LIBGPOS_VER)\" $(CPPFLAGS)
-override CPPFLAGS := -DGPOPT_VERSION=\"$(ORCA_DEPENDS_OPTIMIZER_VER)\" $(CPPFLAGS)
-override CPPFLAGS := -DXERCES_VERSION=\"$(ORCA_DEPENDS_XERCES_VER)\" $(CPPFLAGS)
-override CPPFLAGS := -I $(ORCA_DEPENDS_DIR_INTER)/include $(CPPFLAGS)
-override CPPFLAGS := -I $(ORCA_DEPENDS_DIR_INTER)/libgpos/include $(CPPFLAGS)
-override CPPFLAGS := -I $(ORCA_DEPENDS_DIR_INTER)/libgpopt/include $(CPPFLAGS)
-override CPPFLAGS := -I $(ORCA_DEPENDS_DIR_INTER)/libnaucrates/include $(CPPFLAGS)
-override CPPFLAGS := -I $(ORCA_DEPENDS_DIR_INTER)/libgpdbcost/include $(CPPFLAGS)
+override CPPFLAGS := -DGPOS_VERSION=\"$(LIBGPOS_VER)\" $(CPPFLAGS)
+override CPPFLAGS := -DGPOPT_VERSION=\"$(OPTIMIZER_VER)\" $(CPPFLAGS)
+override CPPFLAGS := -DXERCES_VERSION=\"$(XERCES_VER)\" $(CPPFLAGS)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/src/bin/gpcheckhdfs/Makefile
----------------------------------------------------------------------
diff --git a/src/bin/gpcheckhdfs/Makefile b/src/bin/gpcheckhdfs/Makefile
index cd81902..0b88600 100644
--- a/src/bin/gpcheckhdfs/Makefile
+++ b/src/bin/gpcheckhdfs/Makefile
@@ -20,7 +20,7 @@ subdir = src/bin/gpcheckhdfs
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
-LIBS := -lprotobuf -lboost_thread -lboost_system -lboost_date_time -lstdc++ -lhdfs3 -lgsasl
$(LIBS)
+LIBS := -lprotobuf -lboost_thread-mt -lboost_system -lboost_date_time -lstdc++ -lhdfs3 -lgsasl
$(LIBS)
 
 OBJS=gpcheckhdfs.o 
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a48600a1/src/bin/gpfilesystem/hdfs/Makefile
----------------------------------------------------------------------
diff --git a/src/bin/gpfilesystem/hdfs/Makefile b/src/bin/gpfilesystem/hdfs/Makefile
index b0fb359..2399789 100644
--- a/src/bin/gpfilesystem/hdfs/Makefile
+++ b/src/bin/gpfilesystem/hdfs/Makefile
@@ -24,7 +24,7 @@ OBJS       = gpfshdfs.o
 
 PG_CPPFLAGS = -I$(libpq_srcdir)
 PG_LIBS = $(libpq_pgport)
-SHLIB_LINK = -lprotobuf -lboost_thread -lboost_system -lboost_date_time -lstdc++ -lhdfs3
+SHLIB_LINK = -lprotobuf -lboost_thread-mt -lboost_system -lboost_date_time -lstdc++ -lhdfs3
 
 ifdef USE_PGXS
 PGXS := $(shell pg_config --pgxs)


Mime
View raw message