本地编译安装|编译安装最新版postgis3.4.3版本指南

一、本地编译安装步骤介绍

本地编译,指的是在本地环境编译安装某个软件,例如,本文所述的最新版postgis3.4.3,本地是什么cpu架构,编译完成后,编译产出物就可以在其它的同cpu架构的服务器上直接适用了,这里着重强调本地编译以区别于交叉编译

那么,回到开始的问题,本地编译最新版postgis3.4.3,这里的编译难点主要在于两点,第一个是编译环境的准备,第二个是编译的调试

编译环境,指的是能够使得编译工作完成的环境,主要就是安装各类依赖,例如,本文使用的最新版postgis3.4.3是基于c语言编写的,那么,编译环境就必须包含有各种各样的类库,比如gtk2-devel  libxml2 libxml2-devel 这些类库,并且至少需要有一个gcc环境,并且这些类库以及gcc环境的版本可能都会有一定的要求,而版本依赖如何处理,如何使得这些安装的类库能够正常工作,这些问题使得编译环境的准备非常复杂,而本文将就这些困难的问题,做一个全面的解释,并指出一个可能更为高效,简洁的解决方案

编译调试,指的是从编译的错误处开始,直到消除所有的错误,最终完成编译的工作;很多同学拿到一个编译任务的时候,都只是简单的百度一下,然后根据各类教程进行编译活动,那么,其实我们的编译工作是应该有一个准确的良好的开端的,即编译工作到底应该从哪里开始,如何一步一步的把编译工作推进?

回到本文的最新版postgis3.4.3,我们拿到它的源码包后,应该是从哪里开始呢?当然了,首先第一步是阅读源码包内的说明文档,并根据文档内容,制定一个编译流程,然后开始我们的预编译工作,进而开始我们的编译工作和编译安装工作;那么,预编译如果报错了,我们应该如何做呢?当然是根据详细的报错信息,一步一步解决,这样的编译工作到最后都是自然的水到渠成的,能够顺利完成的

🆗,就不在这里废话了,下面以最新版postgis3.4.3在centos7的x86_64架构下如何一步步完成编译工作做一个简单的记录

二、最新版postgis3.4.3源码包的下载

下载地址:https://github.com/postgis/postgis/tags

或者在postgis的官网下载,下载地址:

Index of /postgis/source/

三、最新版postgis3.4.3源码包内的安装文档阅读

 主要的安装文档是README.postgis,该文档里有详细介绍postgis的依赖情况,根据这个文档,做如下总结:

postgis-3.4.3安装
依赖如下:
1、GEOS  - 3.12+ for ST_CoverageSimplify and ST_CoverageInvalidEdges- 3.11+ for improved ST_ConcaveHull, ST_lineMerge,and new functions ST_SimplifyPolygonHull, ST_TriangulatePolygon- 3.10+ for ST_MakeValid enhancements- 3.9+ is needed to take advantage offixed precision enhancements in overlay functions- 3.7+ is needed just for the ST_FrechetDistance function
最低版本是3.6,如果需要功能比较齐全,需要安装版本3.12  3..0.0用的是3.8.0版本,该版本需要高版本cmake编译,也就是使用cmake3,gcc版本至少需要72、  PROJ4  
PROJ4 (Required, Version 6.1 or higher) 需要sqlite开发包,make编译比较慢,gcc7下通过
3、 protobuf
4、 protobuf-c-1.3.1,protobuf-c (Optional, Version 1.1.0 or higher)
现有的是protobuf-c-1.3.1,符合要求5、  gdal 这里使用高版本3.3.3,这个编译比较慢,GDAL
弱依赖,可以不安装,但建议安装,现有版本是gdal-2.1.3,建议安装3版本,该插件主要是启用光栅功能
6、  cgal  
CGAL 4.1+ and SFCGAL 1.3.2+ 
高级3D共功能,建议安装
现有的是CGAL-4.13和SFCGAL-1.3.6,符合要求,SFCGAL 1.4.1+会支持更好
7、 sfcgal  8、libxml2[root@centos4 postgis-3.4.3]# rpm -qa |grep libxml
libxml2-2.9.1-6.el7.5.x86_64
libxml2-devel-2.9.1-6.el7.5.x86_64
需要版本2.5.0 ,现有仓库是2.9,可以直接rpm安装10、gettextrpm安装的是0.19.8.1
[root@centos4 postgis-3.4.3]# rpm -qa |grep gettext
gettext-0.19.8.1-3.el7.x86_64
gettext-libs-0.19.8.1-3.el7.x86_64图形化界面使用的,版本要求是0.14,现有仓库是0.19.8,可以直接rpm安装11、
JSON-C,现有版本未知,要求的是0.9及以上

 在源码目录内可以看到,并没有configure.sh 这个预编译脚本,因此,需要安装autoconf和automake以生成configure.sh 这个预编译脚本,最终总结,应该使用yum安装如下依赖:

yum install automake autoconf gtk2 gtk2-devel  libxml2 libxml2-devel  xz xz-devel libtool autoconf automake gcc gcc-c++ make gettext sqlite sqlite-devel

四、根据最新版postgis3.4.3的安装文档确定编译工作中的各个依赖以及依赖如何处理

根据第三节所述,可以看到,我们需要的依赖GEOS  PROJ4  protobuf protobuf-c  gdal   cgal sfcgal   这些需要特定版本,通常yum仓库内并没有现成的使用,因此,这些组件需要手动编译

而这些依赖安装还是有一定的顺序要求,因此,采用根据预编译日志来逐一处理的方式进行处理

下面将就在VMware 虚拟机 centos7操作系统,x86_64架构下编译最新版postgis3.4.3做一个详细的记录

五、最新版postgis3.4.3的预编译工作

1、将postgis3.4.3源码包上传到VMware虚拟机服务器后,解压待用

刚解压的源码包内发现是没有configure.sh 文件的,此时需要通过autogen.sh 脚本生成

2、

autogen.sh 脚本运行前的依赖安装

yum install automake autoconf gtk2 gtk2-devel  libxml2 libxml2-devel  xz xz-devel libtool autoconf automake gcc gcc-c++ make gettext sqlite sqlite-devel -y

3、

运行autogen.sh 脚本生成configure.sh 脚本

[root@centos4 postgis-3.4.3]# ./autogen.sh 
* Running /usr/bin/libtoolize (2.4.2)OPTIONS = --force --copy --install
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file `build-aux/config.guess'
libtoolize: copying file `build-aux/config.sub'
libtoolize: copying file `build-aux/install-sh'
libtoolize: copying file `build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `macros'.
libtoolize: copying file `macros/libtool.m4'
libtoolize: copying file `macros/ltoptions.m4'
libtoolize: copying file `macros/ltsugar.m4'
libtoolize: copying file `macros/ltversion.m4'
libtoolize: copying file `macros/lt~obsolete.m4'
libtoolize: Consider adding `-I macros' to ACLOCAL_AMFLAGS in Makefile.am.
* Running /usr/bin/aclocal (1.13.4)
* Running /usr/bin/autoconf (2.69)
======================================
Now you are ready to run './configure'
======================================

可以看到,autogen是依赖于libtool 这个依赖,以及依赖autoconf,aotomake 这两个依赖而运行的

4、

初次预编译

本次预编译肯定会报错,编译工作就是不停的试错

。。。。。。。。。。。。。。。省略
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
checking for pg_config... no
configure: error: could not find pg_config within the current path. You may need to re-run configure with a --with-pgconfig parameter.
。。。。。。。。结尾了

可以看到,首要依赖是postgresql数据库,解决方法很简单,先安装一个postgresql

yum install postgresql12-server-12.4 postgresql12-libs-12.4 postgresql12-devel-12.4 postgresql12-contrib-12.4 postgresql12-tcl postgresql12-odbc postgresql12-12.4  postgresql12-plperl-12.4 postgresql12-pltcl-12.4 postgresql12-plpython-12.4  postgresql12-plpython3-12.4 postgresql12-llvmjit-12.4 postgresql12-devel-12.4  -y

数据库安装完毕后,搜pg_config,找到该文件后,将预编译命令修改为如下: 


[root@centos4 postgis-3.4.3]# find / -name pg_config
/usr/pgsql-12/bin/pg_config./configure  --with-pgconfig=/usr/pgsql-12/bin/pg_config

预编译报错如下:

checking libxml/xpathInternals.h usability... yes
checking libxml/xpathInternals.h presence... yes
checking for libxml/xpathInternals.h... yes
checking for xmlInitParser in -lxml2... yes
checking for geos-config... no
configure: error: could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig paramete

提示缺少geos这个依赖

5、

解决geos这个依赖

查询自建的yum仓库,可以看到有3.11版本的geos,但前面提到的文档说3.12的版本更好,因此,geos自编译

[root@centos4 postgis-3.4.3]# yum list |grep geos
Repository 'local' is missing name in configuration, using id
geos.x86_64                                3.4.2-2.el7            epel_x86_64   
geos-devel.x86_64                          3.4.2-2.el7            epel_x86_64   
geos-php.x86_64                            3.4.2-2.el7            epel_x86_64   
geos-python.x86_64                         3.4.2-2.el7            epel_x86_64   
geos310.x86_64                             3.10.3-1.rhel7         pg_all        
geos310-debuginfo.x86_64                   3.10.3-1.rhel7         pg_all        
geos310-devel.x86_64                       3.10.3-1.rhel7         pg_all        
geos311.x86_64                             3.11.2-1.rhel7         pg_all        
geos311-debuginfo.x86_64                   3.11.2-1.rhel7         pg_all        
geos311-devel.x86_64                       3.11.2-1.rhel7         pg_all        
geos37.x86_64                              3.7.2-2.rhel7          pg_all        
geos37-debuginfo.x86_64                    3.7.2-2.rhel7          pg_all        
geos37-devel.x86_64                        3.7.2-2.rhel7          pg_all        
geos38.x86_64                              3.8.1-2.rhel7          pg_all        
geos38-debuginfo.x86_64                    3.8.1-2.rhel7          pg_all        
geos38-devel.x86_64                        3.8.1-2.rhel7          pg_all        
geos39.x86_64                              3.9.2-1.rhel7          pg_all        
geos39-debuginfo.x86_64                    3.9.2-1.rhel7          pg_all        
geos39-devel.x86_64                        3.9.2-1.rhel7          pg_all        

从GitHub上下载geos-3.12.2.tar.bz这个文件,下载地址就不用说了,一搜就找到了,开始预编译geos:

root@centos4 ~]# tar xf geos-3.12.2.tar.bz2 
[root@centos4 ~]# cd geos-3.12.2
[root@centos4 geos-3.12.2]# ./configure 
You need cmake to build this package

🆗,这个geos高版本需要cmake编译器来编译,查询仓库可以看到有cmake3:

root@centos4 geos-3.12.2]# yum list |grep cmake
Repository 'local' is missing name in configuration, using id
cmake.x86_64                               2.8.12.2-2.el7         base_x86_64   
cmake-fedora.noarch                        2.9.3-1.el7            epel_x86_64   
cmake-gui.x86_64                           2.8.12.2-2.el7         base_x86_64   
cmake3.x86_64                              3.17.5-1.el7           epel_x86_64   
cmake3-data.noarch                         3.17.5-1.el7           epel_x86_64   
cmake3-doc.noarch                          3.17.5-1.el7           epel_x86_64   
cmake3-gui.x86_64                          3.17.5-1.el7           epel_x86_64   
extra-cmake-modules.noarch                 5.52.0-1.el7           epel_x86_64   

直接安装这个cmake3,版本3.17

yum install cmake3*  -y

创建build目录,并进入build目录,开始编译geos:

[root@centos4 geos-3.12.2]# mkdir build
[root@centos4 geos-3.12.2]# cd build/
[root@centos4 build]# cmake3 ../

预编译通过后发现make有问题,make失败,失败日志如下:

[root@centos4 build]# make
Scanning dependencies of target ryu
[  0%] Building C object src/deps/CMakeFiles/ryu.dir/ryu/d2s.c.o
[  0%] Built target ryu
Scanning dependencies of target geos
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Angle.cpp.o
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Area.cpp.o
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/BoundaryNodeRule.cpp.o
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/CGAlgorithmsDD.cpp.o
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Centroid.cpp.o
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/ConvexHull.cpp.o
In file included from /root/geos-3.12.2/src/algorithm/ConvexHull.cpp:30:0:
/root/geos-3.12.2/include/geos/util.h:38:12: error: ‘std::make_unique’ has not been declaredusing std::make_unique;^
/root/geos-3.12.2/src/algorithm/ConvexHull.cpp: In member function ‘std::unique_ptr<geos::geom::CoordinateSequence> geos::algorithm::ConvexHull::toCoordinateSequence(geos::geom::Coordinate::ConstVect&)’:
/root/geos-3.12.2/src/algorithm/ConvexHull.cpp:118:15: error: ‘make_unique’ is not a member of ‘geos::detail’auto cs = detail::make_unique<CoordinateSequence>(cv.size());^
/root/geos-3.12.2/src/algorithm/ConvexHull.cpp:118:53: error: expected primary-expression before ‘>’ tokenauto cs = detail::make_unique<CoordinateSequence>(cv.size());^
make[2]: *** [CMakeFiles/geos.dir/src/algorithm/ConvexHull.cpp.o] Error 1
make[1]: *** [CMakeFiles/geos.dir/all] Error 2
make: *** [all] Error 2

这里的错误的真实意思是gcc编译器找不到某个函数,而根本原因是gcc版本过低,是4.8.5,因此,升级gcc版本到7.3就可以解决此问题了(build目录需要清空,重新预编译一次,然后开始make和make install):

[root@centos4 build]# source /opt/rh/
devtoolset-7/   llvm-toolset-7/ 
[root@centos4 build]# source /opt/rh/devtoolset-7/enable 
[root@centos4 build]# make
[  0%] Built target ryu
[  0%] Building CXX object CMakeFiles/geos.dir/src/algorithm/ConvexHull.cpp.o
In file included from /root/geos-3.12.2/src/algorithm/ConvexHull.cpp:30:0:
/root/geos-3.12.2/include/geos/util.h:38:12: error: ‘std::make_unique’ has not been declaredusing std::make_unique;

剩下的时候基本没有什么困难了,一路顺畅,geos安装完毕后,回到postgis目录下,继续预编译调试

6、再次预编译postgis

checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyPreferredLanguages... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for PROJ... no
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
checking proj.h usability... no
checking proj.h presence... no
checking for proj.h... no
configure: error: could not find proj.h or proj_api.h - you may need to specify the directory of a PROJ installation using --with-projdir

报错没有proj4,并且说明这个是强依赖,必须安装,可以看到yum仓库里有高版本的proj4

[root@centos4 postgis-3.4.3]# yum list |grep proj
Repository 'local' is missing name in configuration, using id
apache-james-project.noarch                1.8.1-14.el7           epel_x86_64   
fedora-gnat-project-common.noarch          3.9-1.el7              epel_x86_64   
geany-plugins-projectorganizer.x86_64      1.38-1.el7             epel_x86_64   
httpcomponents-project.noarch              6-4.el7                base_x86_64   
jetty-project.noarch                       9.0.3-8.el7            base_x86_64   
libprojectM.x86_64                         2.1.0-2.el7            epel_x86_64   
libprojectM-devel.x86_64                   2.1.0-2.el7            epel_x86_64   
libprojectM-qt.x86_64                      2.1.0-2.el7            epel_x86_64   
libprojectM-qt-devel.x86_64                2.1.0-2.el7            epel_x86_64   
maven-project.noarch                       2.2.1-47.el7           base_x86_64   
maven-project-info-reports-plugin.noarch   2.6-8.el7              base_x86_64   
maven-project-info-reports-plugin-javadoc.noarch
pjproject.x86_64                           2.3-6.el7              epel_x86_64   
pjproject-devel.x86_64                     2.3-6.el7              epel_x86_64   
proj.x86_64                                4.8.0-4.el7            epel_x86_64   
proj-devel.x86_64                          4.8.0-4.el7            epel_x86_64   
proj-epsg.x86_64                           4.8.0-4.el7            epel_x86_64   
proj-nad.x86_64                            4.8.0-4.el7            epel_x86_64   
proj-static.x86_64                         4.8.0-4.el7            epel_x86_64   
proj49.x86_64                              4.9.3-3.rhel7          pg_all        
proj49-debuginfo.x86_64                    4.9.3-3.rhel7          pg_all        
proj49-devel.x86_64                        4.9.3-3.rhel7          pg_all        
proj49-epsg.x86_64                         4.9.3-3.rhel7          pg_all        
proj49-nad.x86_64                          4.9.3-3.rhel7          pg_all        
proj49-static.x86_64                       4.9.3-3.rhel7          pg_all        
proj62.x86_64                              6.2.1-1.rhel7          pg_all        
proj62-debuginfo.x86_64                    6.2.1-1.rhel7          pg_all        
proj62-devel.x86_64                        6.2.1-1.rhel7          pg_all        
proj62-static.x86_64                       6.2.1-1.rhel7          pg_all        
proj63.x86_64                              6.3.1-1.rhel7          pg_all        
proj63-debuginfo.x86_64                    6.3.1-1.rhel7          pg_all        
proj63-devel.x86_64                        6.3.1-1.rhel7          pg_all        
proj63-static.x86_64                       6.3.1-1.rhel7          pg_all        
proj70.x86_64                              7.0.1-4.rhel7          pg_all        
proj70-debuginfo.x86_64                    7.0.1-4.rhel7          pg_all        
proj70-devel.x86_64                        7.0.1-4.rhel7          pg_all        
proj70-static.x86_64                       7.0.1-4.rhel7          pg_all        
proj71.x86_64                              7.1.1-3.rhel7          pg_all        
proj71-debuginfo.x86_64                    7.1.1-3.rhel7          pg_all        
proj71-devel.x86_64                        7.1.1-3.rhel7          pg_all        
proj71-static.x86_64                       7.1.1-3.rhel7          pg_all        
proj72.x86_64                              7.2.1-1.rhel7          pg_all        
proj72-debuginfo.x86_64                    7.2.1-1.rhel7          pg_all        
proj72-devel.x86_64                        7.2.1-1.rhel7          pg_all        
proj72-static.x86_64                       7.2.1-1.rhel7          pg_all        
proj80.x86_64                              8.0.1-1.rhel7          pg_all        
proj80-debuginfo.x86_64                    8.0.1-1.rhel7          pg_all        
proj80-devel.x86_64                        8.0.1-1.rhel7          pg_all        
proj80-static.x86_64                       8.0.1-1.rhel7          pg_all        
proj81.x86_64                              8.1.1-1.rhel7          pg_all        
proj81-debuginfo.x86_64                    8.1.1-1.rhel7          pg_all        
proj81-devel.x86_64                        8.1.1-1.rhel7          pg_all        
proj81-static.x86_64                       8.1.1-1.rhel7          pg_all        

因此,使用yum来处理这个依赖:

yum install proj63* -y

yum安装完毕后,postgis的预编译命令又需要更改了:

./configure  --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-projdir=/usr/proj63/

上面这个命令输出如下:

checking whether to use NLS... yes
checking where the gettext function comes from... libc
Using user-specified proj directory: /usr/proj63/
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking for proj.h... (cached) yes
checking for pj_get_release in -lproj... yes
checking for JSONC... no
configure: WARNING: "Could not find json-c"
checking for PROTOBUFC... no
libprotobuf-c not found in pkg-config
checking protobuf-c/protobuf-c.h usability... no
checking protobuf-c/protobuf-c.h presence... no
checking for protobuf-c/protobuf-c.h... no
configure: error: unable to find protobuf-c/protobuf-c.h using CPPFLAGS. You can disable MVT and Geobuf support using --without-protobuf

可以看到,proj4已经通过,但protobuf-c 这个强依赖没有通过,因为还没安装,下面处理protobuf-c 

7、protobuf-c的安装

protobuf和protobuf-c互为依赖

protobuf的安装

cd protobuf-2.6.1
./configure  --prefix=/usr/local/protobuf
make && make install
注意,要指定安装路径哦!!! 

protobuf-c的安装

vim /etc/profile  在文件末尾添加如下内容:

export PROTOBUF_HOME=/usr/local/protobuf
export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig
 执行命令  source /etc/profile 激活环境变量

解压安装文件后,进入目录,并执行编译:

cd protobuf-c-1.3.1
./configure  --prefix=/usr/local/protobuf-c
make && make install
注意,要指定安装路径哦!!

8、再次预编译postgis-3.4.3

此时日志报错如下;

checking for PROTOBUFC... no
libprotobuf-c not found in pkg-config
checking protobuf-c/protobuf-c.h usability... yes
checking protobuf-c/protobuf-c.h presence... yes
checking for protobuf-c/protobuf-c.h... yes
checking for protobuf_c_message_init in -lprotobuf-c... yes
checking for protobuf_c_version in -lprotobuf-c... yes
checking protobuf-c version... configure: error: "Old protobuf-c release found but 1.1.0 is required. You can disable MVT and Geobuf support using --without-protobuf"

解决方式为安装低版本的protobuf-c的开发库:

yum install protobuf-c*
Loaded plugins: fastestmirror
Repository 'local' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package protobuf-c.x86_64 0:1.0.2-3.el7 will be installed
---> Package protobuf-c-compiler.x86_64 0:1.0.2-3.el7 will be installed
--> Processing Dependency: libprotobuf.so.8()(64bit) for package: protobuf-c-compiler-1.0.2-3.el7.x86_64
---> Package protobuf-c-devel.x86_64 0:1.0.2-3.el7 will be installed
---> Package protobuf-compiler.x86_64 0:2.5.0-8.el7 will be installed
--> Running transaction check
---> Package protobuf.x86_64 0:2.5.0-8.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved==============================================================================================================================================================================================================================================================================================================================================Package                                                                                  Arch                                                                        Version                                                                          Repository                                                                        Size
==============================================================================================================================================================================================================================================================================================================================================
Installing:protobuf-c                                                                               x86_64                                                                      1.0.2-3.el7                                                                      base_x86_64                                                                       28 kprotobuf-c-compiler                                                                      x86_64                                                                      1.0.2-3.el7                                                                      base_x86_64                                                                       80 kprotobuf-c-devel                                                                         x86_64                                                                      1.0.2-3.el7                                                                      base_x86_64                                                                       14 kprotobuf-compiler                                                                        x86_64                                                                      2.5.0-8.el7                                                                      base_x86_64                                                                      261 k
Installing for dependencies:protobuf                                                                                 x86_64                                                                      2.5.0-8.el7                                                                      base_x86_64                                                                      338 kTransaction Summary
==============================================================================================================================================================================================================================================================================================================================================
Install  4 Packages (+1 Dependent package)Total download size: 721 k
Installed size: 2.3 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): protobuf-c-1.0.2-3.el7.x86_64.rpm                                                                                                                                                                                                                                                                               |  28 kB  00:00:00     
(2/5): protobuf-c-compiler-1.0.2-3.el7.x86_64.rpm                                                                                                                                                                                                                                                                      |  80 kB  00:00:00     
(3/5): protobuf-2.5.0-8.el7.x86_64.rpm                                                                                                                                                                                                                                                                                 | 338 kB  00:00:00     
(4/5): protobuf-c-devel-1.0.2-3.el7.x86_64.rpm                                                                                                                                                                                                                                                                         |  14 kB  00:00:00     
(5/5): protobuf-compiler-2.5.0-8.el7.x86_64.rpm                                                                                                                                                                                                                                                                        | 261 kB  00:00:00     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                                                                                         5.8 MB/s | 721 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : protobuf-2.5.0-8.el7.x86_64                                                                                                                                                                                                                                                                                                1/5 Installing : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                              2/5 Installing : protobuf-compiler-2.5.0-8.el7.x86_64                                                                                                                                                                                                                                                                                       3/5 Installing : protobuf-c-compiler-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                     4/5 Installing : protobuf-c-devel-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                        5/5 Verifying  : protobuf-compiler-2.5.0-8.el7.x86_64                                                                                                                                                                                                                                                                                       1/5 Verifying  : protobuf-c-compiler-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                     2/5 Verifying  : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                              3/5 Verifying  : protobuf-c-devel-1.0.2-3.el7.x86_64                                                                                                                                                                                                                                                                                        4/5 Verifying  : protobuf-2.5.0-8.el7.x86_64                                                                                                                                                                                                                                                                                                5/5 Installed:protobuf-c.x86_64 0:1.0.2-3.el7                                              protobuf-c-compiler.x86_64 0:1.0.2-3.el7                                              protobuf-c-devel.x86_64 0:1.0.2-3.el7                                              protobuf-compiler.x86_64 0:2.5.0-8.el7                                             Dependency Installed:protobuf.x86_64 0:2.5.0-8.el7                                                                                                                                                                                                                                                                                                               Complete!

9、再次编译postgis-3.4.3

可以看到protobuf-c的问题解决了,但json-c和gdal没有解决

checking for JSONC... no
configure: WARNING: "Could not find json-c"
checking for PROTOBUFC... no
libprotobuf-c not found in pkg-config
checking protobuf-c/protobuf-c.h usability... yes
checking protobuf-c/protobuf-c.h presence... yes
checking for protobuf-c/protobuf-c.h... yes
checking for protobuf_c_message_init in -lprotobuf-c... yes
checking for protobuf_c_version in -lprotobuf-c... yes
checking protobuf-c version... 1003001
checking for protoc-c... /usr/bin/protoc-c
checking if gcc supports -Wall... yes
phony-revision: 
checking for PCRE2... no
checking for PCRE... yes
TOPOLOGY: Topology support requested
RASTER: Raster support requested
checking for gdal-config... no
checking GDAL version... not found
configure: error: gdal-config not found. Use --without-raster or try --with-gdalconfig=<path to gdal-config>

10、解决json-c的问题

[root@centos4 postgis-3.4.3]# yum list |grep json-c
Repository 'local' is missing name in configuration, using id
json-c.x86_64                              0.11-4.el7_0           @anaconda     
json-c.i686                                0.11-4.el7_0           base_x86_64   
json-c-devel.i686                          0.11-4.el7_0           base_x86_64   
json-c-devel.x86_64                        0.11-4.el7_0           base_x86_64   
json-c-doc.noarch                          0.11-4.el7_0           base_x86_64   
json-c12.x86_64                            0.12.1-4.el7           epel_x86_64   
json-c12-devel.x86_64                      0.12.1-4.el7           epel_x86_64   
json-c12-doc.noarch                        0.12.1-4.el7           epel_x86_64   
nodejs-strip-json-comments.noarch          1.0.2-2.el7            epel_x86_64   
rh-nodejs6-nodejs-strip-json-comments.noarch
rh-nodejs8-nodejs-strip-json-comments.noarch
[root@centos4 postgis-3.4.3]# yum install json-c* -y
Loaded plugins: fastestmirror
Repository 'local' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Package json-c-0.11-4.el7_0.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package json-c-devel.x86_64 0:0.11-4.el7_0 will be installed
---> Package json-c-doc.noarch 0:0.11-4.el7_0 will be installed
---> Package json-c12.x86_64 0:0.12.1-4.el7 will be installed
---> Package json-c12-devel.x86_64 0:0.12.1-4.el7 will be installed
---> Package json-c12-doc.noarch 0:0.12.1-4.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved==============================================================================================================================================================================================================================================================================================================================================Package                                                                              Arch                                                                         Version                                                                            Repository                                                                         Size
==============================================================================================================================================================================================================================================================================================================================================
Installing:json-c-devel                                                                         x86_64                                                                       0.11-4.el7_0                                                                       base_x86_64                                                                        20 kjson-c-doc                                                                           noarch                                                                       0.11-4.el7_0                                                                       base_x86_64                                                                        98 kjson-c12                                                                             x86_64                                                                       0.12.1-4.el7                                                                       epel_x86_64                                                                        24 kjson-c12-devel                                                                       x86_64                                                                       0.12.1-4.el7                                                                       epel_x86_64                                                                        24 kjson-c12-doc                                                                         noarch                                                                       0.12.1-4.el7                                                                       epel_x86_64                                                                       114 kTransaction Summary
==============================================================================================================================================================================================================================================================================================================================================
Install  5 PackagesTotal download size: 280 k
Installed size: 1.5 M
Downloading packages:
(1/5): json-c-doc-0.11-4.el7_0.noarch.rpm                                                                                                                                                                                                                                                                              |  98 kB  00:00:00     
(2/5): json-c-devel-0.11-4.el7_0.x86_64.rpm                                                                                                                                                                                                                                                                            |  20 kB  00:00:00     
(3/5): json-c12-devel-0.12.1-4.el7.x86_64.rpm                                                                                                                                                                                                                                                                          |  24 kB  00:00:00     
(4/5): json-c12-0.12.1-4.el7.x86_64.rpm                                                                                                                                                                                                                                                                                |  24 kB  00:00:00     
(5/5): json-c12-doc-0.12.1-4.el7.noarch.rpm                                                                                                                                                                                                                                                                            | 114 kB  00:00:00     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                                                                                         3.4 MB/s | 280 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : json-c12-0.12.1-4.el7.x86_64                                                                                                                                                                                                                                                                                               1/5 Installing : json-c12-devel-0.12.1-4.el7.x86_64                                                                                                                                                                                                                                                                                         2/5 Installing : json-c-doc-0.11-4.el7_0.noarch                                                                                                                                                                                                                                                                                             3/5 Installing : json-c12-doc-0.12.1-4.el7.noarch                                                                                                                                                                                                                                                                                           4/5 Installing : json-c-devel-0.11-4.el7_0.x86_64                                                                                                                                                                                                                                                                                           5/5 Verifying  : json-c-devel-0.11-4.el7_0.x86_64                                                                                                                                                                                                                                                                                           1/5 Verifying  : json-c12-0.12.1-4.el7.x86_64                                                                                                                                                                                                                                                                                               2/5 Verifying  : json-c12-devel-0.12.1-4.el7.x86_64                                                                                                                                                                                                                                                                                         3/5 Verifying  : json-c12-doc-0.12.1-4.el7.noarch                                                                                                                                                                                                                                                                                           4/5 Verifying  : json-c-doc-0.11-4.el7_0.noarch                                                                                                                                                                                                                                                                                             5/5 Installed:json-c-devel.x86_64 0:0.11-4.el7_0                                 json-c-doc.noarch 0:0.11-4.el7_0                                 json-c12.x86_64 0:0.12.1-4.el7                                 json-c12-devel.x86_64 0:0.12.1-4.el7                                 json-c12-doc.noarch 0:0.12.1-4.el7                                Complete!

11、gdal的安装

根据最开始的文档,gdal需要使用高版本,刚好yum源里面有,但这里为了照顾很多不会配仓库的同学,这里还是编译安装gdal-3.3.3:

./configure --prefix=/usr/local/gdal --with-proj=/usr/proj63/

这里必须要指定--with-proj=/usr/proj63/ ,要不然找不到proj的类库,gdal安装比较费时间,大概半个多小时

12、再次预编译postgis-3.4.3

编译命令为:

./configure  --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-protobufdir=/usr/local/protobuf-c --with-gdalconfig=/usr/local/gdal/bin/gdal-config 

日志为: 

PostGIS is now configured for x86_64-unknown-linux-gnu-------------- Compiler Info ------------- C compiler:           gcc -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros -WallC++ compiler (Wagyu): gcc -std=gnu99 -std=c++11 -x c++ C++ compiler (FlatGeobuf): gcc -std=gnu99 -std=c++11 -x c++ CPPFLAGS:              -I/usr/local/include -I/usr/proj63//include -I/usr/local/protobuf-c/include -I/usr/include/libxml2  -I/usr/include/json-c     -DNDEBUG LDFLAGS:               -lmSQL preprocessor:     /opt/rh/devtoolset-7/root/usr/bin/cpp -traditional-cpp -w -P -Upixel -UboolArchiver:             gcc-ar rs-------------- Additional Info ------------- Interrupt Tests:   ENABLED-------------- Dependencies -------------- GEOS config:          /usr/local/bin/geos-configGEOS version:         3.12.2GDAL config:          /usr/local/gdal/bin/gdal-configGDAL version:         3.3.3PostgreSQL config:    /usr/pgsql-12/bin/pg_configPostgreSQL version:   PostgreSQL 12.4PROJ4 version:        63Libxml2 config:       /usr/bin/xml2-configLibxml2 version:      2.9.1JSON-C support:       yesprotobuf support:     yesprotobuf-c version:   1003001PCRE support:         Version 1Perl:                 /usr/bin/perl--------------- Extensions --------------- PostgreSQL EXTENSION support:       enabledPostGIS Raster:                     enabledPostGIS Topology:                   enabledSFCGAL support:                     disabledAddress Standardizer support:       enabled-------- Documentation Generation -------- xsltproc:             /usr/bin/xsltprocxsl style sheets:     dblatex:              convert:              mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtdconfigure: WARNING: 
configure: WARNING:  | You are building using --with-projdir. This option isn't standard and    |
configure: WARNING:  | might be incompatible with future releases of PROJ.                      |
configure: WARNING:  | You can instead adjust the PKG_CONFIG_PATH environment variable if you   |
configure: WARNING:  | installed software in a non-standard prefix.                             |
configure: WARNING:  | Alternatively, you may set the environment variables PROJ_CFLAGS and     |
configure: WARNING:  | PROJ_LIBS to avoid the need to call pkg-config.                          |

这里有一些告警,还是处理一些,告警说的是projdir是参数形式,这个不标准

export CPLUS_INCLUDE_PATH=/usr/proj63/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/usr/proj63/lib:/usr/local/protobuf-c/lib:/usr/local/protobuf/lib:$LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/proj63/lib/pkgconfig:/usr/local/protobuf/lib/pkgconfig:/usr/local/protobuf-c/lib/pkgconfig:$PKG_CONFIG_PATH

再次执行编译,发现还缺少最后一个依赖SFCGAL 

 PostGIS is now configured for x86_64-unknown-linux-gnu-------------- Compiler Info ------------- C compiler:           gcc -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros -WallC++ compiler (Wagyu): gcc -std=gnu99 -std=c++11 -x c++ C++ compiler (FlatGeobuf): gcc -std=gnu99 -std=c++11 -x c++ CPPFLAGS:              -I/usr/local/include   -I/usr/local/protobuf-c/include -I/usr/include/libxml2  -I/usr/include/json-c     -DNDEBUG LDFLAGS:               -lmSQL preprocessor:     /opt/rh/devtoolset-7/root/usr/bin/cpp -traditional-cpp -w -P -Upixel -UboolArchiver:             gcc-ar rs-------------- Additional Info ------------- Interrupt Tests:   ENABLED-------------- Dependencies -------------- GEOS config:          /usr/local/bin/geos-configGEOS version:         3.12.2GDAL config:          /usr/local/gdal/bin/gdal-configGDAL version:         3.3.3PostgreSQL config:    /usr/pgsql-12/bin/pg_configPostgreSQL version:   PostgreSQL 12.4PROJ4 version:        63Libxml2 config:       /usr/bin/xml2-configLibxml2 version:      2.9.1JSON-C support:       yesprotobuf support:     yesprotobuf-c version:   1003001PCRE support:         Version 1Perl:                 /usr/bin/perl--------------- Extensions --------------- PostgreSQL EXTENSION support:       enabledPostGIS Raster:                     enabledPostGIS Topology:                   enabledSFCGAL support:                     disabledAddress Standardizer support:       enabled-------- Documentation Generation -------- xsltproc:             /usr/bin/xsltprocxsl style sheets:     dblatex:              convert:              mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

13、cgal和sfcgal编译安装

cgal和sfcgal是一对依赖,必须先cgal然后sfcgal

cgal的安装cd cgal-releases-CGAL-4.13/
mkdir build
cd build
cmake3 ../
make &&make install
注意,这个不要尝试指定安装目录,一切默认即可!!!!#这里需要注意,有三个依赖要安装,gmp-devel mpfr-devel boost*
-- GMP has been preconfigured:
--   UseGMP-file:      
--   GMP include:      /usr/include
--   GMP libraries:    /usr/lib64/libgmp.so
--   GMP definitions:  
-- USING GMP_VERSION = '6.0.0'
-- Preconfiguring library: MPFR ...
-- Found MPFR: /usr/lib64/libmpfr.so  
-- MPFR has been preconfigured:
--   UseMPFR-file:      
--   MPFR include:      /usr/include
--   MPFR libraries:    /usr/lib64/libmpfr.so
--   MPFR definitions:  
-- USING MPFR_VERSION = '3.1.1'
-- __cplusplus is 201402
--   --> Do not link with Boost.Thread
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:164 (message):Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at leastversion "1.48")
Call Stack (most recent call first):/usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)/usr/share/cmake3/Modules/FindBoost.cmake:2166 (find_package_handle_standard_args)Installation/cmake/modules/CGAL_SetupBoost.cmake:50 (find_package)Installation/cmake/modules/CGAL_SetupDependencies.cmake:85 (include)Installation/CMakeLists.txt:673 (include)-- Configuring incomplete, errors occurred!
See also "/root/cgal-releases-CGAL-4.13/build/CMakeFiles/CMakeOutput.log".
boost需要版本1.48以上sfcgal的安装cd SFCGAL-1.3.6/
mkdir build
cd build
cmake3 -DCMAKE_INSTALL_PREFIX=/usr/local/sfcgal  ../
make &&make install
注意,要指定安装路径哦!!!不可以多线程!!!!!会报错 

14、最后一次预编译postgis-3.4.3并执行编译和编译安装

在预编译前,有一个程序需要链接到系统环境内:

ln -sf /usr/local/protobuf-c/bin/protoc-c /usr/bin/

预编译命令如下: 

./configure  --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-protobufdir=/usr/local/protobuf-c --with-gdalconfig=/usr/local/gdal/bin/gdal-config  --with-sfcgal=/usr/local/sfcgal/bin/sfcgal-config --with-protobuf-lib=/usr/local/protobuf-c/lib/

在make前,还有两个lib库需要添加到ld里面

/usr/local/lib64/
/usr/local/sfcgal/lib64/

这些都做了后,make 和make install 一路顺畅

此时,可以进入启动的数据库内,激活插件了,但激活的时候遇到了这些问题:

postgres=# create extension postgis;
ERROR:  extension "postgis" already exists
postgres=# create extension postgis_
postgis_raster          postgis_sfcgal          postgis_tiger_geocoder  postgis_topology        
postgres=# create extension postgis_raster ;
ERROR:  could not load library "/usr/pgsql-12/lib/postgis_raster-3.so": libgdal.so.29: cannot open shared object file: No such file or directory

因此,ld里面在添加gdal的库:

cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib64/
/usr/local/sfcgal/lib64/
/usr/local/gdal/lib/

激活其它postgis的插件:

postgres=# create extension postg
postgis_sfcgal          postgis_tiger_geocoder  postgis_topology        postgres_fdw            
postgres=# create extension postgis_tiger_geocoder cascade ;
NOTICE:  installing required extension "fuzzystrmatch"
CREATE EXTENSION
postgres=# create extension postgis_topology ;
CREATE EXTENSION
postgres=# create extension postgis_sfcgal ;
CREATE EXTENSION
postgres=# \dxList of installed extensionsName          | Version |   Schema   |                        Description                         
------------------------+---------+------------+------------------------------------------------------------fuzzystrmatch          | 1.1     | public     | determine similarities and distance between stringsplpgsql                | 1.0     | pg_catalog | PL/pgSQL procedural languagepostgis                | 3.4.3   | public     | PostGIS geometry and geography spatial types and functionspostgis_raster         | 3.4.3   | public     | PostGIS raster types and functionspostgis_sfcgal         | 3.4.3   | public     | PostGIS SFCGAL functionspostgis_tiger_geocoder | 3.4.3   | tiger      | PostGIS tiger geocoder and reverse geocoderpostgis_topology       | 3.4.3   | topology   | PostGIS topology spatial types and functions

🆗,postgis全系列插件圆满安装完成!!!!!!!!!!!!!!!

15、稍作总结

yum需要安装以下依赖:


yum install automake autoconf gtk2 gtk2-devel  libxml2 libxml2-devel  xz xz-devel libtool  gcc gcc-c++ make gettext sqlite sqlite-devel libffi-devel openjpeg openjpeg-devel gmp-devel mpfr-devel boost* json-c*

gcc版本需要7以上包括7,主要是geos编译需要高版本gcc,本次实验全程使用的gcc高版本7,boost版本要求是48以上

其次,需要python3.6和python3.6的类库也就是lib这些,由于本次实验postgresql数据库是使用yum安装的,因此,python3.6在本文没有体现太多

最后就是yum源的配置,至少需要base源,epel源,update源以及pgdg源,也就是说编译环境非常难配置,需要的依赖是非常多的

总之,postgis插件的安装是比较复杂的,复杂的原因是很多插件需要特定版本,并且依赖之间也是有依赖的,编译此插件需要极大的耐心!!!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/432154.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

828华为云征文|使用Flexus X实例集成ES搜索引擎

目录 一、应用场景 1.1 Flexus X实例概述 1.2 ES搜索引擎 二、安装相关服务 2.1 安装Elasticsearch7.17.0 2.2 安装kibana7.17.0 三、开通安全组规则 四、整体感受 4.1 Flexus X实例 4.2 使用感觉 一、应用场景 1.1 Flexus X实例概述 Flexus X实例是华为云推出的一款…

HAproxy,nginx实现七层负载均衡

环境准备&#xff1a; 192.168.88.25 &#xff08;client&#xff09; 192.168.88.26 &#xff08;HAproxy&#xff09; 192.168.88.27 &#xff08;web1&#xff09; 192.168.88.28 (web2) 192.168.88.29 &#xff08;php1&#xff09; 192.168.88.30…

计算机毕业设计公交站点线路查询网站登录注册搜索站点线路车次/springboot/javaWEB/J2EE/MYSQL数据库/vue前后分离小程序

选题背景‌&#xff1a; 随着城市化进程的加快&#xff0c;公共交通成为城市居民出行的重要方式。然而&#xff0c;传统的公交站点线路查询方式往往依赖于纸质地图或简单的电子显示屏&#xff0c;查询效率低下且信息更新不及时。因此&#xff0c;开发一个功能全面、易于使用的…

HTTP Status 404 - /brand-demo/selectAllServlet错误解决原因-Servlet/JavaWeb/IDEA

检查xml文件的包名有无错误检查html文件的url有无写错&#xff0c;是否与Servlet的urlPatterns一致检查Servlet的urlpattern有没有写错(如写成name),检查doPost、doGet是否正常运行 注&#xff1a;IDEA新建Servlet时&#xff0c;默认的WebServlet注解中name需要改urlPatterns&…

Python redis 安装和使用介绍

python redis安装和使用 一、Redis 安装1.1、Windows安装 二、安装 redis 模块二、使用redis 实例1.1、简单使用1.2、连接池1.3、redis 基本命令 String1.3.1、ex - 过期时间&#xff08;秒&#xff09;1.3.2、nx - 如果设置为True&#xff0c;则只有name不存在时&#xff0c;当…

Web安全-SQL注入之联合查询注入

声明 环境 墨者学院-SQL手工注入漏洞测试(MySQL数据库-字符型) 判断是否存在漏洞 http://124.70.64.48:42937/new_list.php?idtingjigonggao and 12-- and 11正常 http://124.70.64.48:42937/new_list.php?idtingjigonggao and 12-- and 12出错&#xff0c;存在字符型注入…

面试系列-携程暑期实习一面

Java 基础 1、Java 中有哪些常见的数据结构&#xff1f; 图片来源于&#xff1a;JavaGuide Java集合框架图 Java 中常见的数据结构包含了 List、Set、Map、Queue&#xff0c;在回答的时候&#xff0c;只要把经常使用的数据结构给说出来即可&#xff0c;不需要全部记住 如下&…

Fyne ( go跨平台GUI )中文文档- 扩展Fyne (七)

本文档注意参考官网(developer.fyne.io/) 编写, 只保留基本用法 go代码展示为Go 1.16 及更高版本, ide为goland2021.2 这是一个系列文章&#xff1a; Fyne ( go跨平台GUI )中文文档-入门(一)-CSDN博客 Fyne ( go跨平台GUI )中文文档-Fyne总览(二)-CSDN博客 Fyne ( go跨平台GUI…

OJ在线评测系统 后端基础部分开发 完善CRUD相关接口

完善相关接口 判斷编程语言是否合法 先从用户的请求拿到Language package com.dduo.dduoj.service.impl;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dduo.dduoj…

11-pg内核之锁管理器(六)死锁检测

概念 每个事务都在等待集合中的另一事务&#xff0c;由于这个集合是一个有限集合&#xff0c;因此一旦在这个等待的链条上产生了环&#xff0c;就会产生死锁。自旋锁和轻量锁属于系统锁&#xff0c;他们目前没有死锁检测机制&#xff0c;只能靠内核开发人员在开发过程中谨慎的…

JavaEE: 深入探索TCP网络编程的奇妙世界(二)

文章目录 TCP核心机制TCP核心机制二: 超时重传为啥会丢包?TCP如何对抗丢包?超时重传的时间设定超时时间该如何确定? TCP核心机制 前一篇文章 JavaEE: 深入探索TCP网络编程的奇妙世界(一) 书接上文~ TCP核心机制二: 超时重传 在网络传输中,并不会一帆风顺,而是可能出现&qu…

基础环境搭建以及大模型部署

文章目录 算力云基础环境搭建以及大模型部署创建实例&#xff08;租用算力云&#xff09;选择服务器&#xff08;一台RTX 3090&#xff09;选择镜像版本连接实例确认环境和显卡信息 安装大模型1.选择大模型2. 下载并安装大模型设置资源下载加速安装git-lfs下载大模型安装依赖的…

如何使用ssm实现基于SpringMVC网上选课系统的设计与实现

TOC ssm696基于SpringMVC网上选课系统的设计与实现jsp 研究背景和来源 目前的管理类系统已各种各样&#xff0c;涉及到生活中的每一个部分。购物类、网站类、信息统计类、办公类、官网类等非常丰富。我国各类系统的发展已非常成熟&#xff0c;这些系统依靠网络和计算机技术不…

如何使用ssm实现线上旅游体验系统+vue

TOC ssm691线上旅游体验系统vue 绪论 课题背景 身处网络时代&#xff0c;随着网络系统体系发展的不断成熟和完善&#xff0c;人们的生活也随之发生了很大的变化。目前&#xff0c;人们在追求较高物质生活的同时&#xff0c;也在想着如何使自身的精神内涵得到提升&#xff0…

15 Midjourney从零到商用·实战篇:建筑设计与室内设计

以前设计师生成一张效果图需要先画草稿&#xff0c;导入三维软件搭建场景后&#xff0c;再用渲染器渲染&#xff0c;而现在只需要有客户的意向图或者自己想法&#xff0c;在MidJourney中就能一键生成惊艳的效果图。 “给我一个prompt我能撬动整个设计界”。设计师在AI绘画面前似…

LLMs之RAG:MemoRAG(利用其记忆模型来实现对整个数据库的全局理解)的简介、安装和使用方法、案例应用之详细攻略

LLMs之RAG&#xff1a;MemoRAG(利用其记忆模型来实现对整个数据库的全局理解)的简介、安装和使用方法、案例应用之详细攻略 目录 MemoRAG的简介 0、更新日志 1、特性 2、路线图 MemoRAG的安装和使用方法 1、安装 安装依赖项 T1、从源码安装 T2、通过pip安装 2、使用方…

【简单介绍】DevOps是什么?

由于 DevOps 方法的广泛采用以及由此产生的快速产品交付和部署&#xff0c;许多部门已采用更敏捷的方法来开发生命周期。在满足市场速度和规模要求的同时&#xff0c;设计安全的软件一直是现代 IT 公司共同面临的问题。结果&#xff0c;超过 52% 的组织因为担心上市速度落后而放…

大数据毕业设计选题推荐-手机销售数据分析系统-Hive-Hadoop-Spark

✨作者主页&#xff1a;IT毕设梦工厂✨ 个人简介&#xff1a;曾从事计算机专业培训教学&#xff0c;擅长Java、Python、PHP、.NET、Node.js、GO、微信小程序、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。 ☑文末获取源码☑ 精彩专栏推荐⬇…

Dubbo入门案例

Dubbo 学习地址&#xff1a;Dubbo3 简介_w3cschool&#xff1b; 01-Dubbo入门案例 ​ 我们先来新建一个Dubbo的小案例来体验一下Dubbo的使用&#xff0c;我们先来创建一个springboot的项目。 1.1-zookeeper下载启动 ​ 在编写我们的入门案例之前&#xff0c;我们需要先去下…

浅拷贝和深拷贝(Java 与 JavaScript)

一、Java 浅拷贝和深拷贝 在Java中&#xff0c;浅拷贝和深拷贝的主要区别在于对对象的引用和内容的复制方式。 浅拷贝 Java 的类型有基本数据类型和引用类型&#xff0c;基本数据类型是可以由 CPU 直接操作的类型&#xff0c;无论是深拷贝还是浅拷贝&#xff0c;都是会复制出…