Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify which LLVM binaries GHC should use?

Tags:

I have successfully built PortFusion with the brand new 64-bit GHC 7.6.1 Release Candidate 1 for Windows.

Using freshly downloaded native 64-bit mingw binaries from http://www.drangon.org/mingw, the network package was as easy to install (after a bunch of non-relevant small fixes) as a simple

CC=mingw64/bin/gcc cabal install

There is also an LLVM toolchain package on the same website.

Now I wonder how I could tell GHC to use specific LLVM binaries during compilation.


Would it be something as simple and similar to above as:

#v??v
 LLVM=????????? ghc -W -O2 -fllvm -optlo-O3 --make src/Main.hs
 LLVM=????????? cabal install PortFusion -f llvm #¹
#^??^

¹ relevant line in PortFusion.cabal defining the llvm flag

or completely different?

like image 762
Cetin Sert Avatar asked Aug 13 '12 07:08

Cetin Sert


2 Answers

For the record, the answer to the question in the title is

ghc -pgmlo opt_cmd -pgmlc llc_cmd -fllvm ...

opt_cmd and llc_cmd can be either command names (that will be looked up in PATH) or full pathnames.

like image 174
Reid Barton Avatar answered Oct 11 '22 18:10

Reid Barton


You may be able to get GHC to use certain binaries by altering where they are defined in the PATH environment variable. Earlier takes precedence. Presumably, System PATH is also higher precedence than User PATH.

like image 32
mcandre Avatar answered Oct 11 '22 19:10

mcandre