haskell / statistics

A fast, high quality library for computing with statistics in Haskell.
http://hackage.haskell.org/package/statistics
BSD 2-Clause "Simplified" License
300 stars 68 forks source link

Fails to compile with GHC 9 #173

Closed crockeea closed 2 years ago

crockeea commented 3 years ago

Using stack resolver nightly-2021-08-16, I am unable to install the statistics library due to the following:

statistics       > [45 of 46] Compiling Statistics.Correlation
statistics       > Simplifier ticks exhausted
statistics       >   When trying RuleFired Class op >>=
statistics       >   To increase the limit, use -fsimpl-tick-factor=N (default 100).
statistics       >
statistics       >   If you need to increase the limit substantially, please file a
statistics       >   bug report and indicate the factor you needed.
statistics       >
statistics       >   If GHC was unable to complete compilation even with a very large factor
statistics       >   (a thousand or more), please consult the "Known bugs or infelicities"
statistics       >   section in the Users Guide before filing a report. There are a
statistics       >   few situations unlikely to occur in practical programs for which
statistics       >   simplifier non-termination has been judged acceptable.
statistics       >
statistics       >   To see detailed counts use -ddump-simpl-stats
statistics       >   Total ticks: 9683

This happens with stack run --profile. One version of statistics-0.15.2.0 installs fine (probably the "release" version), while the other (probably the "with profiling" version) fails.

Shimuuar commented 3 years ago

Uh oh... It seems GHC 9.0 i misbehaving somehow. I'll look into it

Shimuuar commented 2 years ago

Current HEAD (and upcoming 0.16) builds fine with 9.0 & 9.2.

maerten commented 2 years ago

I'm seeing this issue on GHC 9.2.3 on MacOS (Apple M1).

FYI, im running 'stack bench --profile' with criterion as a dependency.

UPDATE: disabling the inlining at https://github.com/haskell/statistics/blob/master/Statistics/Correlation.hs#L31 makes it compile fine again on my system.

stevladimir commented 1 year ago

Observing the same issue with GHC-9.0.2 and statistics-0.16.1.0. Adding to stack.yaml

ghc-options:
  statistics: -fsimpl-tick-factor=10000

fixes the problem