2
votes

Attempting to install GEOS-3.6.2 on a Linux system with Python 3.6.4 already compiled. I am attempting to make the package with the command:

export PYTHON=/usr/local/bin/python3 && make && sudo make install

The configure command fails with:

...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

I have confirmed that the Python library exists at /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a`

I had compiled python with a simple ./configure --prefix=/usr/local && make && sudo make install

System Stuff:

~/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
1
Please edit your question to include OS name and version. ... The missing "libpython" : A typical example is /usr/lib(64)/{ libpython3.so -> libpython3.6m.so.1.0 }. ... Did you forget to configure Python3 with --enable-shared ?Knud Larsen
As far as I can tell, all the info you asked for is already up there? Can you be more specific? As for the enable-shared, no I did not do that but in previous versions of python/geos I did not need to. I will try that and see if it fixes anything.Brian
Your libpython3.6m.a is not in a system LD_LIBRARY_PATH. /usr/lib(64) is : My hint in the previous comment. /usr/local/lib/ is most often also included in the LD_LIBRARY_PATH. ... /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/ is not. .... No OS name / version can be found in your question : cat /etc/*release*Knud Larsen
My bad: ` $ 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="ubuntu.com" SUPPORT_URL="help.ubuntu.com" BUG_REPORT_URL="bugs.launchpad.net/ubuntu" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial` Also, thanks for the added info, it gave me a better understanding of what it was looking for.Brian
Please do not add things like "solved" to a title. If you managed to find your own solution, then post an answer (which you did, great), and after the timeout accept your own answer.Mark Rotteveel

1 Answers

2
votes

Thanks to Knud's comments above was able to get GEOS to compile properly. Python is now configured with ./configure --prefix=/usr/local --enable-shared and followed with a sudo ldconfig -v /usr/local/lib

Following those actions GEOS compiled just fine with export PYTHON=/usr/local/bin/python3 && ./configure --prefix=/usr/local --enable-python && make && sudo make install

UPDATE: On attempting to build GEOS on another system I ran into this problem again. This time the solution was slightly different. The Python compilation builds the library and with a filename of libpython3.6m.so.1.0. The GEOS configuration is looking for the pattern of libpython$PYTHON_VERSION.*. If the python version is determined to 3.6, which this system was returning, the build will fail due to that added 'm'.

The additional FIX was to add a symlink as ln -s libpython3.6m.1.0 libpython3.6.so in the library directory.