| Summary: | g4py compilation: error: no matching function for call to G4UnitsTable::G4UnitsTable | ||
|---|---|---|---|
| Product: | Environments | Reporter: | Philipp Klaus <klaus> |
| Component: | g4py | Assignee: | Koichi Murakami <Koichi.Murakami> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | ||
| Priority: | P4 | ||
| Version: | 10.6 | ||
| Hardware: | All | ||
| OS: | All | ||
Am I really the only one encountering this issue? I would really like to use the Python interface. I understand, everyone might face other problems right now but it would be very kind if I got a quick statement such as "works for me" or "seen the bug report, no time to check for now" or even "sorry, the Python bindings are not that important to us", which I hope isn't the case. It would be great, if there was a sign of life, if you know what I mean :D Which version of geant4 is used? I cannot reproduce the problem. This kind of error could happen when the corresponding class/func definitions mismatch with boost codes. (In reply to Koichi Murakami from comment #3) Thank you for your answer, Mr. Murakami. > Which version of geant4 is used? I'm using the latest release: geant4.10.06.p01. > I cannot reproduce the problem. > This kind of error could happen when the corresponding class/func > definitions mismatch with boost codes. On my Arch Linux computer (up-to-date as of today), I have boost 1.72.0 installed. Ubuntu 18.04 used in my Docker container ships with Boost 1.65.1. The issue I see on both installations is identical. My Dockerfile to reproduce with with Ubuntu 18.04 can be found here: https://github.com/pklaus/geant4_docker (In reply to Koichi Murakami from comment #3) > Which version of geant4 is used? > I cannot reproduce the problem. So which version of geant4, the boost libraries and Python are you using and testing against? Is there any newer Git/master/SVN/trunk version of geant4 publicly available? What else can I do (other than what I already did: providing the versions used, stating the exact error message, providing a reproducible example with the Dockerfile)? Can you please try the latest patch release 10.6.p02? This specific problem should have been fixed. Thanks. Thank you for publishing the new release. I was able to successfully compile it together with the Python3 support, see the updated Dockerfile. The build fails if I set
-DGEANT4_ENABLE_TESTING=ON
with the following error message:
> CMake Error at cmake/Modules/G4CMakeMain.cmake:113 (add_subdirectory):
> add_subdirectory given source "tests" which is not an existing directory.
> Call Stack (most recent call first):
> CMakeLists.txt:50 (include)
But that seems a minor issue and has nothing to do with the original topic of this issue.
Thank you very much for fixing the problem with the Python package not compiling!
The "tests" module is not distributed in the public source and that option is only for internal use, so all is fine. |
I have trouble compiling the Python support of Geant4 (g4py). It fails with the following message: > [ 0%] Building CXX object source/global/CMakeFiles/pyG4global.dir/G4PyCoutDestination.cc.o > [ 0%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4ApplicationState.cc.o > [ 1%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4Exception.cc.o > [ 1%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4ExceptionHandler.cc.o > [ 2%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4ExceptionSeverity.cc.o > [ 2%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4RandomDirection.cc.o > [ 2%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4RotationMatrix.cc.o > [ 3%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4StateManager.cc.o > [ 3%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4String.cc.o > [ 4%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4ThreeVector.cc.o > [ 4%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4Timer.cc.o > [ 4%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4Transform3D.cc.o > [ 5%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4TwoVector.cc.o > [ 5%] Building CXX object source/global/CMakeFiles/pyG4global.dir/pyG4UnitsTable.cc.o > In file included from /opt/geant4/geant4-src/environments/g4py/source/boost/pyG4indexing.hh:37:0, > from /opt/geant4/geant4-src/environments/g4py/source/global/pyG4UnitsTable.cc:32: > /usr/include/boost/python/suite/indexing/vector_indexing_suite.hpp: In instantiation of 'static boost::python::api::object boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies>::get_slice(Container&, boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies>::index_type, boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies>::index_type) [with Container = G4UnitsTable; bool NoProxy = false; DerivedPolicies = boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>; boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies>::index_type = long unsigned int]': > /usr/include/boost/python/suite/indexing/detail/indexing_suite_detail.hpp:584:46: required from 'static boost::python::api::object boost::python::detail::slice_helper<Container, DerivedPolicies, ProxyHandler, Data, Index>::base_get_slice(Container&, PySliceObject*) [with Container = G4UnitsTable; DerivedPolicies = boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>; ProxyHandler = boost::python::detail::no_proxy_helper<G4UnitsTable, boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>, boost::python::detail::container_element<G4UnitsTable, long unsigned int, boost::python::detail::final_vector_derived_policies<G4UnitsTable, false> >, long unsigned int>; Data = G4UnitsCategory*; Index = long unsigned int]' > /usr/include/boost/python/suite/indexing/indexing_suite.hpp:206:53: required from 'static boost::python::api::object boost::python::indexing_suite<Container, DerivedPolicies, NoProxy, NoSlice, Data, Index, Key>::base_get_item(boost::python::back_reference<T&>, PyObject*) [with Container = G4UnitsTable; DerivedPolicies = boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>; bool NoProxy = false; bool NoSlice = false; Data = G4UnitsCategory*; Index = long unsigned int; Key = G4UnitsCategory*; PyObject = _object]' > /usr/include/boost/python/suite/indexing/indexing_suite.hpp:184:37: required from 'void boost::python::indexing_suite<Container, DerivedPolicies, NoProxy, NoSlice, Data, Index, Key>::visit(Class&) const [with Class = boost::python::class_<G4UnitsTable>; Container = G4UnitsTable; DerivedPolicies = boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>; bool NoProxy = false; bool NoSlice = false; Data = G4UnitsCategory*; Index = long unsigned int; Key = G4UnitsCategory*]' > /usr/include/boost/python/def_visitor.hpp:31:9: required from 'static void boost::python::def_visitor_access::visit(const V&, classT&) [with V = boost::python::def_visitor<boost::python::indexing_suite<G4UnitsTable, boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>, false, false, G4UnitsCategory*, long unsigned int, G4UnitsCategory*> >; classT = boost::python::class_<G4UnitsTable>]' > /usr/include/boost/python/def_visitor.hpp:67:34: required from 'void boost::python::def_visitor<DerivedVisitor>::visit(classT&) const [with classT = boost::python::class_<G4UnitsTable>; DerivedVisitor = boost::python::indexing_suite<G4UnitsTable, boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>, false, false, G4UnitsCategory*, long unsigned int, G4UnitsCategory*>]' > /usr/include/boost/python/class.hpp:221:9: required from 'boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const boost::python::def_visitor<Derived>&) [with Derived = boost::python::indexing_suite<G4UnitsTable, boost::python::detail::final_vector_derived_policies<G4UnitsTable, false>, false, false, G4UnitsCategory*, long unsigned int, G4UnitsCategory*>; W = G4UnitsTable; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified; boost::python::class_<T, X1, X2, X3>::self = boost::python::class_<G4UnitsTable>]' > /opt/geant4/geant4-src/environments/g4py/source/global/pyG4UnitsTable.cc:43:47: required from here > /usr/include/boost/python/suite/indexing/vector_indexing_suite.hpp:85:27: error: no matching function for call to 'G4UnitsTable::G4UnitsTable(__gnu_cxx::__normal_iterator<G4UnitsCategory**, std::vector<G4UnitsCategory*> >, __gnu_cxx::__normal_iterator<G4UnitsCategory**, std::vector<G4UnitsCategory*> >)' > return object(Container(container.begin()+from, container.begin()+to)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from /opt/geant4/geant4-src/environments/g4py/source/global/pyG4UnitsTable.cc:33:0: > /opt/geant4/geant4-install/bin/../include/Geant4/G4UnitsTable.hh:66:5: note: candidate: G4UnitsTable::G4UnitsTable() > G4UnitsTable(); > ^~~~~~~~~~~~ > /opt/geant4/geant4-install/bin/../include/Geant4/G4UnitsTable.hh:66:5: note: candidate expects 0 arguments, 2 provided > /opt/geant4/geant4-install/bin/../include/Geant4/G4UnitsTable.hh:63:7: note: candidate: G4UnitsTable::G4UnitsTable(const G4UnitsTable&) > class G4UnitsTable : public std::vector<G4UnitsCategory*> > ^~~~~~~~~~~~ > /opt/geant4/geant4-install/bin/../include/Geant4/G4UnitsTable.hh:63:7: note: candidate expects 1 argument, 2 provided > make[2]: *** [source/global/CMakeFiles/pyG4global.dir/pyG4UnitsTable.cc.o] Error 1 > source/global/CMakeFiles/pyG4global.dir/build.make:374: recipe for target 'source/global/CMakeFiles/pyG4global.dir/pyG4UnitsTable.cc.o' failed > make[1]: *** [source/global/CMakeFiles/pyG4global.dir/all] Error 2 > CMakeFiles/Makefile2:151: recipe for target 'source/global/CMakeFiles/pyG4global.dir/all' failed > Makefile:140: recipe for target 'all' failed > make: *** [all] Error 2 > The command '/bin/sh -c make -j 1' returned a non-zero code: 2 I tried this on an Arch Linux machine (rolling release, cutting edge versions as of 2020-03-08) as well as within a Docker container based on Ubuntu 18.04. Unfortunately, the problem is the same in both environments. I can state further details about the versions of external libraries used if needed.