Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Build on macOS #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ duckdb: | .BUILD
CMAKE_BUILD_PARALLEL_LEVEL=$(or $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))),1) \
$(MAKE) -C third_party/duckdb $(BUILD_TYPE)
ifeq ($(BUILD_TYPE), debug)
gdb-add-index third_party/duckdb/build/debug/src/libduckdb.so
gdb-add-index third_party/duckdb/build/debug/src/libduckdb.dylib
endif

duckdb-fast: third_party/duckdb/build/$(BUILD_TYPE)/src/libduckdb.so | .BUILD
install -C $< build/$(BUILD_TYPE)/libduckdb.so
duckdb-fast: third_party/duckdb/build/$(BUILD_TYPE)/src/libduckdb.dylib | .BUILD
install -C $< build/$(BUILD_TYPE)/libduckdb.dylib

clean-duckdb:
$(MAKE) -C third_party/duckdb clean

third_party/duckdb/build/$(BUILD_TYPE)/src/libduckdb.so: | .BUILD
third_party/duckdb/build/$(BUILD_TYPE)/src/libduckdb.dylib: | .BUILD

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postgres prior to 16 still expects the so suffix.
It was changes in postgres/postgres@b55f62a

@$(MAKE) duckdb

# Delta
Expand Down
15 changes: 11 additions & 4 deletions Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DATA := ../../sql/pg_mooncake--0.0.1.sql
SRCS_C := $(shell cd ../../src; find * -name '*.c')
SRCS_CXX := $(shell cd ../../src; find * -name '*.cpp')
SRCS := $(SRCS_C) $(SRCS_CXX)
OBJS := $(SRCS:%=%.o) libduckdb.so libdelta.a
OBJS := $(SRCS:%=%.o) libduckdb.dylib libdelta.a
DEPS := $(SRCS:%=%.d)

REGRESS_SQL := $(shell cd ../../test/sql; find * -name '*.sql')
Expand All @@ -26,7 +26,14 @@ PG_CPPFLAGS := -I../../src \
-MMD -MP
PG_CFLAGS := $(if $(DEBUG),-ggdb3 -O0,-O2)
PG_CXXFLAGS := $(if $(DEBUG),-ggdb3 -O0,-O2) -Werror -Wno-register -Wno-sign-compare -std=c++17
SHLIB_LINK := -L. -Wl,-rpath,$(PG_LIB) -lduckdb


LDFLAGS += -framework CoreFoundation -framework Security -llz4 -stdlib=libc++ -lc++

SHLIB_LINK := -L. -Wl,-rpath,$(PG_LIB) -lduckdb $(LDFLAGS)
CXXFLAGS := -Wno-overloaded-virtual



override with_llvm := no
include $(PGXS)
Expand All @@ -35,11 +42,11 @@ include $(PGXS)

$(SRCS_C:%=%.o): %.o: ../../src/%
@mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-overloaded-virtual -stdlib=libc++ -c $< -o $@

$(SRCS_CXX:%=%.o): %.o: ../../src/%
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -Wno-overloaded-virtual -stdlib=libc++ -c $< -o $@

installcheck: installcheck-dirs

Expand Down
6 changes: 3 additions & 3 deletions src/pgduckdb/utility/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ extern "C" {
#include "pgduckdb/vendor/pg_list.hpp"
}

static constexpr char s3_filename_prefix[] = "s3://";
static constexpr char gcs_filename_prefix[] = "gs://";
static constexpr char r2_filename_prefix[] = "r2://";
// static constexpr char s3_filename_prefix[] = "s3://";
// static constexpr char gcs_filename_prefix[] = "gs://";
// static constexpr char r2_filename_prefix[] = "r2://";

/*
* Returns the relation of the copy_stmt as a fully qualified DuckDB table reference. This is done
Expand Down