Ticket #1478 (closed feature request: fixed)

Opened 6 years ago

Last modified 5 years ago

Flag to get information about the compiler and RTS

Reported by: igloo Owned by: igloo
Priority: high Milestone: 6.8.1
Component: Compiler Version: 6.6.1
Keywords: Cc: dons Bulat.Ziganshin@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by p_tanski) (diff)

There should be a flag +RTS -foo that prints info including:

  • The version of GHC used to compile the program
  • The sort of RTS linked against
  • What (canonicalised) platform it was built for, i.e., powerpc-apple-darwin8.10.0

There should also be a flag that can be given to the compiler that prints info including:

  • Whether it has a NCG
  • Whether or not it is registerised
  • Whether it supports ghci/ghc -e
  • What RTSs it has
  • Whether it supports SMP

Ideally this would all be easily machine-parseable.

Change History

Changed 6 years ago by dons

  • cc dons added
  • Whether it supports SMP

and how many cpus are available.

Very useful for working out what values of +RTS -Nn, and then what value of 'n' to use to fork the ideal number of threads.

Changed 6 years ago by igloo

I think "number of CPUs available" would be better in System.Info or similar.

Changed 6 years ago by Isaac Dupree

Well, "number of CPUs available" should have IO in its type, because there are systems where the number of CPUs can change while they're running. I am already suspicious about the rest of the things in System.Info not having IO types (especially if we consider the potential of portable interpreters similar to Yhc, where a running Haskell program could be moved from one system to another - or even be running concurrently on multiple machines at once (actually, then adding even IO to the types wouldn't make them fully make sense)).

Changed 6 years ago by guest

  • cc dons Bulat.Ziganshin@… added; dons removed

standard comments why getArgs has IO in its type is "because it may change from run to run". also, it's easy to use usafePerformIO if we need them in non-IO environment

Changed 6 years ago by p_tanski

  • cc dons Bulat.Ziganshin@… added; dons Bulat.Ziganshin@… removed
  • description modified (diff)

machine-parseable: would one-liner's do? For example: compiled_with: ghc-6.4.1 platform: i386-unknown-mingw32 rts_ways: t, p (use build system codes) registerised: YES (or 1) supports_NCG: YES (or 1) supports_SMP: YES (or 1)

The idea is that all this can go directly from compiler/Makefile into Config.hs into the options. Doesn't need to be after +RTS; might be an argument to ghc --version (no arg means as before; arg with parameter you want returns value like sysctl -n var on Darwin).

Changed 6 years ago by igloo

  • owner set to igloo

I've (locally) fixed the first half.

Changed 6 years ago by igloo

This is mostly done, but there are a few more bits it would be nice to add to the output

Changed 6 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Now done.

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.