Message: Problem compiling g4py on Ubuntu Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Problem compiling g4py on Ubuntu 

Forum: Installation and Configuration
Date: 25 Apr, 2012
From: Bjørn Helge Østerås <Bjørn Helge Østerås>

Hello.

I have tried compiling g4py on my home and on my work computer under
ubuntu installed via wubi.
On my home computer the installation works perfectly, but on my work
computer the compilation of g4py gives me errors when compiling
pyG4Run.cc ... and pyG4Event.cc ...

The main difference of the computers is that my work computer is an
older windows xp computer and my home computer is a newer windows 7
computer.

To the best of my knowlegde I have used the same protocol for building
all the components on both computers.

Does anyone have any suggestion on why the compilation fails for my
work computer? And how I can fix it?

The protocol is as follows:

-----------------------------------------------------------------------

Installation of packages:
sudo apt-get install cmake
sudo apt-get install build essentials
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libqt4-dev
sudo apt-get install libXmu-dev
sudo apt-get install zlibc
sudo apt-get install libxerces-c-dev

Installation of CLHEP:
cd path/to/CLHEP
cmake -DCMAKE_INSTALL_PREFIX=/path/to/CLHEP
make
make test
make install

Installation of GEANT4:
cd path/to/geant4-build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/Geant4-9.5-install
-DCLHEP_ROOT_DIR=/path/to/CLHEP-2.1.2.2-install
-DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON
-DGEANT4_USE_GDML=ON /path/to/Geant4-9.5-source

Installation of boost:
cd path/to/boost1_49_0
./bootstrap.sh --prefix=path/to/installation/prefix --with-python-version=2.7
./b2 install

Installation of g4py:
./configure linux64 --prefix=/path/to/g4py
--with-g4-incdir=/path/to/Geant4-9.5-install/include/Geant4
--with-g4-libdir=/path/to/Geant4-9.5-install/lib
--with-clhep-incdir=/path/to/CLHEP-2.1.2.2-install/include
--with-clhep-libdir=/path/to/CLHEP-2.1.2.2-install/lib
--with-boost-incdir=/path/to/BOOST-1.49.0-install/include
--with-boost-libdir=/path/to/BOOST-1.49.0-install/lib
--with-python-libdir=/usr/lib/python2.7
--with-boost-python-lib=boost_python

---------------------------------------------------------------------

The error on my work computer looks very similar for pyG4Run.cc and
pyG4Event.cc.
The error is as follows:

Compiling pyG4Run.cc ...
In file included from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/pointer_holder.hpp:65,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/to_python_indirect.hpp:10,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/converter/arg_to_python.hpp:10,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/call.hpp:15,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object_core.hpp:14,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/args.hpp:25,
                 from
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python.hpp:11,
                 from pyG4Run.cc:33:
/home/bh/Programvare/Geant4-9.5/Geant4-9.5-install/include/Geant4/G4Run.hh:
In constructor ‘boost::python::objects::pointer_holder<Pointer,
Value>::pointer_holder(PyObject*, A0) [with A0 =
boost::reference_wrapper<const G4Run>, Pointer = G4Run*, Value =
G4Run, PyObject = _object]’:
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/make_instance.hpp:71:48:
  instantiated from ‘static Holder*
boost::python::objects::make_instance<T, Holder>::construct(void*,
PyObject*, boost::reference_wrapper<const T>) [with T = G4Run, Holder
= boost::python::objects::pointer_holder<G4Run*, G4Run>, PyObject =
_object]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/make_instance.hpp:45:13:
  instantiated from ‘static PyObject*
boost::python::objects::make_instance_impl<T, Holder,
Derived>::execute(Arg&) [with Arg = const
boost::reference_wrapper<const G4Run>, T = G4Run, Holder =
boost::python::objects::pointer_holder<G4Run*, G4Run>, Derived =
boost::python::objects::make_instance<G4Run,
boost::python::objects::pointer_holder<G4Run*, G4Run> >, PyObject =
_object]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/class_wrapper.hpp:29:51:
  instantiated from ‘static PyObject*
boost::python::objects::class_cref_wrapper<Src,
MakeInstance>::convert(const Src&) [with Src = G4Run, MakeInstance =
boost::python::objects::make_instance<G4Run,
boost::python::objects::pointer_holder<G4Run*, G4Run> >, PyObject =
_object]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/converter/as_to_python_function.hpp:27:9:
  instantiated from ‘static PyObject*
boost::python::converter::as_to_python_function<T,
ToPython>::convert(const void*) [with T = G4Run, ToPython =
boost::python::objects::class_cref_wrapper<G4Run,
boost::python::objects::make_instance<G4Run,
boost::python::objects::pointer_holder<G4Run*, G4Run> > >, PyObject =
_object]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/to_python_converter.hpp:87:5:
  instantiated from ‘boost::python::to_python_converter<T, Conversion,
has_get_pytype>::to_python_converter() [with T = G4Run, Conversion =
boost::python::objects::class_cref_wrapper<G4Run,
boost::python::objects::make_instance<G4Run,
boost::python::objects::pointer_holder<G4Run*, G4Run> > >, bool
has_get_pytype = true]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/class_wrapper.hpp:24:8:
  instantiated from ‘static void
boost::python::objects::class_metadata<T, X1, X2,
X3>::maybe_register_class_to_python(T2*, mpl_::false_) [with T2 =
G4Run, T = G4Run, X1 = G4Run*, X2 =
boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified, mpl_::false_ =
mpl_::bool_<false>]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/class_metadata.hpp:229:9:
  instantiated from ‘static void
boost::python::objects::class_metadata<T, X1, X2,
X3>::register_aux2(T2*, Callback) [with T2 = G4Run, Callback =
boost::integral_constant<bool, false>, T = G4Run, X1 = G4Run*, X2 =
boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/class_metadata.hpp:219:9:
  instantiated from ‘static void
boost::python::objects::class_metadata<T, X1, X2,
X3>::register_aux(void*) [with T = G4Run, X1 = G4Run*, X2 =
boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/class_metadata.hpp:205:9:
  instantiated from ‘static void
boost::python::objects::class_metadata<T, X1, X2, X3>::register_()
[with T = G4Run, X1 = G4Run*, X2 =
boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/class.hpp:497:9:
  instantiated from ‘void boost::python::class_<T, X1, X2,
X3>::initialize(const DefVisitor&) [with DefVisitor =
boost::python::init<>, W = G4Run, X1 = G4Run*, X2 =
boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]’
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/class.hpp:630:5:
  instantiated from ‘boost::python::class_<T, X1, X2,
X3>::class_(const char*, const char*) [with W = G4Run, X1 = G4Run*, X2
= boost::python::detail::not_specified, X3 =
boost::python::detail::not_specified]’
pyG4Run.cc:45:45:   instantiated from here
/home/bh/Programvare/Geant4-9.5/Geant4-9.5-install/include/Geant4/G4Run.hh:55:5:
error: ‘G4Run::G4Run(const G4Run&)’ is private
/home/bh/Programvare/BOOST-1.49.0/BOOST-1.49.0-install/include/boost/python/object/pointer_holder.hpp:194:14:
error: within this context
make[2]: *** [pyG4Run.o] Error 1

When trying to import Geant4 in python I get the following:

>>> import Geant4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bh/Programvare/g4py/lib/Geant4/__init__.py", line 19, in <module>
    from G4run import *
ImportError: No module named G4run


Best regards

Bjørn Helge Østerås

 Add Message Add Message
to: "Problem compiling g4py on Ubuntu"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]