
i386
).arch
arm
architecture did not work and caused the errorERROR 1: HANA connection failed: ERROR: 0: 01000 : [unixODBC][Driver Manager]Can't open lib '/Applications/sap/hdbclient/libodbcHDB.dylib' : file not found
x86
translated mode in the terminal./usr/local
for macOS Intel, /opt/homebrew
for Apple Silicon./usr/local/homebrew
.arch
sysctl -n machdep.cpu.brand_string
brew --prefix
cmake
, proj
, and sqlite
using Homebrew.brew install
likebrew install cmake
brew install proj
brew install sqlite
sqlite
installation with Homebrew==> Caveats
==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
...
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/homebrew/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/homebrew/opt/sqlite/include"
...
odbc-cpp-wrapper
is a build dependency for it.unixODBC
from Homebrew, if you haven't done so yet:brew install unixodbc
git clone https://github.com/SAP/odbc-cpp-wrapper.git
mkdir odbc-cpp-wrapper/build && cd odbc-cpp-wrapper/build
cmake
step to avoid a build error...~/ProjectsLocal/odbc-cpp-wrapper/src/odbc/internal/Odbc.h:9:10: fatal error: 'sql.h' file not found
LDFLAGS
and CXXFLAGS
to point them to unixODBC includes and libraries:export CXXFLAGS="-I$(brew --prefix)/include"
export LDFLAGS="-L$(brew --prefix)/lib"
echo ${CXXFLAGS}
echo ${LDFLAGS}
ls -l $(brew --prefix)/include | grep unixodbc
ls -l $(brew --prefix)/lib | grep unixodbc
cmake ..
grep -e -I -e -L CMakeCache.txt
cmake
for the rest of the steps instead of the make
as listed in the documentation.cmake --build .
sudo cmake --install .
unset CXXFLAGS
unset LDFLAGS
install_manifest.txt
, which included libraries/usr/local/homebrew/lib/libodbccpp_static.a
/usr/local/homebrew/lib/libodbccpp.dylib
/usr/local/homebrew/include/odbc/
./usr/local/homebrew/
depending on the configuration.build
directory...git clone https://github.com/OSGeo/gdal.git
mkdir gdal/build && cd gdal/build
git describe --tags `git rev-list --tags --max-count=1`
cmake .. \
-DSQLITE3_INCLUDE_DIR=$(brew --prefix sqlite)/include \
-DSQLITE3_LIBRARY=$(brew --prefix sqlite)/lib/libsqlite3.dylib \
-DCMAKE_INSTALL_RPATH=@loader_path/../lib \
-DOGR_ENABLE_DRIVER_HANA:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release
...
-- Found ODBC: /usr/local/homebrew/lib/libodbc.dylib found components: ODBCINST
-- Found ODBCCPP: /usr/local/homebrew/lib/libodbccpp.dylib
...
-- Enabled drivers and features and found dependency packages
-- The following features have been enabled:
...
* ogr_HANA, SAP HANA
...
-- The following OPTIONAL packages have been found:
* ODBC
Enable DB support through ODBC
* ODBCCPP
odbc-cpp library (external)
...
cmake
command:OGR_ENABLE_DRIVER_HANA
is optional, but shows you how to include (with ON
) or exclude the driver from the build. HANA driver is included in the build if its build dependency (C++ Wrapper for ODBC) is satisfied.SQLITE3_INCLUDE_DIR
and SQLITE3_LIBRARY
are pointing directly to locations of SQLite including the directory and the dynamic library file. You might remember the note above from the Homebrew installation of SQLite.$(brew --prefix sqlite)
to avoid hardcoding the location that depends on the Homebrew installation.CMAKE_INSTALL_RPATH=@loader_path/../lib
was included to avoid an error dyld[86048]: Library not loaded: @rpath/libgdal.31.dylib
I was running into using installed binaries ogrinfo
or ogr2ogr
.CMAKE_BUILD_TYPE
to avoid a self-explanatory warning Using -DCMAKE_BUILD_TYPE=Release is suggested.
received when this flag was not set.cmake --build .
sudo cmake --install .
which ogrinfo
ogrinfo --formats
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
11 | |
11 | |
10 | |
10 | |
9 | |
8 | |
8 | |
8 | |
7 |