I'm not sure what exactly you're tying to accomplish, but Geoff pointed out
that openbabel has a pkg-config file, which is what most people would use.
On a typical system install, the file is installed at
/usr/lib/pkgconfig/openbabel-2.0.pc (or an architecture dependent
equivalent). Rather than looking for that manually, you would run
pkg-config like below:
$ pkg-config --variable=libdir openbabel-2.0
/usr/lib
$ pkg-config --variable=pkgincludedir openbabel-2.0
/usr/include/openbabel-2.0
$ pkg-config --variable=includedir openbabel-2.0
/usr/include
That should provide the info you are looking for in this case?
On a side note, I wanted to point out that for the current openbabel master
from github, if you want python3 support, the following still works for me:
$ cmake -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
-DPYTHON_EXECUTABLE=/usr/bin/python3 ..
$ make
$ sudo make install
Obviously not in an official release yet, but should work in future
releases.
-David
On Fri, Jan 3, 2014 at 11:31 PM, S Joshua Swamidass <swamid...@gmail.com>wrote:
> So looking more closely at the build system. I think I've narrowed the
> problems down to just a couple manageable issues.
>
> 1. Currently, it seems, cmake doesn't even use setup.py to install or
> build python modules.
>
> 2. So, setup.py, is actually not runnable in version 2.3.2, but this isn't
> obvious because cmake doesn't ever actually use it.
>
> 3. Here are the offending lines:
>
> if "build" in sys.argv:
> shutil.copyfile(os.path.join(srcdir, "pybel_py%dx.py" %
> sys.version_info[0]), "pybel.py")
> shutil.copyfile(os.path.join(srcdir, "openbabel.py"), "openbabel.py")
>
> Which are problemeatic because they look for pybel_py2x.py and
> pybel_py3x.py, neither of which exist on the file system. The good news is
> that just deleting these lines seems to work just fine.
>
>
> 4. And here are the lines that make the setup.py not portable/uploadable
> to pypi. Basically, setup.py assumes that we are in a the src directory
> tree for openbabel, and uses relative references to link the libraries and
> includes. This is not the right way to do it. Rather, we should link to the
> installed libraries here.
>
> obExtension = Extension('_openbabel',
> [os.path.join(srcdir, "openbabel-python.cpp")],
> include_dirs=[os.path.join(srcdir, "..", "..", "include"),
> os.path.join("..", "include")],
> library_dirs=[os.path.join(srcdir, "..", "..", "lib"),
> os.path.join(srcdir, "..", "..", "lib64"),
> os.path.join("..", "lib")],
> libraries=['openbabel']
> )
>
> So here is the question, what is the best way for this python scipt to
> discover where the openbabel libraries and includes are installed? An
> environmental variable? An option to setup.py? Or, ideally, something run
> off the commandline?
>
> If we can solve this problem, we are about 90% of the way to a final
> solution here.
>
>
>
>
> S Joshua Swamidass
> http://swami.wustl.edu/
>
>
> On Fri, Jan 3, 2014 at 6:05 PM, S Joshua Swamidass <swamid...@gmail.com>wrote:
>
>> I'm up for helping a bit. I do understand the setup.py system, and have a
>> few packages already on pypi.
>>
>> But I'll need some help figuring out how the current system works. Is
>> there someone already familiar with this that could help do this?
>>
>> S Joshua Swamidass
>> http://swami.wustl.edu/
>>
>>
>> On Thu, Jan 2, 2014 at 8:27 AM, Geoffrey Hutchison <
>> geoff.hutchi...@gmail.com> wrote:
>>
>>> > 1. Possibly this could be detected by seeing what libraries are
>>> installed in the openbabel install
>>>
>>> Indeed. Many of these things should already be set in the babelconfig.h
>>> header, which should be trivially parseable by Python. If something is
>>> missing, let me know and I can change CMake to add the needed info to
>>> babelconfig.h for this purpose.
>>>
>>> Moreover, most of this info should also be accessible in the
>>> openbabel-2.0.pc for pkg-config, and the CMake module installed for Open
>>> Babel.
>>>
>>> > 2. More reliably, openbabel could install a comand to the install bin
>>> that (perhaps named openbabel-config) that provides all this information
>>> (like include dir, lib dir, compile options, etc) as text to stdout. This
>>> is the mechanism that python uses for its self (with python-config).
>>>
>>> Meh. We already install a CMake module and a pkg-config module, plus
>>> babelconfig.h. It's certainly easy to write such a script, but I guess my
>>> question is "how many of these things do we need?"
>>>
>>> > 3. Have setup.py give clean information about why it fails if it can't
>>> get info (e.g. need to upgrade openbabel before install, etc.)
>>>
>>> This would be an extremely welcome improvement.
>>>
>>> > What do you think?
>>>
>>> Sounds great. Are you volunteering? ;-)
>>>
>>> Cheers,
>>> -Geoff
>>>
>>>
>>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss