在 Linux 上使用 Python 模块编译 GEOS 3.6.2
Compiling GEOS 3.6.2 with Python module on Linux
正在尝试在已编译 Python 3.6.4 的 Linux 系统上安装 GEOS-3.6.2。
我正在尝试使用以下命令制作软件包:
export PYTHON=/usr/local/bin/python3 && make && sudo make install
配置命令失败:
...much snipped...
checking for swig... /usr/bin/swig
checking for SWIG version... 3.0.8
configure: SWIG executable is '/usr/bin/swig'
configure: SWIG library directory is '/usr/share/swig3.0'
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for Python include path... /usr/local/include/python3.6m
checking for Python library path...
configure: error: cannot find Python library path
我已确认 Python 库存在于 /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a`
我用一个简单的 ./configure --prefix=/usr/local && make && sudo make install
编译了 python
系统资料:
~/Downloads/geos-3.6.2$ uname -a
Linux Sleipnir 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
~/Downloads/geos-3.6.2$ which python3
/usr/local/bin/python3
~/Downloads/geos-3.6.2$ python3 -V
Python 3.6.4
~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
多亏了 Knud 的上述评论,GEOS 才得以正确编译。
Python 现在配置为 ./configure --prefix=/usr/local --enable-shared
,然后是 sudo ldconfig -v /usr/local/lib
在执行这些操作后,GEOS 使用 export PYTHON=/usr/local/bin/python3 && ./configure --prefix=/usr/local --enable-python && make && sudo make install
编译得很好
更新:在尝试在另一个系统上构建 GEOS 时,我 运行 再次遇到了这个问题。这次解决方案略有不同。 Python 编译生成库,文件名为 libpython3.6m.so.1.0
。 GEOS 配置正在寻找 libpython$PYTHON_VERSION.*
的模式。如果 python 版本确定为系统返回的 3.6,构建将因添加 'm'.
而失败
额外的 FIX 是在库目录中添加一个符号链接作为 ln -s libpython3.6m.1.0 libpython3.6.so
。
正在尝试在已编译 Python 3.6.4 的 Linux 系统上安装 GEOS-3.6.2。 我正在尝试使用以下命令制作软件包:
export PYTHON=/usr/local/bin/python3 && make && sudo make install
配置命令失败:
...much snipped...
checking for swig... /usr/bin/swig
checking for SWIG version... 3.0.8
configure: SWIG executable is '/usr/bin/swig'
configure: SWIG library directory is '/usr/share/swig3.0'
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for Python include path... /usr/local/include/python3.6m
checking for Python library path...
configure: error: cannot find Python library path
我已确认 Python 库存在于 /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a`
我用一个简单的 ./configure --prefix=/usr/local && make && sudo make install
系统资料:
~/Downloads/geos-3.6.2$ uname -a
Linux Sleipnir 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
~/Downloads/geos-3.6.2$ which python3
/usr/local/bin/python3
~/Downloads/geos-3.6.2$ python3 -V
Python 3.6.4
~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
多亏了 Knud 的上述评论,GEOS 才得以正确编译。
Python 现在配置为 ./configure --prefix=/usr/local --enable-shared
,然后是 sudo ldconfig -v /usr/local/lib
在执行这些操作后,GEOS 使用 export PYTHON=/usr/local/bin/python3 && ./configure --prefix=/usr/local --enable-python && make && sudo make install
更新:在尝试在另一个系统上构建 GEOS 时,我 运行 再次遇到了这个问题。这次解决方案略有不同。 Python 编译生成库,文件名为 libpython3.6m.so.1.0
。 GEOS 配置正在寻找 libpython$PYTHON_VERSION.*
的模式。如果 python 版本确定为系统返回的 3.6,构建将因添加 'm'.
额外的 FIX 是在库目录中添加一个符号链接作为 ln -s libpython3.6m.1.0 libpython3.6.so
。