koichi-murakami / g4python Goto Github PK
View Code? Open in Web Editor NEWGeant4-Python interface
License: BSD 2-Clause "Simplified" License
Geant4-Python interface
License: BSD 2-Clause "Simplified" License
After doing make install on geom, and when I import the geom I get "ImportError: dynamic module does not define module export function (PyInit_geom)" .
I have added the zip file with the construction files and the cmake file with this.
Hello. Thank you for your amazing work.
I tried to install the g4python with Geant4 11.1 and 11.2, and it seems that there are quite several changes in the version, like changes in G4persistence, G4tasking, and G4VTouchable.
I was wondering if you are planning to update the code for the newer version of Geant4.
Thank you!
In file included from /Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:26:
/opt/homebrew/include/pybind11/operators.h:124:67: error: use of overloaded operator '==' is ambiguous (with operand types 'const G4String' and 'const std::string')
PYBIND11_BINARY_OPERATOR(eq, eq, operator==, l == r)
~ ^ ~
/opt/homebrew/include/pybind11/operators.h:77:61: note: expanded from macro 'PYBIND11_BINARY_OPERATOR'
static auto execute(const L &l, const R &r) -> decltype(expr) { return (expr); }
^~~~
/opt/homebrew/include/pybind11/operators.h:52:16: note: in instantiation of template class 'pybind11::detail::op_impl<pybind11::detail::op_eq, pybind11::detail::op_l, G4String, G4String, std::string>' requested here
cl.def(op::name(), &op::execute, is_operator(), extra...);
^
/opt/homebrew/include/pybind11/pybind11.h:1395:12: note: in instantiation of function template specialization 'pybind11::detail::op_<pybind11::detail::op_eq, pybind11::detail::op_l, pybind11::detail::self_t, std::string>::execute<pybind11::class_>' requested here
op.execute(*this, extra...);
^
/Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:43:4: note: in instantiation of function template specialization 'pybind11::class_::def<pybind11::detail::op_eq, pybind11::detail::op_l, pybind11::detail::self_t, std::string>' requested here
.def(py::self == std::string())
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/string:4045:1: note: candidate function [with _Allocator = std::allocator]
operator==(const basic_string<char, char_traits, _Allocator>& __lhs,
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/string:4033:1: note: candidate function [with _CharT = char, _Traits = std::char_traits, Allocator = std::allocator]
operator==(const basic_string<CharT, Traits, Allocator>& lhs,
^
/Users/roy/Downloads/geant4.11.00.b01/install/bin/../include/Geant4/G4String.icc:114:25: note: candidate function
inline G4bool G4String::operator==(const G4String& str) const
^
In file included from /Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:26:
/opt/homebrew/include/pybind11/operators.h:52:33: error: no member named 'execute' in 'pybind11::detail::op_impl<pybind11::detail::op_eq, pybind11::detail::op_l, G4String, G4String, std::string>'
cl.def(op::name(), &op::execute, is_operator(), extra...);
~~~~^
/opt/homebrew/include/pybind11/pybind11.h:1395:12: note: in instantiation of function template specialization 'pybind11::detail::op<pybind11::detail::op_eq, pybind11::detail::op_l, pybind11::detail::self_t, std::string>::execute<pybind11::class>' requested here
op.execute(*this, extra...);
^
/Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:43:4: note: in instantiation of function template specialization 'pybind11::class::def<pybind11::detail::op_eq, pybind11::detail::op_l, pybind11::detail::self_t, std::string>' requested here
.def(py::self == std::string())
^
In file included from /Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:26:
/opt/homebrew/include/pybind11/operators.h:125:67: error: use of overloaded operator '!=' is ambiguous (with operand types 'const G4String' and 'const std::string')
PYBIND11_BINARY_OPERATOR(ne, ne, operator!=, l != r)
~ ^ ~
/opt/homebrew/include/pybind11/operators.h:77:61: note: expanded from macro 'PYBIND11_BINARY_OPERATOR'
static auto execute(const L &l, const R &r) -> decltype(expr) { return (expr); }
^~~~
/opt/homebrew/include/pybind11/operators.h:52:16: note: in instantiation of template class 'pybind11::detail::op_impl<pybind11::detail::op_ne, pybind11::detail::op_l, G4String, G4String, std::string>' requested here
cl.def(op::name(), &op::execute, is_operator(), extra...);
^
/opt/homebrew/include/pybind11/pybind11.h:1395:12: note: in instantiation of function template specialization 'pybind11::detail::op<pybind11::detail::op_ne, pybind11::detail::op_l, pybind11::detail::self_t, std::string>::execute<pybind11::class>' requested here
op.execute(*this, extra...);
^
/Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:45:4: note: in instantiation of function template specialization 'pybind11::class::def<pybind11::detail::op_ne, pybind11::detail::op_l, pybind11::detail::self_t, std::string>' requested here
.def(py::self != std::string())
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/string:4090:1: note: candidate function [with _CharT = char, _Traits = std::char_traits, _Allocator = std::allocator]
operator!=(const basic_string<_CharT,_Traits,Allocator>& lhs,
^
/Users/roy/Downloads/geant4.11.00.b01/install/bin/../include/Geant4/G4String.icc:126:25: note: candidate function
inline G4bool G4String::operator!=(const G4String& str) const
^
In file included from /Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:26:
/opt/homebrew/include/pybind11/operators.h:52:33: error: no member named 'execute' in 'pybind11::detail::op_impl<pybind11::detail::op_ne, pybind11::detail::op_l, G4String, G4String, std::string>'
cl.def(op::name(), &op::execute, is_operator(), extra...);
~~~~^
/opt/homebrew/include/pybind11/pybind11.h:1395:12: note: in instantiation of function template specialization 'pybind11::detail::op<pybind11::detail::op_ne, pybind11::detail::op_l, pybind11::detail::self_t, std::string>::execute<pybind11::class>' requested here
op.execute(*this, extra...);
^
/Users/roy/Downloads/g4python-main/source/global/pyG4String.cc:45:4: note: in instantiation of function template specialization 'pybind11::class::def<pybind11::detail::op_ne, pybind11::detail::op_l, pybind11::detail::self_t, std::string>' requested here
.def(py::self != std::string())
^
4 errors generated.
Due to the techical problem, we cannot run on anaconda python in mac.
To avoid automatic deletion of python object, insert
std::unique_ptr<XXX, py::nodelete>
for each class definition in python binding.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.