Linking Executable sortshp encountered an error while making mapserver.

Asked 1 years ago, Updated 1 years ago, 122 views

Hello, when I tried to make a mapserver in the following environment, an error occurred and I am having trouble solving it.
Please give me some advice.

■ OS
CentOS Linux release 8.2.2004 (Core)

■ PostgreSQL

Name: postgresql12-server
Version: 12.3
Release: 5PGDG.rhel 8
Arch: x86_64
Size: 20M
Source: postgresql12-12.3-5PGDG.rhel8.src.rpm
repository:@System
from repo:pgdg12

■ PostGIS

Name: postgis30_12
Version: 3.0.1
Release: 5.rhel 8
Arch: x86_64
Size: 33M
Source: postgis30_12-3.0.1-5.rhel8.src.rpm
repository:@System
from repo:pgdg12

All other libraries required for mapserver are installed in yum.

■GDAL

 yum --enablerepo=epel, PowerTools install gdal gdal-develop

■PROJ

dnf install proj proj-develop

■ libpng

dnf install libpng libpng-devel

■FreeType

 yum-y install freetype freetype-develop

■ libjpeg

 yum-y install libjpeg libjpeg-develop

■zlib

 yum-y install zlib zlib-develop

■ libcurl

 yum install libcurl libcurl-develop

■ FRIBIDI

 yum install fribidi-develop

■PROTOBUF

 yum install protobuf protobuf-develop

■libtiff

 yum install libtiff libtiff-develop

■GEOS

yum install --enablerepo=epel, PowerTools geos geos-develop

■ libxml

 yum install libxml2 libxml2-develop

■ libgif

 yum install giflib giflib-develop

■ FastCGI

 yum install fcgi fcgi-develop

■Cairo

 yum install cairo-develop

■ XSLT

 yum install libxslt libxslt-develop

■Mapserver is built in cmake as follows.

 tar xzvf mapserver-7.6.0.tar.gz
cd mapserver-7.6.0/
mkdir build
cd build

cmake-DCMAKE_INSTALL_PREFIX=/opt-DCMAKE_PREFIX_PATH="/usr/pgsql-12/bin"-DWITH_PHP=ON-DWITH_CURL=ON-DWITH_CLIENT_WFS=ON-DWITH_CLIENT_WMS=ON-DWITH_KML=ON-DWITH_ON-DWITH_ON-DWITH=ON-DWITH_POSLITONTOON-DWITH=ON-DWITH_POSTON-DWITH_P

■cmake Results

 -- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- 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 Ccompile features
-- Detecting Ccompile 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
-- Requiring C++11
-- Requiring C++11-done
-- Requiring C99
-- Requiring C99-done
-- Looking for strrrstr
-- Looking for strrstr-not found
-- Looking for strcasecmp
-- Looking for strcasecmp-found
-- Looking for strcasestr
-- Looking for strcasestr-found
-- Looking for strlcat
-- Looking for strlcat-not found
-- Looking for strlcpy
-- Looking for strlcpy-not found
-- Looking for strlen
-- Looking for strlen-found
-- Looking for strncasecmp
-- Looking for strncasecmp-found
-- Looking for vsnprintf
-- Looking for vsnprintf-found
-- Looking for lrintf
-- Looking for lrrintf-found
-- Looking for lrrint
-- Looking for lrint-found
-- Looking for dlfcn.h
-- Looking for dlfcn.h-found
-- Performing Test HAVE_SYNC_FETCH_AND_ADD
-- Performing Test HAVE_SYNC_FETCH_AND_ADD-Success
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.34")
-- Found JPEG: /usr/lib64/libjpeg.so
-- Found Freetype: /usr/lib64/libfreetype.so
-- Found PROJ: /usr/lib64/libproj.so
-- Found Proj 6.3
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Found FRIBIDI: /usr/lib64/libfribidi.so
-- Checking for module 'harfbuzz>=0.9.18'
--   Found harfbuzz, version 1.7.5
-- Found HarfBuzz: /usr/include/harfbuzz
-- Looking for iconv
-- Looking for iconv-found
-- Foundiconv library:
-- Checking for module 'cairo'
--   Found cairo, version 1.15.12
-- Found CAIRO: /usr/lib64/libcairo.so
-- Found FCGI: /usr/lib64/libfcgi.so
-- Found GEOS: /usr/lib64/libgeos_c.so
-- Found POSTGRESQL: /usr/lib64/libpq.so
-- Looking for PQserverVersion in pq
-- Looking for PQserverVersion in pq-found
-- Found GDAL: /usr/lib64/libgdal.so
-- Found CURL: /usr/lib64/libcurl.so (found version "7.61.1")
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.7")
-- Found LibXslt: /usr/lib64/libxslt.so (found version "1.1.32")
-- Found GIF: /usr/lib64/libgif.so (found version "5.1.4")
-- /usr/include/php/main
-- Found PHP-Version 7.4.7 (using/usr/bin/php-config)
-- *Summary of configured options for this build
--  * Mandatory components
--   *GDAL: /usr/lib64/libgdal.so
--   *PROJ: /usr/lib64/libproj.so
--   *png: /usr/lib64/libpng.so
--   *jpeg: /usr/lib64/libjpeg.so
--   * freetype: /usr/lib64/libfreetype.so
--  * Optional components
--   *GIF: /usr/lib64/libgif.so
--   *MYSQL:disabled
--   * FRIBIDI: /usr/lib64/libfribidi.so
--   *HARFBUZZ: /usr/lib64/libharfbuzz.so
--   *GIF: /usr/lib64/libgif.so
--   *CAIRO: /usr/lib64/libcairo.so
--   * SVGCAIRO: disabled
--   * RSVG: disabled
--   *CURL: /usr/lib64/libcurl.so
--   *PIXMAN:disabled
--   *LIBXML2: /usr/lib64/libxml2.so
--   * POSTGIS: /usr/lib64/libpq.so
--   *GEOS: /usr/lib64/libgeos_c.so
--   * FastCGI: /usr/lib64/libfcgi.so
--   *PROTOBUFC:disabled
--   *Oracle Spatial: disabled
--   *Exempi XMP:disabled
--  * Optional features
--   * WMS SERVER: ENABLED
--   * WFS SERVER:ENABLED
--   * WCS SERVER:ENABLED
--   * SOS SERVER: disabled
--   *WMS CLIENT:ENABLED
--   * WFS CLIENT:ENABLED
--   * ICONV:ENABLED
--   *Thread-safety support: disabled
--   * KML output:ENABLED
--   * Z+M point coordinate support: ENABLED
--   * XML Mapfile support:ENABLED
--  *Mapscripts
--   * Python: disabled
--   * PHP: ENABLED
--   * PHPNG: disabled
--   * PERL: disabled
--   * RUBY: disabled
--   * JAVA: disabled
--   *C#: disabled
--   * V8 Javascript: disabled
--   * Apache Module (Experimental): disabled
--
-- PROJECT_BINARY_DIR is set to /root/mapserver-7.6.0/build
-- Will install files to /opt
-- Will install libraries to /opt/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mapserver-7.6.0/build

■Make
make
■Make Results (Error Part Excerpt)

[69%]Linking Executable sortshp
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQcmdStatus@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQfname@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQsetNoticeProcessor@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQftable@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQstatus@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQftablecol@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQconnectdb@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQescapeStringConn@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `lo_close@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQputCopyEnd@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQgetvalue@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQgetisnull@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQftype@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQfmod@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `lo_create@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQresultStatus@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `lo_read@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQexec@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQsetClientEncoding@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQgetlength@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQputCopyData@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQgetResult@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `lo_write@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQfinish@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQclear@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQerrorMessage@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQnfields@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libgdal.so: undefined reference to `lo_open@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQexecParams@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQntuples@RHPG_9.6'
/usr/lib/gcc/x86_64-redhat-linux/8/...../../../lib64/libgdal.so: Undefined reference to `PQresultErrorMessage@RHPG_9.6'
collect2:Error: ld terminated with status 1
make[2]:*** [CMakeFiles/sortshp.dir/build.make:101:sortshp] Error 1
make[1]:*** [CMakeFiles/Makefile2:68:CMakeFiles/sortshp.dir/all] Error 2
make:*** [Makefile:130:all] Error 2

■ What I tried
I tried to refer only to /usr/lib64 for libpq path with reference to the following, but it didn't work.
https://github.com/openalpr/openalpr/issues/846

I would simply like to bring the mapserver until the installation is complete, but it doesn't work...
Thank you for your cooperation.

postgresql cmake

2022-09-30 17:07

1 Answers

I solved myself.It seems that I had to use the gdal30 provided by pgdg-common and geos38.
By the way, protobuf-c was used to enable protobuf.

The cmake is a bit different, too.

cmake-DCMAKE_INSTALL_PREFIX=/opt\
    -DCMAKE_PREFIX_PATH="/usr/pgsql-12/bin;/usr/gdal30;/usr/geos38/lib64"\
    - DWITH_PHP=ON-DWITH_CURL=ON-DWITH_CLIENT_WFS=ON-DWITH_CLIENT_WMS=ON\
    - DWITH_KML=ON-DWITH_XMLMAPFILE=ON-DWITH_POSTGIS=ON-DWITH_PROTOBUFC=ON..

Sorry for the trouble.


2022-09-30 17:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.