[cctbxbb] Using cctbx::uctbx::unit_cell in c++ code / boosted to Python

Graeme.Winter at diamond.ac.uk Graeme.Winter at diamond.ac.uk
Fri Jan 25 05:46:45 PST 2013


Hi Folks,

Been working on some c++ coding using boost etc (which I have to say is great) however I found one bit of weirdness.

If I want to generate a cctbx::uctbx::unit_cell in c++ code then access this from Python I get

Traceback (most recent call last):  File "tst_x2tbx.py", line 67, in <module>
    tst_x2tbx(sys.argv[1])
  File "tst_x2tbx.py", line 6, in tst_x2tbx
    import x2tbx
  File "/Users/graeme/svn/cctbx/sources/x2tbx/__init__.py", line 7, in <module>
    ext = boost.python.import_ext("x2tbx_ext", optional = False)
  File "/Users/graeme/svn/cctbx/sources/cctbx_project/boost_adaptbx/boost/python.py", line 36, in import_ext
    + ["  "+p for p in sys.path]))
ImportError: __import__("x2tbx_ext"): dlopen(/Users/graeme/svn/cctbx/prebuild/lib/x2tbx_ext.so, 2): Symbol not found: cctbx::uctbx::unit_cell::unit_cell(scitbx::af::tiny<double, 6ul> const&)
  Referenced from: /Users/graeme/svn/cctbx/prebuild/lib/x2tbx_ext.so
  Expected in: flat namespace
 in /Users/graeme/svn/cctbx/prebuild/lib/x2tbx_ext.so
  sys.path:
….

unless I have

import cctbx.uctbx # explicit import

at the top of the Python code - have I done something wrong with the SConscript? I found something similar with

import scitbx.array_family.flex # explicit import

which libtbx.clean_clutter complains about as I don't reference it (hence the additional comment)

Equally I could just leave the additional clutter there but it feels like I should not need it...

Thanks,

Graeme

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 





More information about the cctbxbb mailing list