Repository: hawq
Updated Branches:
  refs/heads/master 37c7a22a2 -> 78c843151


HAWQ-1674. Add support for compiling CPP projects in orc_format.
        add cwrapper.cpp to generate interface code for C/C++ link.
        changed Makefile to support cpp compiling.


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

Branch: refs/heads/master
Commit: 78c84315106ea34c451be4e2315605d81a12ec9f
Parents: 37c7a22
Author: ion2014 <[email protected]>
Authored: Fri Nov 9 15:19:11 2018 +0800
Committer: Ruilong Huo <[email protected]>
Committed: Mon Nov 12 16:52:08 2018 +0800

----------------------------------------------------------------------
 contrib/orc/Makefile                       | 12 ++++++---
 contrib/orc/cwrapper/Makefile              |  7 +++++
 contrib/orc/cwrapper/cwrapper.c            | 18 -------------
 contrib/orc/cwrapper/cwrapper.cpp          | 30 +++++++++++++++++++++
 contrib/orc/cwrapper/cwrapper.h            | 35 +++++++++++++++++++++++++
 contrib/orc/cwrapper/format/Makefile       |  6 +++++
 contrib/orc/cwrapper/format/orc_format.cpp | 22 ++++++++++++++++
 contrib/orc/cwrapper/format/orc_format.h   | 19 ++++++++++++++
 contrib/orc/format/orc_format.c            | 18 -------------
 9 files changed, 128 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/Makefile
----------------------------------------------------------------------
diff --git a/contrib/orc/Makefile b/contrib/orc/Makefile
index fb6854a..9938d74 100644
--- a/contrib/orc/Makefile
+++ b/contrib/orc/Makefile
@@ -16,12 +16,11 @@
 # under the License.
 #
 MODULE_big = orc
-OBJS       = cwrapper/cwrapper.o format/orc_format.o orc.o
+OBJS       = cwrapper/cwrapper.o orc.o
 
 PG_CPPFLAGS = -I$(libpq_srcdir)
 PG_LIBS = $(libpq_pgport)
 
-
 ifdef USE_PGXS
 PGXS := $(shell pg_config --pgxs)
 include $(PGXS)
@@ -30,4 +29,11 @@ subdir = contrib/orc
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
-endif
\ No newline at end of file
+endif
+
+clean distclean:
+       $(MAKE) -C cwrapper $@ || true;
+       rm -f orc.o orc.so
+
+cwrapper/cwrapper.o:
+       $(MAKE) -C cwrapper cwrapper.o

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/Makefile
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/Makefile b/contrib/orc/cwrapper/Makefile
new file mode 100644
index 0000000..d731af8
--- /dev/null
+++ b/contrib/orc/cwrapper/Makefile
@@ -0,0 +1,7 @@
+cwrapper.o: cwrapper.cpp cwrapper.h
+       $(MAKE) -C format liborc_format.so
+       g++ --shared -o cwrapper.o cwrapper.cpp -Lformat -lorc_format 
+
+clean distclean:
+       $(MAKE) -C format $@ || true;
+       rm -f ./cwrapper.o
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/cwrapper.c
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/cwrapper.c b/contrib/orc/cwrapper/cwrapper.c
deleted file mode 100644
index 7220975..0000000
--- a/contrib/orc/cwrapper/cwrapper.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/cwrapper.cpp
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/cwrapper.cpp 
b/contrib/orc/cwrapper/cwrapper.cpp
new file mode 100644
index 0000000..f7a6376
--- /dev/null
+++ b/contrib/orc/cwrapper/cwrapper.cpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <uuid/uuid.h>
+#include "format/orc_format.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+  void wrap_func_test(){
+    func_test();
+  }
+#ifdef __cplusplus
+}
+#endif

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/cwrapper.h
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/cwrapper.h b/contrib/orc/cwrapper/cwrapper.h
new file mode 100644
index 0000000..4151265
--- /dev/null
+++ b/contrib/orc/cwrapper/cwrapper.h
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef STORAGE_SRC_STORAGE_CWRAPPER_ORC_FORMAT_C_H_
+#define STORAGE_SRC_STORAGE_CWRAPPER_ORC_FORMAT_C_H_
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef ERROR_MESSAGE_BUFFER_SIZE
+#define ERROR_MESSAGE_BUFFER_SIZE 4096
+#endif
+  void wrap_func_test();
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // STORAGE_SRC_STORAGE_CWRAPPER_ORC_FORMAT_C_H_
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/format/Makefile
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/format/Makefile 
b/contrib/orc/cwrapper/format/Makefile
new file mode 100644
index 0000000..cc896f8
--- /dev/null
+++ b/contrib/orc/cwrapper/format/Makefile
@@ -0,0 +1,6 @@
+All: orc_format.so
+liborc_format.so: orc_format.cpp
+       g++ --shared -o liborc_format.so orc_format.cpp
+
+clean:
+       rm -f ./liborc_format.so
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/format/orc_format.cpp
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/format/orc_format.cpp 
b/contrib/orc/cwrapper/format/orc_format.cpp
new file mode 100644
index 0000000..d1bdbb8
--- /dev/null
+++ b/contrib/orc/cwrapper/format/orc_format.cpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "../cwrapper.h"
+void func_test(){
+
+}

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/cwrapper/format/orc_format.h
----------------------------------------------------------------------
diff --git a/contrib/orc/cwrapper/format/orc_format.h 
b/contrib/orc/cwrapper/format/orc_format.h
new file mode 100644
index 0000000..c05746d
--- /dev/null
+++ b/contrib/orc/cwrapper/format/orc_format.h
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+void func_test();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hawq/blob/78c84315/contrib/orc/format/orc_format.c
----------------------------------------------------------------------
diff --git a/contrib/orc/format/orc_format.c b/contrib/orc/format/orc_format.c
deleted file mode 100644
index 7220975..0000000
--- a/contrib/orc/format/orc_format.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
\ No newline at end of file

Reply via email to