installation problems

Asked by Shozeb Haider

Hi,

I am trying to install Ptools on Ubuntu 10.04. I tried using Python 2.4, 2.5 and 2.6 and it all fails.

The bits upto installation of py++ and pygccxml is fine. As per instructions in the tutorial I untar the ptools file. The first step of building the libtools.a is fine. Now the problem starts when I run python interface.py

I get the following error messages. Any help would be much appreciated.
Thanks.

INFO Parsing source file "/home/shozeb/ptools-1.0.4c/ptools.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"." "/home/shozeb/ptools-1.0.4c/ptools.h" -fxml="/tmp/tmpt23LjE.xml"
INFO GCCXML version - 0.9
/home/shozeb/soft/lib/python2.6/site-packages/pygccxml/parser/scanner.py:335: UserWarning: unable to find out array size from expression ""
  warnings.warn( msg )

INFO Parsing source file "/home/shozeb/ptools-1.0.4c/py_details.h" ...

INFO gccxml cmd: /usr/bin/gccxml -I"." "/home/shozeb/ptools-1.0.4c/py_details.h" -fxml="/tmp/tmpi7lnIU.xml"

INFO GCCXML version - 0.9
no surreal type this time.

WARNING: void PTools::CoordsArray::MatrixMultiply(dbl[4] const * mat) [member function]
> compilation error W1006: Py++ need your help to expose function that takes as argument/returns C++ arrays. Take a look on "Function
> Transformation" functionality and define the transformation.

WARNING: PTools::CoordsArray::_getcoords [variable]
> compilation error W1037: Boost.Python library can not expose variables, which are pointer to function. See
> http://www.boost.org/libs/python/doc/v2/faq.html#funcptr for more information.

WARNING: PTools::BaseAttractForceField [class]
> warning W1031: Py++ will generate class wrapper - user asked to expose non - public member function "setDummyTypeList"

WARNING: std::pair<int, int> [struct]
> execution error W1040: The declaration is unexposed, but there are other declarations, which refer to it. This could cause "no to_python
> converter found" run time error. Declarations: std::pair<int, int> Array2D<double>::getDim() [member function]

INFO: file "named_tuple.py" - updated( 0.000000 seconds )
INFO: file "Vuint.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Vuint.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "vector_less__std_scope_vector_less__double__grate___grate_.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "vector_less__std_scope_vector_less__double__grate___grate_.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Vdouble.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Vdouble.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "VCoord3D.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "VCoord3D.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Matrix.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Matrix.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Atomproperty.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Atomproperty.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Atom.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Atom.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AtomPair.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AtomPair.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AtomSelection.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AtomSelection.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "ForceField.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "ForceField.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "BaseAttractForceField.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "BaseAttractForceField.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AttractForceField1.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AttractForceField1.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AttractForceField2.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AttractForceField2.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AttractPairList.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AttractPairList.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "CoordsArray.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "CoordsArray.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Rigidbody.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Rigidbody.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "AttractRigidbody.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "AttractRigidbody.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Coord3D.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Coord3D.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Lbfgs.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Lbfgs.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "McopForceField.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "McopForceField.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Mcoprigid.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Mcoprigid.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Region.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Region.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Screw.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Screw.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Surface.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Surface.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Superpose_t.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Superpose_t.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "Version.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "Version.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "_ptools_free_functions.pypp.hpp" - updated( 0.000000 seconds )
INFO: file "_ptools_free_functions.pypp.cpp" - updated( 0.000000 seconds )
INFO: file "_ptools.main.cpp" - updated( 0.000000 seconds )

Question information

Language:
English Edit question
Status:
Solved
For:
PTools Edit question
Assignee:
No assignee Edit question
Solved by:
Adrien Saladin
Solved:
Last query:
Last reply:
Revision history for this message
Adrien Saladin (adrien-saladin) said :
#1

Hi,

I agree this is an ugly message but this log actually shows a success. There are 4 warnings that I need to fix but there are harmless. A lot of .hpp files are generated during this step and you need to compile the shared python library by just running "scons" once more.

However you may encounter a configuration problem if you have python 2.4, 2.5 and 2.6 installed along with their development packages (python2.X-dev debian packages). This is a bug I would like to fix soon (bug #514763 https://bugs.launchpad.net/ptools/+bug/514763). A workaround exists in the meantime

Revision history for this message
Shozeb Haider (s-haider) said :
#2

Many thanks Adrien. So I moved another step and did scons. but as you had pointed out it got stuck and gave me the error message.

...............
superpose.cpp:45: warning: 'void PTools::PrintMat(double (*)[3])' defined but not used
superpose.cpp:220: warning: 'void PTools::transpose(double (*)[3], double (*)[3])' defined but not used
g++ -o version.os -c -Wall -O2 -fPIC -Woverloaded-virtual -DNDEBUG -ffunction-sections -fvisibility=hidden -fPIC -I. -I/usr/include version.cpp
g++ -o _ptools.so -shared atom.os basetypes.os rigidbody.os attractrigidbody.os coord3d.os pdbio.os geometry.os atomselection.os rmsd.os forcefield.os pairlist.os minimizers/lbfgs_interface.os minimizers/routines.os minimizers/lbfgs_wrapper/lbfgsb_wrapper.os mcopff.os surface.os coordsarray.os superpose.os version.os Pybindings/ForceField.pypp.os Pybindings/Vuint.pypp.os Pybindings/Atomproperty.pypp.os Pybindings/vector_less__std_scope_vector_less__double__grate___grate_.pypp.os Pybindings/BaseAttractForceField.pypp.os Pybindings/AttractRigidbody.pypp.os Pybindings/Mcoprigid.pypp.os Pybindings/AtomSelection.pypp.os Pybindings/AttractForceField2.pypp.os Pybindings/Rigidbody.pypp.os Pybindings/Vdouble.pypp.os Pybindings/Superpose_t.pypp.os Pybindings/Region.pypp.os Pybindings/Matrix.pypp.os Pybindings/Version.pypp.os Pybindings/_ptools_free_functions.pypp.os Pybindings/Surface.pypp.os Pybindings/AtomPair.pypp.os Pybindings/Coord3D.pypp.os Pybindings/AttractPairList.pypp.os Pybindings/VCoord3D.pypp.os Pybindings/Lbfgs.pypp.os Pybindings/CoordsArray.pypp.os Pybindings/AttractForceField1.pypp.os Pybindings/_ptools.main.os Pybindings/Screw.pypp.os Pybindings/McopForceField.pypp.os Pybindings/Atom.pypp.os -L. -L/usr/lib -lgfortran -lpython2.6 -lboost_python
/usr/bin/ld: cannot find -lboost_python
collect2: ld returned 1 exit status
scons: *** [_ptools.so] Error 1
scons: building terminated because of errors.

Is this the same error message you were talking about ? If remove python2.6-dev from my system then I dont even get this far.
Can you please let me know more about the workaround you mentioned?

Thanks

Revision history for this message
Adrien Saladin (adrien-saladin) said :
#3

> /usr/bin/ld: cannot find -lboost_python

you need to install the libboost-python-dev package

Adrien

Revision history for this message
Shozeb Haider (s-haider) said :
#4

Many thanks Adrien. This solved the problem but only up to the next step.

Ran scons without any error msg.
Now the tests section.

make testcpp was fine giving me the msg

echo "running C++ tests"
running C++ tests
python cxxtestgen.py --error-printer ptoolstest.h > runner.cpp
g++ -O2 runner.cpp -I.. -I. -L.. -lptools -o ptoolstest.bin
./ptoolstest.bin
Running 17 tests.................OK!

I got the same msgs as you had pointed out to when I ran python unittest1.py

I tried removing python2.6-dev as you suggested in your workaround but I get the same error msg.

If I remove python2.6dev any earlier then scons doesnt work, so I am presuming it needs to be removed after running the final scons and before running the tests ?

Nearly getting there...many thanks for your patience.

Revision history for this message
Adrien Saladin (adrien-saladin) said :
#5

I have updated the SConstruct file in a new branch.
You can download the new file here: http://bazaar.launchpad.net/~adrien-saladin/ptools/514763/view/head:/SConstruct
Could you try if replacing your SConstruct by this file solves your problem ?
You will probably need to run "scons -c" then "scons" to stay on the very safe way.

Then if you still get lots of errors when running unit tests (in python) then it's probably a problem between your python version and the libs used for linking. In this case you could post here the content of the "ldd _ptools.so" command.

I get something like:
$ ldd _ptools.so
        linux-vdso.so.1 => (0x00007fff48b1e000)
        libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f16584cf000)
        libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0x00007f165801e000)
        libboost_python-py26.so.1.42.0 => /usr/lib/libboost_python-py26.so.1.42.0 (0x00007f1657dca000)
        [...]

You can see here two of references to python 2.6: libpython2.6 and libboost_python-py26. If both libraries do not match or do not match your default python version (when you just run python from the command line) then we would need to think a little bit more at your problem.

Adrien

Revision history for this message
Shozeb Haider (s-haider) said :
#6

Hi Adrien

Changing SConstruct with the one you had asked me to yeilded the following error msg.

scons: Reading SConscript files ...
ImportError: No module named bzrrev:
  File "/home/shozeb/ptools-1.0.4c/SConstruct", line 52:
    import bzrrev

Revision history for this message
Best Adrien Saladin (adrien-saladin) said :
#7

OK, since you used launchpad to contact us, I assumed you also used bzr to retrieve the latest sources. I did not notice the "ptools-1.0.4c" directory in your first message.

We have made few improvements in the launchpad branch of PTools but we have not released a new .tar.gz version yet.
Since you use an Ubuntu 10.04, getting the latest PTools version is very easy (compared to what you already done):

#to install the bzr client:
$ sudo aptitude install bzr

#this will create a new directory "ptools_test" with a bugfix I just pushed but not yet merged in the main development branch.
$ bzr branch lp:~adrien-saladin/ptools/514763 ptools_test

Then just 'cd' in the ptools_test directory and type:
$ python interface.py
$ scons -j4
$ cd Tests
$ make

hopefully it should work...

Revision history for this message
Shozeb Haider (s-haider) said :
#8

Many thanks Adrien. It all worked.

Thanks for being patient.