timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.57k stars 881 forks source link

Build error against PostgreSQL < 11 #763

Closed devrimgunduz closed 5 years ago

devrimgunduz commented 6 years ago

Hi,

Seeing this while RPMifying 0.12.0:

PostgreSQL was built without OpenSSL support, which TimescaleDB needs for full compatibility. Please rebuild PostgreSQL using --with-openssl or if you want to continue without OpenSSL, re-run bootstrap with -DUSE_OPENSSL=0

However, PostgreSQL is compiled with openssl.

Can you please take a look?

Thanks!

RobAtticus commented 6 years ago

Hey @devrimgunduz,

Yes we noticed a problem with the way we were detecting OpenSSL support which was just fixed in #743. I think you're going to have to manually patch 0.12.1 (I think you mean that instead of 0.12.0, as that error msg was added between 0.12.0 and 0.12.1) in order to get it to successfully build.

cevin commented 5 years ago

also got this error

use git master version

amytai commented 5 years ago

@cevin are you running a version of Postgres that has OpenSSL installed?

cevin commented 5 years ago

@amytai

host # . pg_config --configure '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/10.5' '--datadir=/usr/local/share/postgresql' '--libdir=/usr/local/lib' '--sysconfdir=/usr/local/etc' '--docdir=/usr/local/Cellar/postgresql/10.5/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-ldap' '--with-openssl' '--with-pam' '--with-libxml' '--with-libxslt' '--with-icu' '--with-perl' '--with-tcl' '--with-tclconfig=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tcl.framework' '--with-uuid=e2fs' 'CC=clang' 'LDFLAGS=-L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' 'CPPFLAGS=-I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include' 'PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.13'

$ pg_ctl --version pg_ctl (PostgreSQL) 10.5

amytai commented 5 years ago

That's odd. You shouldn't be seeing this error, unless cmake is using a different pg_config than what you're using. Did you rebuild Postgres in between when you ran bootstrap on Timescale?

To verify that cmake is using the correct pg_config, can you rerun whatever bootstrap command you ran, and post the output? There should be a printed message giving the path to pg_config.

cevin commented 5 years ago

@amytai

$ ./bootstrap
Build system already initialized in ./build
Do you want to remove it (this is IMMEDIATE and PERMANENT), y/n? y
-- The C compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- TimescaleDB version 1.0.0-dev. Can be updated from version 1.0.0
-- Build type is Release
-- Install method is 'source'
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN - Success
-- Using compiler AppleClang
-- Found Git: /usr/bin/git (found version "2.17.1 (Apple Git-112)")
-- Using pg_config /usr/local/bin/pg_config
-- Compiling against PostgreSQL version 10.5
-- Install pgindent to be able to format C code: https://github.com/postgres/postgres/tree/master/src/tools/pgindent
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:286 (message):
  TimescaleDB requires OpenSSL but it wasn't found.  If you want to continue
  without OpenSSL, re-run bootstrap with `-DUSE_OPENSSL=0`

-- Configuring incomplete, errors occurred!
See also "/Users/cevin/timescaledb/build/CMakeFiles/CMakeOutput.log".

$ /usr/local/bin/pg_config --configure '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/10.5' '--datadir=/usr/local/share/postgresql' '--libdir=/usr/local/lib' '--sysconfdir=/usr/local/etc' '--docdir=/usr/local/Cellar/postgresql/10.5/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-ldap' '--with-openssl' '--with-pam' '--with-libxml' '--with-libxslt' '--with-icu' '--with-perl' '--with-tcl' '--with-tclconfig=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tcl.framework' '--with-uuid=e2fs' 'CC=clang' 'LDFLAGS=-L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' 'CPPFLAGS=-I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include' 'PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.13'

image

$ brew --version
Homebrew 1.7.6-116-gc5a3cb7
Homebrew/homebrew-core (git revision 346ca2; last commit 2018-10-06)
Homebrew/homebrew-cask (git revision 9d4f4; last commit 2018-10-06)

$ brew list
apr         lame            pcre
apr-util        libevent        pcre2
argon2          libexif         pgcli
aria2           libffi          php
aspell          libgeotiff      pkg-config
autoconf        libidn2         popt
automake        libimobiledevice    postgresql
boost           liblwgeom       proj
ccache          libogg          protobuf
cgal            libplist        protobuf-c
composer        libpng          proxychains-ng
eigen           libpq           pstree
ethereum        libsodium       pv
exif            libspatialite       python
ffmpeg          libssh          python3
freetds         libssh2         python@2
freetype        libtasn1        rbenv
freexl          libtiff         re2c
gdal            libtool         readline
gdbm            libunistring        ruby-build
geos            libusb          sbt
gettext         libvorbis       sl
giflib          libvpx          sqlite
glib            libxml2         telnet
gmp         libzip          tree
go          llvm            unixodbc
htop            lrzsz           usbmuxd
hugo            maven           webp
icu4c           mpfr            wget
ideviceinstaller    mycli           x264
ifstat          mysql           xvid
iftop           nginx           xz
imagemagick     nmap            you-get
ios-deploy      node            youtube-dl
ios-webkit-debug-proxy  nsq         zsh
iperf3          numpy           zstd
jpeg            openssl
json-c          p7zip
amytai commented 5 years ago

@cevin thanks for the detailed logs! In particular, it looks like the error message you're getting is not the same as the one listed in the title of this issue.

This error is caused by cmake not being able to find OpenSSL on some installations. You can help cmake find OpenSSL by passing the flag -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl, where I'm assuming /usr/local/opt/openssl is the path to your OpenSSL installation, based on the outputs you've shared. Go ahead and give that a try.

vigneshrajarr commented 5 years ago

@cevin I too had the same problem and got the same log. I was trying to give the OpenSSL's bin path to global $PATH variable. But as per the logs, I added /usr/local/opt/openssl (my openssl root folder) to the global variable OPENSSL_ROOT_DIR.

TimescaleDB got initialized.

What I have done :

#To update Homebrew and install OpenSSL
brew update
brew install openssl

#To add the path to global variables
vim ~/.bash_profile
export PATH="$PATH:/Library/PostgreSQL/9.6/bin" #Add this line to the file
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" #Add this line to the file
source ~/.bash_profile

./bootstrap
cevin commented 5 years ago

@amytai @vigneshrajarr it's work