hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject [43/50] incubator-hawq git commit: HAWQ-502 Enable ORCA [#105338218]
Date Mon, 21 Mar 2016 22:02:12 GMT
HAWQ-502 Enable ORCA [#105338218]

This adds `--enable-orca` in autoconf.
This commit is the first step in fixing apache/incuabor-hawq#420 .


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

Branch: refs/heads/HAWQ-459
Commit: c67a1a43c7159eda9d5d6f70110d6db9425110f0
Parents: 1d9eb5e
Author: Jacob Frank, Jesse Zhang, Omer Arap and Xin Zhang <jzhang@pivotal.io>
Authored: Fri Mar 18 17:01:37 2016 -0700
Committer: Jacob Frank, Jesse Zhang, Omer Arap and Xin Zhang <jzhang@pivotal.io>
Committed: Fri Mar 18 17:01:37 2016 -0700

----------------------------------------------------------------------
 configure                  | 27 ---------------------------
 configure.in               | 27 ---------------------------
 src/backend/Makefile       |  6 +++---
 src/backend/gpopt/gpopt.mk | 18 +++++++++++++-----
 4 files changed, 16 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c67a1a43/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index 5135536..9dffef3 100755
--- a/configure
+++ b/configure
@@ -731,9 +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
@@ -5523,32 +5520,8 @@ 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/c67a1a43/configure.in
----------------------------------------------------------------------
diff --git a/configure.in b/configure.in
index cda7bad..13260ef 100644
--- a/configure.in
+++ b/configure.in
@@ -640,39 +640,12 @@ PGAC_ARG_BOOL(enable, orca, no, [  --enable-orca        enable Pivotal
Query Opt
 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/c67a1a43/src/backend/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 8460b76..18ed91a 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -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,9 @@ 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/c67a1a43/src/backend/gpopt/gpopt.mk
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/gpopt.mk b/src/backend/gpopt/gpopt.mk
index 6c77d2f..1fa7d81 100644
--- a/src/backend/gpopt/gpopt.mk
+++ b/src/backend/gpopt/gpopt.mk
@@ -25,6 +25,7 @@
 
 UNAME = $(shell uname)
 UNAME_P = $(shell uname -p)
+UNAME_M = $(shell uname -m)
 ARCH_OS = GPOS_$(UNAME)
 ARCH_CPU = GPOS_$(UNAME_P)
 
@@ -41,8 +42,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,12 +54,18 @@ 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 := -DGPOS_VERSION=\"$(LIBGPOS_VER)\" $(CPPFLAGS)
+override CPPFLAGS := -DGPOPT_VERSION=\"$(OPTIMIZER_VER)\" $(CPPFLAGS)
+override CPPFLAGS := -DXERCES_VERSION=\"$(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)


Mime
View raw message