camfort: CamFort - Cambridge Fortran infrastructure

[ analysis, apache, fortran, language, library, program ] [ Propose Tags ]

CamFort is a tool for the analysis, transformation, and extension of Fortran code base.

[Skip to Readme]


[Last Documentation]

  • Analysis
    • Analysis.Annotations
    • Analysis.CallGraph
    • Analysis.IntermediateReps
    • Analysis.LVA
    • Analysis.Loops
    • Analysis.Syntax
    • Analysis.Types
  • Extensions
    • Extensions.UnitParser
    • Extensions.UnitSyntaxConversion
    • Extensions.Units
    • Extensions.UnitsEnvironment
    • Extensions.UnitsSolve
    • Extensions.UnitsSolveHMatrix
  • Helpers
  • Main
  • Output
  • Transformation
    • Transformation.CommonBlockElim
    • Transformation.CommonBlockElimToCalls
    • Transformation.DeadCode
    • Transformation.DerivedTypeIntro
    • Transformation.EquivalenceElim
    • Transformation.Syntax
  • Traverse


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.62, 0.615, 0.700, 0.800, 0.802, 0.804, 0.900, 0.901, 0.902, 0.903, 0.904, 0.905, 0.906, 1.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.2.0 (info)
Dependencies array (>=0.4), base (<5), comonad (>=3), containers (>=, directory (>=1.2), fclabels (>=2), generic-deriving (>=1.5.5), haskell-src (>=1.0.1), hmatrix (>=0.15), language-fortran (>=0.5), matrix (>=0.2.2), mtl (>=2.1), syb (>=0.4), syz (>=0.2), template-haskell (>=2.4), text (>=, transformers (>=0.4), uniplate (>=1.6.10), vector (>=0.1) [details]
License BSD-3-Clause
Copyright 2012-2016 University of Cambridge
Author Dominic Orchard, Matthew Danish, Mistral Contrastin, Andrew Rice, Oleg Oshmyan
Category Language, tools
Source repo head: git clone
Uploaded by DominicOrchard at 2016-03-11T00:26:57Z
Reverse Dependencies 1 direct, 0 indirect [details]
Executables camfort
Downloads 10155 total (84 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-27 [all 2 reports]

Readme for camfort-0.62

[back to package description]


Installation & Building

Using Stack

We recommend using Stack ( to build Camfort.

  1. Install Stack following the instructions here:
  2. Checkout the latest version of language-fortran
  3. Checkout the latest version of camfort
  4. Build using Stack
git clone
git clone
cd camfort
stack build
stack install      # install binary
stack exec camfort # run camfort

Please note that at this time we have been unable to compile Camfort on Windows due to a problem with the hmatrix dependency.

Using Cabal

Cabal does not automatically install the build tools. If you wonder why checkout haskell/cabal#220.

$ cabal install alex happy

Install the native packages needed for hmatrix dependency

sudo apt-get install libgsl0-dev liblapack-dev libatlas-base-dev

For general usage

$ cabal install camfort

For development

$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal exec bash

This spawns a new shell with only the packages within the sandbox available.

$ ghc Main.hs -o camfort

This generates a camfort executable in the root directory using only the packages in the sandbox and none of ~/.cabal or system Haskell packages.


CamFort - Cambridge Fortran Infrastructure.
Usage: camfort <MODE> <INPUT> [OUTPUT] [OPTIONS...]
Refactor functions:
	common         	 [common block elimination]
	commonArg      	 [common block elimination (to parameter passing)]
	equivalence    	 [equivalence elimination]
	dataType       	 [derived data type introduction]
	dead           	 [dead-code elimination]
	units          	 [unit-of-measure inference]
	removeUnits    	 [unit-of-measure removal]

Analysis functions:
	asts           	 [blank analysis, outputs analysis files with AST information]
	lva            	 [live-variable analysis]
	loops          	 [loop information]
	count          	 [count variable declarations]
	criticalUnits  	 [calculate the critical variables for units-of-measure inference]
	ast            	 [print the raw AST -- for development purposes]

  -v, -?    --version            show version number
  -e FILES  --exclude=FILES      files to exclude (comma separated list, no spaces)
  -s ID     --units-solver=ID    units-of-measure solver. ID = Custom or LAPACK
  -l ID     --units-literals=ID  units-of-measure literals mode. ID = Unitless, Poly, or Mixed