Hi,

On Wed, Oct 27, 2010 at 08:00:06PM +0100, Noel O'Boyle wrote:
> On 27 October 2010 19:27, Michael Banck <mba...@debian.org> wrote:
> > On Tue, Oct 26, 2010 at 12:35:04PM +0100, Noel O'Boyle wrote:
> >> On 26 October 2010 11:49, Michael Banck <mba...@debian.org> wrote:
> >> > Traceback (most recent call last):
> >> >  File "setup.py", line 26, in <module>
> >> >    shutil.copyfile(os.path.join(srcdir, "openbabel.py"),
> >> > "openbabel.py")
> >> >  File "/usr/lib/python2.6/shutil.py", line 48, in copyfile
> >> >    raise Error("`%s` and `%s` are the same file" % (src, dst))
> >> > shutil.Error: `openbabel.py` and `openbabel.py` are the same file
> >> >
> >> > If I run it from the top source level like "python
> >> > scripts/python/setup.py build", I get
> >> >
> >> > In file included from scripts/python/../../include/openbabel/obutil.h:46,
> >> >                 from scripts/python/openbabel-python.cpp:3018:
> >> > scripts/python/../../include/openbabel/rand.h:41: error: expected
> >> > constructor, destructor, or type conversion before ‘void’
> >> >
> >> > Is this because I have not installed openbabel to /usr yet?  I am trying
> >> > to build a Debian/Ubuntu package, so this will never be the case.  I get
> >> > the same error message as above if I run it from the build directory
> >> > (but as the python setup.py creates another "build" directory, I guess
> >> > this is not the right course of action anyway).
> >> >
> >> > So how exactly are the python bindings supposed to be built?
> >> >
> >> > I would say running "mkdir build; cd build; cmake ..; make" should build
> >> > the python bindings as well, provided that feature has not been switched
> >> > off and the necessary packages are installed.
> >>
> >> The Python bindings are automatically off. To turn on, use
> >> "-DPYTHON_BINDINGS=ON", then "make" will build them. I've updated the
> >> documentation on our website
> >> (http://openbabel.org/wiki/Install_Python_bindings).
> >
> > D'oh, I thought I read the python bindings were activated by default if
> > the python development environment is present.
> >
> > The next problem I had is that the python bindings are getting
> > installed (contrary to everything else) into libdir unconditionally,
> > i.e. DESTDIR is not honored and I get:
> 
> > running install_lib
> > error: could not create '/usr/lib/python2.6/site-packages': Permission
> >        denied
> > creating /usr/lib/python2.6/site-packages
> > make[1]: Leaving directory
> >        `/home/mbanck/debian/debichem/openbabel-2.3.0/obj-i486-linux-gnu'
> >
> > The command run is:
> >
> > make -j1 install 
> > DESTDIR=/home/mbanck/debian/debichem/openbabel-2.3.0/debian/tmp
> >
> > I tried adding a DESTDIR at various places in scripts/CMakeLists.txt,
> > but to no avail so far, I will open a tracker item for this.
> 
> The CMake variable CMAKE_INSTALL_PREFIX controls the install location
> (see install instructions). It's honoured by the python install. You
> can independently set PYTHON_PREFIX if you want.

Well, CMAKE_INSTALL_PREFIX is set to /usr.  The problem is that for
package building, you need to install into a staging directory, usually
something like openbabel-2.3.0/debian/tmp (you're not supposed/allowed
to write anywhere than under the source/build-directory).

As mentioned, the rest is installed fine under that staging directory
(but with a correct prefix of /usr).

> > Anyway, I need to support building two different python versions (or
> > rather, all currently (by Debian) supported python versions, which is
> > (dynamically determined at build time) 2.5 and 2.6 right now), so I
> > looked into manually building the python bindings via setup.py again and
> > finally managed to get this working I think.
> 
> If you want to do it more easily, just set the CMake variables
> PYTHON_EXECUTABLE, etc. (they are listed if you "grep -i
> CMakeCache.txt").

Hrm right, but that makes it difficult not to compile everything twice
etc. 


Michael

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to