Giter Site home page Giter Site logo

Comments (7)

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Luca Geretti (Bitbucket: lgeretti, GitHub: lgeretti)


Not yet, I have more urgent activities to do at the moment.

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Pieter Collins (Bitbucket: pietercollins, GitHub: pietercollins)


Have you resolved this yet?

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Pieter Collins (Bitbucket: pietercollins, GitHub: pietercollins)


One problem is that in the Python wrapper is that we need to obtain function pointers, but many functions are declared as (non-template) friend functions, which makes their pointers unavailable. Worse, friend inline functions don't need/have a pointer at all. (Typically they dispatch to a class member, a static class member, or a static member of an Operations class.)

To handle these functions, you either need to declare them in the Python interface (which is a potential source of linking errors, since your function signature must match exactly with that in the library) or wrap the original C++ function to be accessible to Python (which may be inefficient, since your wrapper is a new function which simple forwards to an existing one).

Both techniques are used in the wrappers; see numeric_submodule for the first (redeclare) approach, and linear_algebra_submodule for the second (redefine) approach e.g. _add_<...> template.

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Luca Geretti (Bitbucket: lgeretti, GitHub: lgeretti)


I will try to fix them myself, if I manage. The pynumeric object seems the simplest one to go into, since its error log amounts to just the following:

#!c++

/Library/Developer/CommandLineTools/usr/bin/c++   -std=c++14 -O1 -dynamiclib -Wl,-headerpad_max_install_names  -o numeric.dylib -install_name @rpath/numeric.dylib wrap/CMakeFiles/pynumeric-src.dir/numeric_module.cc.o wrap/CMakeFiles/pynumeric-src.dir/numeric_submodule.cc.o -Wl,-rpath,/Users/lgeretti/Public/sources/ariadne-all/ariadne/build libariadne.dylib -lboost_python -lgmpxx -lgmp -lmpfr -lboost_system -lcairo -lboost_serialization 
Undefined symbols for architecture x86_64:
  "_PyBool_FromLong", referenced from:
      boost::python::to_python_value<bool const&>::operator()(bool const&) const in numeric_submodule.cc.o
  "_PyBool_Type", referenced from:
      boost::python::detail::converter_target_type<boost::python::to_python_value<bool const&> >::get_pytype() in numeric_submodule.cc.o
      boost::python::to_python_value<bool const&>::get_pytype() const in numeric_submodule.cc.o
  "_PyFloat_FromDouble", referenced from:
      boost::python::to_python_value<double const&>::operator()(double const&) const in numeric_submodule.cc.o
  "_PyFloat_Type", referenced from:
      boost::python::detail::converter_target_type<boost::python::to_python_value<double const&> >::get_pytype() in numeric_submodule.cc.o
      boost::python::to_python_value<double const&>::get_pytype() const in numeric_submodule.cc.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<long const&>::operator()(long const&) const in numeric_submodule.cc.o
      boost::python::to_python_value<unsigned int const&>::operator()(unsigned int const&) const in numeric_submodule.cc.o
  "_PyInt_Type", referenced from:
      boost::python::detail::converter_target_type<boost::python::to_python_value<long const&> >::get_pytype() in numeric_submodule.cc.o
      boost::python::to_python_value<long const&>::get_pytype() const in numeric_submodule.cc.o
      boost::python::detail::converter_target_type<boost::python::to_python_value<unsigned int const&> >::get_pytype() in numeric_submodule.cc.o
      boost::python::to_python_value<unsigned int const&>::get_pytype() const in numeric_submodule.cc.o
  "_PyString_FromStringAndSize", referenced from:
      boost::python::converter::arg_to_python<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::arg_to_python(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in numeric_submodule.cc.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in numeric_module.cc.o
      boost::python::api::object::object() in numeric_submodule.cc.o
      boost::python::converter::shared_ptr_from_python<Ariadne::Logical<Ariadne::ExactTag> >::convertible(_object*) in numeric_submodule.cc.o
      _object* boost::python::objects::make_instance_impl<Ariadne::Logical<Ariadne::ExactTag>, boost::python::objects::value_holder<Ariadne::Logical<Ariadne::ExactTag> >, boost::python::objects::make_instance<Ariadne::Logical<Ariadne::ExactTag>, boost::python::objects::value_holder<Ariadne::Logical<Ariadne::ExactTag> > > >::execute<boost::reference_wrapper<Ariadne::Logical<Ariadne::ExactTag> const> const>(boost::reference_wrapper<Ariadne::Logical<Ariadne::ExactTag> const> const&) in numeric_submodule.cc.o
      boost::python::detail::none() in numeric_submodule.cc.o
      boost::python::detail::caller_arity<2u>::impl<void (*)(_object*, bool), boost::python::default_call_policies, boost::mpl::vector3<void, _object*, bool> >::operator()(_object*, _object*) in numeric_submodule.cc.o
      _object* boost::python::detail::invoke<int, void (*)(_object*, bool), boost::python::arg_from_python<_object*>, boost::python::arg_from_python<bool> >(boost::python::detail::invoke_tag_<true, false>, int const&, void (*&)(_object*, bool), boost::python::arg_from_python<_object*>&, boost::python::arg_from_python<bool>&) in numeric_submodule.cc.o
      ...
ld: symbol(s) not found for architecture x86_64

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Luca Geretti (Bitbucket: lgeretti, GitHub: lgeretti)


Sorry, forgot the attachment.

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Original comment by Pieter Collins (Bitbucket: pietercollins, GitHub: pietercollins)


Please attach the error log!

from ariadne.

lgeretti avatar lgeretti commented on May 27, 2024

Fixed some time ago.

from ariadne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.