Git Product home page Git Product logo

symengine.f90's Issues

Symengine.f90 throws exceptions on Windows

I trying to run the test cases of symengine.f90 on windows 10.

Symengine has been installed using vcpkg. Btw it seems that there is a mismatch between the displayed version (0.10.0) and the actual version (0.9.0) on vcpkg.
I compiled both the x86 and x64 dlls successfully.

Then I compiled symengine.f90 in visual studio 2019, with ifort classic 2021.5.0. I linked the project to symengine.lib and made sure the symengine-0.9.dll ends up in the build folder.

When I run the test I get the following exception right after calling a = SymInteger(12)
image

The same happens in Release, x64 or x86.

Rename repository to symengine.f

symengine.f90 signals bindings to an old fortran standard. Perhaps we could rename it to symengine.f to avoid the fortran version in the name?

Support fpm

It would be nice if the Fortran wrapper could be built and used as a dependency with fpm.

The challenges are the many libraries that need to be installed and linked. Last time I tried the command needed was:

gfortran -o test_symengine -I/usr/local/include/symengine symengine_cwrapper.o test_symengine.o -L/usr/local/lib -lsymengine -lteuchos -lstdc++ -lmpfr -lgmp -lbfd

Or with the C++ driver as compiler (see #6):

g++ test.o symengine.o /home/symengine/build/symengine/libsymengine.a /home//symengine/build/symengine/utilities/teuchos/libteuchos.a -lgfortran -lgmp -lbfd -otest

@certik, is symengine installable using conda or pip?

Figure out how to allow the x**2+y**2 syntax with symbolic expressions

@ivan-pi posted an example here:

https://fortran-lang.discourse.group/t/code-generation-using-sympy/321/5

use symengine

type(sym_t) :: x, y
type(expr_t) :: f

call f%set([x,y], x**2 + y**2)
call fortran_function(f,'File','myfile')
end

I assume one must overload the + and ** operators, and then make it work with the sym_t type (I would just call it sym, as in Matlab). One issue is about ensuring it does not leak memory, i.e. in: c = a + b + c, it must automatically deallocate the intermediate expressions. The same in x**2+y**2, the operator ** first creates x**2, but then when you do x**2+y**2, it must deallocate the x**2. In C++ and in Python, when the expression goes out of scope, its destructor gets called which deallocates the memory.

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.