https://github.com/jaiminpan/pg_jieba
先执行 pg_config
跟着安装,发送错误
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting pg_jieba build type -
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
version "10.0")
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.5/Modules/FindPostgreSQL.cmake:180 (find_package_handle_standard_args)
CMakeLists.txt:11 (find_package)
少了 include , 根据 pg_config 的输出 INCLUDEDIR-SERVER = /usr/include/postgresql/10/server
手机添加参数: cmake -DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/10/server ..
解决问题。
接着 make
接着。。。
make install
[100%] Built target pg_jieba
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/postgresql/10/lib/pg_jieba.so
CMake Error at cmake_install.cmake:50 (file):
file INSTALL cannot copy file "/home/xxx/pgsql/pg_jieba/build/pg_jieba.so"
to "/usr/lib/postgresql/10/lib/pg_jieba.so".
Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1
估计没权限 sudo make install
解决问题