Skip to content

Commit

Permalink
make it build on arm64
Browse files Browse the repository at this point in the history
Here are the commands to build on Graviton and Amazon Linux 2:

sudo yum groupinstall "Development Tools"
sudo yum install libcurl-devel openssl-devel libuuid-devel pulseaudio-libs-devel
wget https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
tar xzf cmake-3.18.0.tar.gz

cd cmake-3.18.0
./bootstrap
make
sudo make install
cd ..

git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
cd aws-sdk-cpp
mkdir sdk_build
cd sdk_build
cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_ONLY="redshift;redshift-serverless;sts"
make -j16
sudo make install
cd ../..

git clone https://github.com/aws/amazon-redshift-odbc-driver
cd amazon-redshift-odbc-driver
./build64.sh
  • Loading branch information
Sebastian Pop committed Jun 28, 2023
1 parent 37be81c commit 6747564
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/odbc/rsodbc/Release/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif

-include ../makefile.defs

LIBS_PATH := -L../../../pgclient/src/interfaces/libpq/Release -L../../../pgclient/src/port/Release -L../iam/linux/openssl/1.1.1/centos7/gcc5_5/release64/lib -L../iam/linux/aws-cpp-sdk/1.9.289/centos7/gcc5_5/release64/lib -L ../iam/linux/libcURL/7.78.0_ssl1.1.1_zlib1.2.11_threaded_resolver/centos7/gcc5_5/release64/lib
LIBS_PATH := -L../../../pgclient/src/interfaces/libpq/Release -L../../../pgclient/src/port/Release

# Add inputs and outputs from these tool invocations to the build variables

Expand Down
11 changes: 3 additions & 8 deletions src/odbc/rsodbc/Release/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

USER_OBJS :=

#LIBS := -lpq -lpgport -lpthread -lssl -lcrypto -lkrb5 -lgssapi_krb5 -lz -ldl -lrt
LIBS := -lpq -lpgport -lpthread -lkrb5 -lgssapi_krb5 -lz -ldl -lrt

AWS_SDK_LIB_PATH := ../iam/linux/aws-cpp-sdk/1.9.289/centos7/gcc5_5/release64/lib
LIBCURL_PATH := ../iam/linux/libcURL/7.78.0_ssl1.1.1_zlib1.2.11_threaded_resolver/centos7/gcc5_5/release64/lib
OPENSSL_LIB_PATH := ../iam/linux/openssl/1.1.1/centos7/gcc5_5/release64/lib

THIRD_PARTY_LIBS := $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-redshift.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-redshift-serverless.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-sts.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-core.a $(AWS_SDK_LIB_PATH)/libaws-crt-cpp.a $(AWS_SDK_LIB_PATH)/libaws-c-s3.a $(AWS_SDK_LIB_PATH)/libaws-c-auth.a $(AWS_SDK_LIB_PATH)/libaws-c-event-stream.a $(AWS_SDK_LIB_PATH)/libaws-c-http.a $(AWS_SDK_LIB_PATH)/libaws-c-mqtt.a $(AWS_SDK_LIB_PATH)/libaws-c-io.a $(AWS_SDK_LIB_PATH)/libaws-c-cal.a $(AWS_SDK_LIB_PATH)/libaws-checksums.a $(AWS_SDK_LIB_PATH)/libaws-c-compression.a $(AWS_SDK_LIB_PATH)/libaws-c-common.a $(AWS_SDK_LIB_PATH)/libs2n.a ../iam/linux/libcURL/7.78.0_ssl1.1.1_zlib1.2.11_threaded_resolver/centos7/gcc5_5/release64/lib/libcurl.a $(OPENSSL_LIB_PATH)/libssl.a $(OPENSSL_LIB_PATH)/libcrypto.a $(AWS_SDK_LIB_PATH)/libaws-c-sdkutils.a
LIBS := -lpq -lpgport -lpthread -lssl -lcrypto -lkrb5 -lgssapi_krb5 -lz -ldl -lrt -lcurl

AWS_SDK_LIB_PATH := /usr/local/lib64
THIRD_PARTY_LIBS := $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-redshift.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-redshift-serverless.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-sts.a $(AWS_SDK_LIB_PATH)/libaws-cpp-sdk-core.a $(AWS_SDK_LIB_PATH)/libaws-crt-cpp.a $(AWS_SDK_LIB_PATH)/libaws-c-s3.a $(AWS_SDK_LIB_PATH)/libaws-c-auth.a $(AWS_SDK_LIB_PATH)/libaws-c-event-stream.a $(AWS_SDK_LIB_PATH)/libaws-c-http.a $(AWS_SDK_LIB_PATH)/libaws-c-mqtt.a $(AWS_SDK_LIB_PATH)/libaws-c-io.a $(AWS_SDK_LIB_PATH)/libaws-c-cal.a $(AWS_SDK_LIB_PATH)/libaws-checksums.a $(AWS_SDK_LIB_PATH)/libaws-c-compression.a $(AWS_SDK_LIB_PATH)/libaws-c-common.a $(AWS_SDK_LIB_PATH)/libs2n.a $(AWS_SDK_LIB_PATH)/libaws-c-sdkutils.a
2 changes: 1 addition & 1 deletion src/odbc/rsodbc/rsodbc_setup/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef __VERSION_H__
#define __VERSION_H__

#define REDSHIFT_DRIVER_VERSION "2.0.0.1"
#define REDSHIFT_DRIVER_VERSION "."
#define REDSHIFT_VERSION "08.03.9111"
#define REDSHIFT_RESOURCE_VERSION "08.03.9111\0"

Expand Down
10 changes: 5 additions & 5 deletions src/odbc/rsodbc/rsversion.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define ODBC_DRIVER_VERSION "02.00.0000"
#define FILEVER 2,0,0,1
#define PRODUCTVER 2,0,0,1
#define STRFILEVER "2, 0, 0, 1\0"
#define STRPRODUCTVER "2, 0, 0, 1"
#define ODBC_DRIVER_VERSION "00.00.0000"
#define FILEVER ,,,
#define PRODUCTVER ,,,
#define STRFILEVER ", , , \0"
#define STRPRODUCTVER ", , , "
2 changes: 1 addition & 1 deletion src/pgclient/src/Makefile.global
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ CFLAGS = -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-stat
ifdef LINUX32
override CFLAGS := -m32 $(CFLAGS)
else
override CFLAGS := -m64 $(CFLAGS)
override CFLAGS := $(CFLAGS)
endif #LINUX32


Expand Down
2 changes: 1 addition & 1 deletion src/pgclient/src/interfaces/libpq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ifneq ($(PORTNAME), win32)
override CFLAGS += $(PTHREAD_CFLAGS)
endif

override CFLAGS += -DLINUX -DUSE_SSL -I../../../../odbc/rsodbc/iam/linux/openssl/1.1.1/centos7/gcc5_5/release64/include -DENABLE_GSS
override CFLAGS += -DLINUX -DUSE_SSL -DENABLE_GSS

# Need to recompile any external C files because we need
# all object files to use the same compile flags as libpq; some
Expand Down
2 changes: 1 addition & 1 deletion src/pgclient/src/port/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
LIBS += $(PTHREAD_LIBS)

override CFLAGS += -DLINUX -DUSE_SSL -I../../../odbc/rsodbc/iam/linux/openssl/1.1.1/centos7/gcc5_5/release64/include
override CFLAGS += -DLINUX -DUSE_SSL

ifdef LINUX32
override CFLAGS := -DLINUX32 $(CFLAGS)
Expand Down

0 comments on commit 6747564

Please sign in to comment.