- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令创建安装目录。
mkdir -p /path/to/proj
- 执行以下命令进入安装目录。
cd /path/to/proj
- 执行以下命令获取源码。
wget http://download.osgeo.org/proj/proj-5.2.0.tar.gz
- 执行以下命令解压源码包。
tar -zxvf proj-5.2.0.tar.gz
- 执行以下命令进入解压后的目录。
cd proj-5.2.0/
- 执行以下命令配置。
export CC=gcc CXX=g++ FC=gfortran
./configure --enable-shared --enable-static --prefix=/path/to/proj
- 执行以下命令编译安装。
make all install
- 执行以下命令设置环境变量。
export PATH=/path/to/proj/bin:$PATH
export LD_LIBRARY_PATH=/path/to/proj/lib:$LD_LIBRARY_PATH
export INCLUDE=/path/to/proj/include:$INCLUDE