Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats_rv test failure with Clang #462

Closed
bcdarwin opened this issue Nov 26, 2019 · 13 comments
Closed

stats_rv test failure with Clang #462

bcdarwin opened this issue Nov 26, 2019 · 13 comments

Comments

@bcdarwin
Copy link
Contributor

This is perhaps not a 'fair' issue since Clang isn't supported by the Eigen bindings (owlbarn/eigen#1), but despite this I was able to compile with the Clang in Nix-unstable on Darwin simply by replacing g++ with $(CXX) in eigen_cpp/lib/Makefile in that package (#460). However, this results in a test failure in stats_rvs.044:

cauchy_loc_-1.000000_scale_3.000000: Avg sq diff in cdf 1.2644e-09 pdf 3.37942e-05 max cdf 1.06625e-07 pdf 0.00258429
         Avg err logcdf 0 logpdf 0 ppf 1.76687e-33 isf 1.83486e-28
         Avg err sf 0 logsf 0
[failure] Error Avg isf error in 'cauchy_loc_-1.000000_scale_3.000000' <1E-28: expecting
true, got
false.
@mseri
Copy link
Member

mseri commented Nov 27, 2019

Can you please send a PR to eigen to change g+c to $(CXX)? The error may just be numerical instability, does it fail consistently?

@bcdarwin
Copy link
Contributor Author

On Linux with GCC it doesn't fail. Using Clang it consistently fails but with a fairly small error (~ 1e-28 - 3e-28).

@mseri
Copy link
Member

mseri commented Nov 27, 2019

Thanks. @tachukao if you are looking at tests failures, it may be worth to take also this into account

@mseri mseri closed this as completed Dec 5, 2019
@mseri
Copy link
Member

mseri commented Dec 5, 2019

I think this is now fixed as well. Please reopen it if I am wrong

@bcdarwin
Copy link
Contributor Author

bcdarwin commented Dec 9, 2019

Still failing in the above manner with Clang.

@bcdarwin
Copy link
Contributor Author

bcdarwin commented Dec 9, 2019

I can't reopen but feel free to do so if you like.

@mseri mseri reopened this Dec 9, 2019
@mseri
Copy link
Member

mseri commented Dec 11, 2019

@bcdarwin we are updating again the way eigen is built. Can you check if owl builds in your setting with eigen from git://github.com/nandor/eigen.git ?

@bcdarwin
Copy link
Contributor Author

Switching to Dune 2.0.0 is still a WIP in Nixpkgs. I'm able to build using Linux/gcc but not OSX/Clang but it's seemingly an issue with finding the C++ stdlib which might be related to the generic Nix builders rather than Eigen itself.

@bcdarwin
Copy link
Contributor Author

There are some obvious issues like use of -ansi in eigen_cpp/dune but more generally the issue is that the compiler options are semi-hard-coded (i.e. not easy to override individually) as per #464 .

@mseri
Copy link
Member

mseri commented Dec 11, 2019

I am happy to make all the hard coded flags that can cause problem configurable via custom flags, with the dune 2 changes it will be much easier to do in eigen, and probably we can simplify owl as well.

Meanwhile will the released 0.1.5 be good for you until nix can move to dune2?

@bcdarwin
Copy link
Contributor Author

Excellent, thanks!

(My main setup is Linux, but was just testing on OSX. 0.1.5 compiles on the latter and seems to work fine - I just had to disable the Owl test suite.)

@mseri
Copy link
Member

mseri commented Dec 11, 2019

Thanks. I hope we can also figure out the reason of that failure and close this issue as well

@mseri
Copy link
Member

mseri commented Nov 18, 2020

I wonder if the error on such small margin is meaningful, would it make sense to update the bound to E-27 or 5E-28?

@jzstark jzstark closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants