Thanks Noel,

Should I use sudo instead of root?

Some more info:

'env | grep PYTHION' gives:
PYTHONPATH=/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/MGLToolsPckgs
PYTHONHOME=/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4

This comes from this line in my .cshrc:
source /usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/bin/mglenv.csh

'grep PYTHON  
/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/bin/mglenv.csh'
gives:
unset PYTHONHOME
setenv PYTHONHOME $MGL_ROOT
setenv PYTHONPATH $MGL_ROOT/MGLToolsPckgs

I know that if I don't run mglenv.csh each login AutoDockTools breaks.

I have tried both this:
'~douglas/programs/cmake-2.8.7/bin/cmake  ~/openbabel-2.3.2  
-DPYTHON_BINDINGS=ON  
-DPYTHON_INCLUDE_DIR=/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/include/python2.5/
 
-DPYTHON_LIBRARY=/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/lib/python2.5/
  
-DPYTHON_EXECUTABLE=/usr/people/douglas/programs/mgltools_i86Linux2_1.5.4/bin/python'

and this:
'~douglas/programs/cmake-2.8.7/bin/cmake  ~/openbabel-2.3.2  
-DPYTHON_BINDINGS=ON -DPYTHON_INCLUDE_DIR=/usr/local/include/python2.7  
-DPYTHON_LIBRARY=/usr/local/lib/libpython2.7.a  
-DPYTHON_EXECUTABLE=/usr/local/bin/python2.7'

The former fails with:
[100%] Built target test_tetranonplanar
[100%] Built target test_tetraplanar
[100%] [100%] Built target test_unitcell
Linking CXX shared module ../lib/_openbabel.so
CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o: In  
function `SWIG_Python_ErrorType':
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:1010:  
undefined reference to `PyExc_RuntimeError'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:977:  
undefined reference to `PyExc_MemoryError'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:1007:  
undefined reference to `PyExc_AttributeError'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:1004:  
undefined reference to `PyExc_SystemError'
...
CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o: In  
function `assign<swig::SwigPySequence_Cont<OpenBabel::OBRing>,  
std::vector<OpenBabel::OBRing, std::allocator<Op
enBabel::OBRing> > >':
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:4553:  
undefined reference to `PyErr_Occurred'
CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o: In  
function `swig::traits_from_stdseq<std::vector<OpenBabel::vector3,  
std::allocator<OpenBabel::vector3> >, OpenBa
bel::vector3>::from(std::vector<OpenBabel::vector3,  
std::allocator<OpenBabel::vector3> > const&)':
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:4886:  
undefined reference to `PyTuple_New'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:4890:  
undefined reference to `PyTuple_SetItem'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:4894:  
undefined reference to `PyExc_OverflowError'
/root/openbabel-2.3.2/scripts/python/openbabel-python.cpp:4894:  
undefined reference to `PyErr_SetString'
CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o:(.data.rel.ro+0x48):
 undefined reference to  
`PyObject_GenericGetAttr'
CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o:(.data.rel.ro+0x108):
 undefined reference to  
`PyObject_GenericGetAttr'
collect2: ld returned 1 exit status
make[2]: *** [lib/_openbabel.so] Error 1
make[1]: *** [scripts/CMakeFiles/bindings_python.dir/all] Error 2
make: *** [all] Error 2


The latter fails with:


[100%] Built target test_unitcell
Linking CXX shared module ../lib/_openbabel.so
/usr/local/lib/libpython2.7.a(thread.o): In function  
`_pythread_pthread_set_stacksize':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:497: undefined  
reference to `pthread_attr_setstacksize'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_release_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined  
reference to `sem_post'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_free_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:294: undefined  
reference to `sem_destroy'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_allocate_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined  
reference to `sem_init'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_acquire_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:326: undefined  
reference to `sem_trywait'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:324: undefined  
reference to `sem_wait'
/usr/local/lib/libpython2.7.a(thread.o): In function  
`PyThread_start_new_thread':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:184: undefined  
reference to `pthread_attr_setstacksize'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:194: undefined  
reference to `pthread_create'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:210: undefined  
reference to `pthread_detach'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_release_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined  
reference to `sem_post'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined  
reference to `sem_post'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined  
reference to `sem_post'
/usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_allocate_lock':
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined  
reference to `sem_init'
/usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined  
reference to `sem_init'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_forkpty':
/usr/bin/tmp/Python-2.7.6/./Modules/posixmodule.c:3958: undefined  
reference to `forkpty'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_openpty':
/usr/bin/tmp/Python-2.7.6/./Modules/posixmodule.c:3898: undefined  
reference to `openpty'
collect2: ld returned 1 exit status
make[2]: *** [lib/_openbabel.so] Error 1
make[1]: *** [scripts/CMakeFiles/bindings_python.dir/all] Error 2
make: *** [all] Error 2

In the latter case the errors mention /usr/bin/tmp/Python-2.7.6/ ...  
but I have not specified any location with 'tmp' in the path ... ?

The output from 'grep PYTHON CMakeCache.txt' (below) also does not  
mention any pathname with 'tmp' in it ... so where is this coming from?

PYTHON_BINDINGS:BOOL=ON
PYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python2.7
PYTHON_INCLUDE_DIR:PATH=/usr/local/include/python2.7
PYTHON_LIBRARY:FILEPATH=/usr/local/lib/libpython2.7.a
//ADVANCED property for variable: PYTHON_EXECUTABLE
PYTHON_EXECUTABLE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: PYTHON_INCLUDE_DIR
PYTHON_INCLUDE_DIR-ADVANCED:INTERNAL=1
PYTHON_INCLUDE_PATH:INTERNAL=/usr/local/include/python2.7
//ADVANCED property for variable: PYTHON_LIBRARY
PYTHON_LIBRARY-ADVANCED:INTERNAL=1

cheers,
Doug




Quoting Noel O'Boyle <baoille...@gmail.com> on Fri, 14 Nov 2014  
13:05:04 +0000:

> Hi Douglas,
>
> Your system appears to have at least two, and possibly more, competing
> installations of Python. Is the Python 2.7 in /usr/local the same as
> the one in /usr/bin/tmp? Either way you need to pick a Python
> installation and stick with it - I would try the system Python first
> of all, which appears to be Python 2.5 in your case. Does your PyMol
> use a specific Python installation? - if so, try that one next.
>
> If you "grep PYTHON CMakeCache.txt" you will see which Python has been
> found and what the variable names are. Something like "cmake ..
> -DPYTHON_INCLUDE_DIR=whatever -DPYTHON_LIBRARY=whatever
> -DPYTHON_EXECUTABLE=whatever" (check the variable names) will cover
> all of the bases. If this is not clear, let us know.
>
> And as I always say on this list, as a general rule you should not
> compile anything as root. This may lead to permissions problems down
> the line which will be difficult to diagnose.
>
> Regards,
>      Noel
>
> On 14 November 2014 10:05, Douglas Houston  
> <dhous...@staffmail.ed.ac.uk> wrote:
>> Hi all,
>>
>> I am trying to install a Pymol plugin and it requires my Open Babel to
>> be re-installed, this time including the Python bindings:
>>
>> Python 2.5.1 (r251:54863, Sep 21 2007, 11:20:07)
>> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> import openbabel
>> Traceback (most recent call last):   File "<stdin>", line 1, in <module>
>> ImportError: No module named openbabel
>>
>>
>> I have tried recompiling Open Babel as root with the Python bindings using:
>>
>> tar -xvf openbabel-2.3.2.tar.gz
>> cd openbabel-2.3.2
>> mkdir build
>> cd build/
>> ~douglas/programs/cmake-2.8.7/bin/cmake  ~/openbabel-2.3.2
>> -DPYTHON_BINDINGS=ON
>> make -j2
>>
>>
>> but it fails with the following errors; can anyone help?:
>>
>>
>> [100%] Building CXX object
>> scripts/CMakeFiles/bindings_python.dir/python/openbabel-python.cpp.o
>> Linking CXX executable ../bin/test_unitcell
>> [100%] Built target test_unitcell
>> Linking CXX shared module ../lib/_openbabel.so
>> /usr/local/lib/libpython2.7.a(thread.o): In function
>> `_pythread_pthread_set_stacksize':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:497: undefined
>> reference to `pthread_attr_setstacksize'
>> /usr/local/lib/libpython2.7.a(thread.o): In function  
>> `PyThread_release_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined
>> reference to `sem_post'
>> /usr/local/lib/libpython2.7.a(thread.o): In function `PyThread_free_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:294: undefined
>> reference to `sem_destroy'
>> /usr/local/lib/libpython2.7.a(thread.o): In function  
>> `PyThread_allocate_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined
>> reference to `sem_init'
>> /usr/local/lib/libpython2.7.a(thread.o): In function  
>> `PyThread_acquire_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:326: undefined
>> reference to `sem_trywait'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:324: undefined
>> reference to `sem_wait'
>> /usr/local/lib/libpython2.7.a(thread.o): In function
>> `PyThread_start_new_thread':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:184: undefined
>> reference to `pthread_attr_setstacksize'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:194: undefined
>> reference to `pthread_create'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:210: undefined
>> reference to `pthread_detach'
>> /usr/local/lib/libpython2.7.a(thread.o): In function  
>> `PyThread_release_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined
>> reference to `sem_post'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined
>> reference to `sem_post'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:350: undefined
>> reference to `sem_post'
>> /usr/local/lib/libpython2.7.a(thread.o): In function  
>> `PyThread_allocate_lock':
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined
>> reference to `sem_init'
>> /usr/bin/tmp/Python-2.7.6/Python/thread_pthread.h:269: undefined
>> reference to `sem_init'
>> /usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_forkpty':
>> /usr/bin/tmp/Python-2.7.6/./Modules/posixmodule.c:3958: undefined
>> reference to `forkpty'
>> /usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_openpty':
>> /usr/bin/tmp/Python-2.7.6/./Modules/posixmodule.c:3898: undefined
>> reference to `openpty'
>> collect2: ld returned 1 exit status
>> make[2]: *** [lib/_openbabel.so] Error 1
>> make[1]: *** [scripts/CMakeFiles/bindings_python.dir/all] Error 2
>> make: *** [all] Error 2
>>
>>
>>
>> --
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Comprehensive Server Monitoring with Site24x7.
>> Monitor 10 servers for $9/Month.
>> Get alerted through email, SMS, voice calls or mobile push notifications.
>> Take corrective actions from your mobile device.
>> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to