These are chat archives for symengine/symengine

16th
Jan 2016
Francesco Biscani
@bluescarni
Jan 16 2016 00:40
so as a PSA it looks like clang 3.7.x cannot compile properly some parts of Piranha unfortunately
it looks like a compiler bug from the error message, and I just checked that the current GIT head from the clang repository can compile Piranha again
this might have some impact on the compilability on OSX depending on which clang version they decide to ship. I hope symengine's usage will not be affected.
Sumith Kulal
@Sumith1896
Jan 16 2016 18:36
I was testing out sanitizing for integer overflow, but I think something is messed up in my clang. https://gist.github.com/Sumith1896/55cbccabf7cec050a691
Francesco Biscani
@bluescarni
Jan 16 2016 18:46
what is the problem? it does not produce any executable?
Sumith Kulal
@Sumith1896
Jan 16 2016 18:53
Oh, it does produce an executable.
This trace scared me, compared to the g++ counterpart
@bluescarni How do you suggest we test sanitizers?
Ben Cumming
@bcumming
Jan 16 2016 20:20
This message was deleted
Ben Cumming
@bcumming
Jan 16 2016 20:27

Hello symengine developers.

I am interested in a library for symbolic math for a C++ project. It is a compiler for a DSL, which would benefit from the ability to analyze, simplify etc. equations in the DSL.
For example we might want to look at the RHS of an ODE like

dm/dt = alpha*m + beta

and see that it is linear, and use a rule to find an exact solution to the ODE.

Is symengine useful for such an application? And do you have any documentation about how to use it?

Thanks.

Francesco Biscani
@bluescarni
Jan 16 2016 21:43
@bcumming I am not an expert but I think symengine might not offer such features yet, my best bet would be to try with sympy first and see if it supports something similar
@Sumith1896 you mean you want to test if the sanitizers work or you would like to know how to incorporate them in the regular symengine testing?
In any case, here's my executive summary:
  • you can just add the -fsanitize flag, compile and run the tests as usual. Most of the time the performance penalty will be rather modest, the tests should still run even on travis
  • I have tried personally the address, thread and ub sanitizers and they did a rather good job. I got sometimes errors/warnings related to boost which could be considered as false positives, but overall they were working fine
Francesco Biscani
@bluescarni
Jan 16 2016 21:48
  • there is also an interesting memory sanitizer that can detect memory leaks (I think), but it's not generally very usable as it requires the full dependency chain to be compiled with it activated
  • the only sanitizer that had a somewhat large performance impact was the thread sanitizer when using many threads, but I don't think this applies to symengine (yet)
  • you can use most sanitizers both in clang and gcc, but in my experience clang's support for them was better (at least a few months ago anyway)
  • one some setups you might have to link in explicitly the sanitizer library (e.g., libasan for the address sanitizer)
  • if you want to test a sanitizer you can just write a small program... e.g., for the address sanitizer you can try to create an array of 2 elements and write in the third index. The address sanitizer should catch that and complain loudly