If you use the version of openbabel from git (which I would recommend over
for the 2.3.2 release), then you can just specify PYTHON_EXECUTABLE as the
python3 and it should find everything correctly.

$ git clone https://github.com/openbabel/openbabel.git
$ cd openbabel
$ mkdir build
$ cd build
$ cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_BINDINGS=ON
-DRUN_SWIG=ON
...
-- Found PythonInterp: /usr/bin/python3 (found version "3.5.1")
-- Found PythonLibs: /usr/lib64/libpython3.5m.so (found version "3.5.1")
...
$ grep '^PYTHON' CMakeCache.txt
...
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
PYTHON_INCLUDE_DIR:PATH=/usr/include/python3.5m
PYTHON_LIBRARY:FILEPATH=/usr/lib64/libpython3.5m.so
...



-David


On Tue, Aug 9, 2016 at 10:00 AM, Geoffrey Hutchison <
geoff.hutchi...@gmail.com> wrote:

> Please don't reply to me directly. Many other people on the mailing list
> can answer your question.
>
> Your problem is clear from the WARNING. You want something like
> -DPYTHON_LIBRARY=/usr/lib/python3.4/libpython.so
>
> You need to link to a *file* not a directory where the file is found.
>
> Hope that helps,
> -Geoff
>
> > On Aug 9, 2016, at 9:51 AM, John <johnbriant...@netscape.net> wrote:
> >
> > Geoff,
> >
> >
> > I downloaded the source and installed all the prerequisites. I can't
> figure out how to get it to link to the Python 3 bindings, however.
> >
> > $ cmake ../openbabel-2.3.2 -DPYTHON_BINDINGS=ON
> -DPYTHON_LIBRARY=/usr/lib/python3.4 -DEIGEN3_INCLUDE_DIR=/home/
> john/eigen/eigen-eigen-dc6cfdf9bcec
> >
> > <lots of configuration output, most of which looks good>
> >
> > -- Found PythonInterp: /usr/bin/python (found version "2.7.6")
> > -- Found PythonLibs: /usr/lib/python3.4 (found version "2.7.6")
> > -- Python bindings will be compiled
> > -- Configuring done
> > WARNING: Target "bindings_python" requests linking to directory
> "/usr/lib/python3.4".  Targets may link only to libraries.  CMake is
> dropping the item.
> > -- Generating done
> > -- Build files have been written to: /home/john/openbabel/build
> >
> > As you can see, the configuration has linked to the Python 2
> installation, not Python 3. What is the correct setting to get it to link
> to Python 3 instead?
> >
> >
> > Thanks,
> >
> > John Todd
> >
> >
> > P.S. A few of the tests seem to have failed, but several Google pages
> make it sound like it's no big deal. Should I worry about:
> >
> > -- Looking for conio.h - not found
> >
> > -- Performing Test SCANDIR_NEEDS_CONST - Failed
> > CMake Warning (dev) at test/CMakeLists.txt:171 (include):
> >  Syntax Warning in cmake code at
> >
> > /home/john/openbabel/openbabel-2.3.2/cmake/modules/
> UsePythonTest.cmake:54:14
> >
> >  Argument not separated from preceding token by whitespace.
> > This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> > CMake Warning (dev) at test/CMakeLists.txt:171 (include):
> >  Syntax Warning in cmake code at
> >
> > /home/john/openbabel/openbabel-2.3.2/cmake/modules/
> UsePythonTest.cmake:54:31
> >
> >  Argument not separated from preceding token by whitespace.
> > This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> > CMake Warning (dev) at test/CMakeLists.txt:171 (include):
> >  Syntax Warning in cmake code at
> >
> > /home/john/openbabel/openbabel-2.3.2/cmake/modules/
> UsePythonTest.cmake:57:25
> >
> >  Argument not separated from preceding token by whitespace.
> > This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> > CMake Warning (dev) at test/CMakeLists.txt:171 (include):
> >  Syntax Warning in cmake code at
> >
> > /home/john/openbabel/openbabel-2.3.2/cmake/modules/
> UsePythonTest.cmake:57:39
> >
> >  Argument not separated from preceding token by whitespace.
> > This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >
> > On 08/08/2016 01:27 PM, Geoffrey Hutchison wrote:
> >>> I am fairly new at Python, and am trying to stick to the latest
> version.
> >>> Is it possible to install the Open Babel bindings for Python 3?
> >> Yes. I don't know about the pip packages (or Mint ones) but you can do
> this from source, e.g.:
> >> https://open-babel.readthedocs.io/en/latest/Installation/install.html#
> compile-bindings
> >>
> >> Hope that helps,
> >> -Geoff
> >
>
>
> ------------------------------------------------------------
> ------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to