Open sxnazirov opened 5 years ago
@sxnazirov
For successful assembly, you still need to fix the paths in this file (changed about 40 minutes ago):
cmake/FindPostgreSQL.cmake
For example, my file cmake/FindPostgreSQL.cmake
:
# - Try to find the PostgreSQL libraries
#
# POSTGRESQL_INCLUDE_DIR - PostgreSQL include directory
# POSTGRESQL_LIBRARY - PostgreSQL library
# PQ_LIBRARY - PostgreSQL PQ library
find_path(
POSTGRESQL_INCLUDE_DIR
NAMES common/base64.h common/saslprep.h common/scram-common.h common/sha2.h
PATH_SUFFIXES pgsql-11/include/server
)
find_library(
POSTGRESQL_LIBRARY
NAMES pgcommon
HINTS "/usr/pgsql-11/include/server/"
PATH_SUFFIXES pgsql-11/lib/
)
find_library(
PQ_LIBRARY
NAMES libpq.a
PATH_SUFFIXES pgsql-11/lib/
)
find_package_handle_standard_args(
POSTGRESQL
REQUIRED_VARS POSTGRESQL_LIBRARY PQ_LIBRARY POSTGRESQL_INCLUDE_DIR
)
@timlok After git pull, I tried
[root@my2 build]# cmake -DPOSTGRESQL_LIBRARY=/opt/pgpro/std-11/lib/plpgsql.so -DPOSTGRESQL_INCLUDE_DIR=/opt/pgpro/std-11/bin/ -DPQ_LIBRARY=/opt/pgpro/std-11/lib/libpq.a -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found POSTGRESQL: /opt/pgpro/std-11/lib/plpgsql.so
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k")
-- Found PAM: /usr/lib64/libpam.so
-- Use shipped libmachinarium: /var/tmp/odyssey/third_party/machinarium
-- Use shipped libkiwi: /var/tmp/odyssey/third_party/kiwi
--
-- Odyssey (version: 2262362 release)
--
-- CMAKE_BUILD_TYPE: Release
-- BUILD_DEBIAN: OFF
-- POSTGRESQL_INCLUDE_DIR: /opt/pgpro/std-11/bin
-- POSTGRESQL_LIBRARY: /opt/pgpro/std-11/lib/plpgsql.so
-- PQ_LIBRARY: /opt/pgpro/std-11/lib/libpq.a
-- USE_BORINGSSL: OFF
-- BORINGSSL_ROOT_DIR:
-- BORINGSSL_INCLUDE_DIR:
-- OPENSSL_VERSION: 1.0.2k
-- OPENSSL_ROOT_DIR:
-- OPENSSL_INCLUDE_DIR: /usr/include
-- PAM_LIBRARY: /usr/lib64/libpam.so
-- PAM_INCLUDE_DIR: /usr/include/security
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build
[root@my2 build]# make
Scanning dependencies of target libkiwi
[ 1%] Generating third_party/kiwi/kiwi/libkiwi.a
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
--
-- Kiwi: PostgreSQL protocol interaction library.
--
-- CMAKE_BUILD_TYPE: Release
-- MACHINARIUM_INCLUDE_DIRS: /var/tmp/odyssey/third_party/machinarium/sources
-- MACHINARIUM_LIBRARIES: /var/tmp/odyssey/build/third_party/machinarium/sources/libmachinarium.a
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build/third_party/kiwi
Scanning dependencies of target kw_library_static
[100%] Building C object kiwi/CMakeFiles/kw_library_static.dir/md5.c.o
Linking C static library libkiwi.a
[100%] Built target kw_library_static
[ 1%] Built target libkiwi
Scanning dependencies of target libmachinarium
[ 2%] Generating third_party/machinarium/sources/libmachinarium.a
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k")
--
-- Machinarium: Cooperative multitasking framework.
--
-- CMAKE_BUILD_TYPE: Release
-- BUILD_SHARED: OFF
-- BUILD_VALGRIND: ON
-- USE_BORINGSSL: OFF
-- BORINGSSL_ROOT_DIR:
-- BORINGSSL_INCLUDE_DIR:
-- OPENSSL_VERSION: 1.0.2k
-- OPENSSL_ROOT_DIR:
-- OPENSSL_INCLUDE_DIR: /usr/include
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build/third_party/machinarium
Scanning dependencies of target machine_library_static
[ 2%] Building C object sources/CMakeFiles/machine_library_static.dir/thread.c.o
[ 5%] Building C object sources/CMakeFiles/machine_library_static.dir/pg_rand48.c.o
[ 8%] Building C object sources/CMakeFiles/machine_library_static.dir/lrand48.c.o
[ 11%] Building C object sources/CMakeFiles/machine_library_static.dir/loop.c.o
[ 13%] Building C object sources/CMakeFiles/machine_library_static.dir/clock.c.o
[ 16%] Building C object sources/CMakeFiles/machine_library_static.dir/socket.c.o
[ 19%] Building C object sources/CMakeFiles/machine_library_static.dir/epoll.c.o
[ 22%] Building C object sources/CMakeFiles/machine_library_static.dir/context_stack.c.o
[ 25%] Building C object sources/CMakeFiles/machine_library_static.dir/context.c.o
[ 27%] Building C object sources/CMakeFiles/machine_library_static.dir/coroutine.c.o
[ 30%] Building C object sources/CMakeFiles/machine_library_static.dir/coroutine_cache.c.o
[ 33%] Building C object sources/CMakeFiles/machine_library_static.dir/scheduler.c.o
[ 36%] Building C object sources/CMakeFiles/machine_library_static.dir/call.c.o
[ 38%] Building C object sources/CMakeFiles/machine_library_static.dir/signal_mgr.c.o
[ 41%] Building C object sources/CMakeFiles/machine_library_static.dir/event_mgr.c.o
[ 44%] Building C object sources/CMakeFiles/machine_library_static.dir/machine.c.o
[ 47%] Building C object sources/CMakeFiles/machine_library_static.dir/mm.c.o
[ 50%] Building C object sources/CMakeFiles/machine_library_static.dir/machine_mgr.c.o
[ 52%] Building C object sources/CMakeFiles/machine_library_static.dir/msg_cache.c.o
[ 55%] Building C object sources/CMakeFiles/machine_library_static.dir/msg.c.o
[ 58%] Building C object sources/CMakeFiles/machine_library_static.dir/channel_fast.c.o
[ 61%] Building C object sources/CMakeFiles/machine_library_static.dir/channel.c.o
[ 63%] Building C object sources/CMakeFiles/machine_library_static.dir/channel_api.c.o
[ 66%] Building C object sources/CMakeFiles/machine_library_static.dir/task_mgr.c.o
[ 69%] Building C object sources/CMakeFiles/machine_library_static.dir/tls.c.o
[ 72%] Building C object sources/CMakeFiles/machine_library_static.dir/io.c.o
[ 75%] Building C object sources/CMakeFiles/machine_library_static.dir/iov.c.o
[ 77%] Building C object sources/CMakeFiles/machine_library_static.dir/close.c.o
[ 80%] Building C object sources/CMakeFiles/machine_library_static.dir/connect.c.o
[ 83%] Building C object sources/CMakeFiles/machine_library_static.dir/bind.c.o
[ 86%] Building C object sources/CMakeFiles/machine_library_static.dir/eventfd.c.o
[ 88%] Building C object sources/CMakeFiles/machine_library_static.dir/cond.c.o
[ 91%] Building C object sources/CMakeFiles/machine_library_static.dir/read.c.o
[ 94%] Building C object sources/CMakeFiles/machine_library_static.dir/write.c.o
[ 97%] Building C object sources/CMakeFiles/machine_library_static.dir/accept.c.o
[100%] Building C object sources/CMakeFiles/machine_library_static.dir/dns.c.o
Linking C static library libmachinarium.a
[100%] Built target machine_library_static
[ 2%] Built target libmachinarium
Scanning dependencies of target build_libs
[ 2%] Built target build_libs
Scanning dependencies of target odyssey
[ 3%] Building C object sources/CMakeFiles/odyssey.dir/daemon.c.o
In file included from /var/tmp/odyssey/sources/odyssey.h:34:0,
from /var/tmp/odyssey/sources/daemon.c:24:
/var/tmp/odyssey/sources/postgres.h:27:27: fatal error: common/base64.h: No such file or directory
#include <common/base64.h>
^
compilation terminated.
make[2]: *** [sources/CMakeFiles/odyssey.dir/daemon.c.o] Error 1
make[1]: *** [sources/CMakeFiles/odyssey.dir/all] Error 2
make: *** [all] Error 2
[root@my2 build]#
@sxnazirov I think the problem is that POSTGRESQL_INCLUDE_DIR: /opt/pgpro/std-11/bin this var should point to include dir, not bin.
We definitely need to make build more portable.
@x4m Thanks, I will try
@x4m I changed the POSTGRESQL_INCLUDE_DIR and tried again
[root@my2 odyssey]# mkdir build
[root@my2 odyssey]# cd build/
[root@my2 build]# cmake -DPOSTGRESQL_LIBRARY=/opt/pgpro/std-11/lib/plpgsql.so -DPOSTGRESQL_INCLUDE_DIR=/opt/pgpro/std-11/include/ -DPQ_LIBRARY=/opt/pgpro/std-11/lib/libpq.a -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found POSTGRESQL: /opt/pgpro/std-11/lib/plpgsql.so
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k")
-- Found PAM: /usr/lib64/libpam.so
-- Use shipped libmachinarium: /var/tmp/odyssey/third_party/machinarium
-- Use shipped libkiwi: /var/tmp/odyssey/third_party/kiwi
--
-- Odyssey (version: 2262362 release)
--
-- CMAKE_BUILD_TYPE: Release
-- BUILD_DEBIAN: OFF
-- POSTGRESQL_INCLUDE_DIR: /opt/pgpro/std-11/include
-- POSTGRESQL_LIBRARY: /opt/pgpro/std-11/lib/plpgsql.so
-- PQ_LIBRARY: /opt/pgpro/std-11/lib/libpq.a
-- USE_BORINGSSL: OFF
-- BORINGSSL_ROOT_DIR:
-- BORINGSSL_INCLUDE_DIR:
-- OPENSSL_VERSION: 1.0.2k
-- OPENSSL_ROOT_DIR:
-- OPENSSL_INCLUDE_DIR: /usr/include
-- PAM_LIBRARY: /usr/lib64/libpam.so
-- PAM_INCLUDE_DIR: /usr/include/security
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build
[root@my2 build]# make
Scanning dependencies of target libkiwi
[ 1%] Generating third_party/kiwi/kiwi/libkiwi.a
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
--
-- Kiwi: PostgreSQL protocol interaction library.
--
-- CMAKE_BUILD_TYPE: Release
-- MACHINARIUM_INCLUDE_DIRS: /var/tmp/odyssey/third_party/machinarium/sources
-- MACHINARIUM_LIBRARIES: /var/tmp/odyssey/build/third_party/machinarium/sources/libmachinarium.a
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build/third_party/kiwi
Scanning dependencies of target kw_library_static
[100%] Building C object kiwi/CMakeFiles/kw_library_static.dir/md5.c.o
Linking C static library libkiwi.a
[100%] Built target kw_library_static
[ 1%] Built target libkiwi
Scanning dependencies of target libmachinarium
[ 2%] Generating third_party/machinarium/sources/libmachinarium.a
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k")
--
-- Machinarium: Cooperative multitasking framework.
--
-- CMAKE_BUILD_TYPE: Release
-- BUILD_SHARED: OFF
-- BUILD_VALGRIND: ON
-- USE_BORINGSSL: OFF
-- BORINGSSL_ROOT_DIR:
-- BORINGSSL_INCLUDE_DIR:
-- OPENSSL_VERSION: 1.0.2k
-- OPENSSL_ROOT_DIR:
-- OPENSSL_INCLUDE_DIR: /usr/include
--
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/odyssey/build/third_party/machinarium
Scanning dependencies of target machine_library_static
[ 2%] Building C object sources/CMakeFiles/machine_library_static.dir/thread.c.o
[ 5%] Building C object sources/CMakeFiles/machine_library_static.dir/pg_rand48.c.o
[ 8%] Building C object sources/CMakeFiles/machine_library_static.dir/lrand48.c.o
[ 11%] Building C object sources/CMakeFiles/machine_library_static.dir/loop.c.o
[ 13%] Building C object sources/CMakeFiles/machine_library_static.dir/clock.c.o
[ 16%] Building C object sources/CMakeFiles/machine_library_static.dir/socket.c.o
[ 19%] Building C object sources/CMakeFiles/machine_library_static.dir/epoll.c.o
[ 22%] Building C object sources/CMakeFiles/machine_library_static.dir/context_stack.c.o
[ 25%] Building C object sources/CMakeFiles/machine_library_static.dir/context.c.o
[ 27%] Building C object sources/CMakeFiles/machine_library_static.dir/coroutine.c.o
[ 30%] Building C object sources/CMakeFiles/machine_library_static.dir/coroutine_cache.c.o
[ 33%] Building C object sources/CMakeFiles/machine_library_static.dir/scheduler.c.o
[ 36%] Building C object sources/CMakeFiles/machine_library_static.dir/call.c.o
[ 38%] Building C object sources/CMakeFiles/machine_library_static.dir/signal_mgr.c.o
[ 41%] Building C object sources/CMakeFiles/machine_library_static.dir/event_mgr.c.o
[ 44%] Building C object sources/CMakeFiles/machine_library_static.dir/machine.c.o
[ 47%] Building C object sources/CMakeFiles/machine_library_static.dir/mm.c.o
[ 50%] Building C object sources/CMakeFiles/machine_library_static.dir/machine_mgr.c.o
[ 52%] Building C object sources/CMakeFiles/machine_library_static.dir/msg_cache.c.o
[ 55%] Building C object sources/CMakeFiles/machine_library_static.dir/msg.c.o
[ 58%] Building C object sources/CMakeFiles/machine_library_static.dir/channel_fast.c.o
[ 61%] Building C object sources/CMakeFiles/machine_library_static.dir/channel.c.o
[ 63%] Building C object sources/CMakeFiles/machine_library_static.dir/channel_api.c.o
[ 66%] Building C object sources/CMakeFiles/machine_library_static.dir/task_mgr.c.o
[ 69%] Building C object sources/CMakeFiles/machine_library_static.dir/tls.c.o
[ 72%] Building C object sources/CMakeFiles/machine_library_static.dir/io.c.o
[ 75%] Building C object sources/CMakeFiles/machine_library_static.dir/iov.c.o
[ 77%] Building C object sources/CMakeFiles/machine_library_static.dir/close.c.o
[ 80%] Building C object sources/CMakeFiles/machine_library_static.dir/connect.c.o
[ 83%] Building C object sources/CMakeFiles/machine_library_static.dir/bind.c.o
[ 86%] Building C object sources/CMakeFiles/machine_library_static.dir/eventfd.c.o
[ 88%] Building C object sources/CMakeFiles/machine_library_static.dir/cond.c.o
[ 91%] Building C object sources/CMakeFiles/machine_library_static.dir/read.c.o
[ 94%] Building C object sources/CMakeFiles/machine_library_static.dir/write.c.o
[ 97%] Building C object sources/CMakeFiles/machine_library_static.dir/accept.c.o
[100%] Building C object sources/CMakeFiles/machine_library_static.dir/dns.c.o
Linking C static library libmachinarium.a
[100%] Built target machine_library_static
[ 2%] Built target libmachinarium
Scanning dependencies of target build_libs
[ 2%] Built target build_libs
Scanning dependencies of target odyssey
[ 3%] Building C object sources/CMakeFiles/odyssey.dir/daemon.c.o
In file included from /var/tmp/odyssey/sources/odyssey.h:34:0,
from /var/tmp/odyssey/sources/daemon.c:24:
/var/tmp/odyssey/sources/postgres.h:27:27: fatal error: common/base64.h: No such file or directory
#include <common/base64.h>
^
compilation terminated.
make[2]: *** [sources/CMakeFiles/odyssey.dir/daemon.c.o] Error 1
make[1]: *** [sources/CMakeFiles/odyssey.dir/all] Error 2
make: *** [all] Error 2
[root@my2 build]#
Solution to the problem:
cmake3 -DPOSTGRESQL_LIBPGPORT=/usr/pgsql-10/lib/libpgport.a -DPOSTGRESQL_LIBRARY=/usr/pgsql-10/lib/libpq.so -DPOSTGRESQL_INCLUDE_DIR=/usr/pgsql-10/include/server -DPQ_LIBRARY=/usr/pgsql-10/lib/libpq.a -DCMAKE_BUILD_TYPE=Release ..
Trying to build on CentOS7 on dev machine getting this error.
OS Info: Linux my2 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux GNU/Linux
Steps to reproduce: