Skip to content

Commit

Permalink
Merge pull request #226 from kikofernandez/features/ghc-update
Browse files Browse the repository at this point in the history
freeze ghc to version 7.10.2, fixes #225
  • Loading branch information
EliasC committed Sep 25, 2015
2 parents 5b4278a + b34ee68 commit 8087bef
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 46 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ encorec

The Encore compiler.

There are two ways of installing the Encore compiler. The first ([**Playing around with Encore**](https://github.com/parapluu/encore/blob/master/README.md#playing-around-with-encore)) uses a virtual box image and it is easy getting the compiler up and running. The disadvantage of this approach is that benchmarks are meaningless. The second approach ([**Building Encore from Source**](https://github.com/parapluu/encore/blob/master/README.md#building-encore-from-source)) is a proper installation of all the dependencies (Haskell, llvm, etc).
There are two ways of installing the Encore compiler. The first ([**Playing around with Encore**](https://github.com/parapluu/encore/blob/master/README.md#playing-around-with-encore)) uses a virtual box image and it is easy getting the compiler up and running. The disadvantage of this approach is that benchmarks are meaningless. The second approach ([**Building Encore from Source**](https://github.com/parapluu/encore/blob/master/README.md#building-encore-from-source)) is a proper installation of all the dependencies (Haskell, llvm, etc).

This readme concludes with a discussion of the Encore command line arguments and details of the documentation.

Expand Down Expand Up @@ -62,11 +62,11 @@ We're using:

- doxygen v1.8.6
- clang:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
- g++ 4.8
- ghc: The Glorious Glasgow Haskell Compilation System, version 7.6.3
- ghc: The Glorious Glasgow Haskell Compilation System, version 7.10.2
- premake4 (Premake Build Script Generator) 4.3
- `scribble` -- only for building the documentation

Expand All @@ -93,29 +93,34 @@ distribution.

Run: `brew update; brew install llvm`

- If you have a newer version of clang (clang-600.0.1), please downgrade to clang-503.0.40 by installing the [Command Line Tools for Xcode - April 2014](https://developer.apple.com/downloads/index.action).

##### Installing `ghc`

You need at least version `7.6.3`.
You need at least version `7.10.2`.

- If you have an older version of `ghc` installed with `homebrew`: get rid of it by saying `brew uninstall haskell-platform; brew uninstall ghc`.
- If you have an older version of `ghc` installed downloaded from the haskell webpage: you need to remove it. Here is a discussion thread on how to do that: http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html Warning: we did not test this, and even if we did: every computer is configured differently. In the future: please use homebrew for every installation where a formula is available. It allows you to uninstall stuff easily once you don't need it any more.

Then install the newest version, saying `brew update && brew install cabal && cabal install cabal-install`.
Then install the newest version:

```
brew update && brew install cabal && cabal install cabal-install && brew install ghc
```

#### Installing the preliminaries on Linux

It's only tested on Ubuntu 14.04, and hopefully it works as well on other
distributions based on Ubuntu or Debian.


# sync with the online repo source
apt-get update
# add sources
sudo add-apt-repository -y ppa:hvr/ghc
# update
sudo apt-get update
# set up the building infrastructure
apt-get install -y clang g++ premake4 haskell-platform
# if you also want to see the HTML doc
apt-apt install -y doxygen
sudo apt-get install -y clang lldb-3.5 g++ make premake4 zlib1g-dev ghc-7.10.2 cabal-install-1.22 racket doxygen
# update cabal packages
cabal update && cabal install cabal-install


##### Version checking

Expand Down Expand Up @@ -173,7 +178,7 @@ Have fun!

Running `encorec foo.enc` will typecheck the source and produce the executable
`foo`. The following options are supported:

* `-c` -- Keep intermediate C-files
* `-tc` -- Typecheck only (don't produce an executable)
* `-o [file]` -- Specify output file
Expand Down
16 changes: 10 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Vagrant.configure(2) do |config|
vb.memory = "2048"
end


#
# View the documentation for the provider you are using for more
# information on available options.
Expand All @@ -91,22 +91,26 @@ Vagrant.configure(2) do |config|
apt-get update
# Install dependencies
apt-get install -y clang lldb-3.5 g++ make premake4 zlib1g-dev ghc-7.8.3 cabal-install-1.22 unzip valgrind git emacs vim racket
apt-get install -y clang lldb-3.5 g++ make premake4 zlib1g-dev ghc-7.10.2 cabal-install-1.22 unzip valgrind git emacs vim
ln -s /usr/bin/cabal-1.22 /usr/bin/cabal
ln -s /usr/bin/lldb-3.5 /usr/bin/lldb
SHELL

config.vm.provision "update cabal", type: "shell", privileged: false, :inline => <<-SHELL
export PATH=/vagrant/release:/opt/ghc/7.8.3/bin:$PATH
config.vm.provision "tools for generating doc", type: "shell", :inline => <<-SHELL
sudo apt-get install texlive-latex-base racket
SHELL

config.vm.provision "update cabal", type: "shell", privileged: false, :inline => <<-SHELL
export PATH=/vagrant/release:/opt/ghc/7.10.2/bin:$PATH
cabal update && cabal install cabal-install
SHELL

config.vm.provision "run test", type: "shell", privileged: false, :inline => <<-SHELL
export PATH=/vagrant/release:/opt/ghc/7.8.3/bin:$PATH
export PATH=/vagrant/release:/opt/ghc/7.10.2/bin:$PATH
cd /vagrant && make clean && make test
SHELL

config.vm.provision "update $PATH", type: "shell", privileged: false, inline: "echo export PATH=/vagrant/release:/opt/ghc/7.8.3/bin:$PATH >> .profile"
config.vm.provision "update $PATH", type: "shell", privileged: false, inline: "echo export PATH=/vagrant/release:/opt/ghc/7.10.2/bin:$PATH >> .profile"

config.vm.provision "symlink to shared folder", type: "shell", privileged: false, inline: "ln -s /vagrant/* /home/vagrant/"
end
51 changes: 25 additions & 26 deletions doc/encore/lang/getting-started/getting-started.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

@title[#:tag "getting-started"]{Getting Up and Running}

There are two ways of installing the Encore compiler. The first (@secref{building-vm})
uses a virtual box image and it is easy getting the compiler up and running. The
disadvantage of this approach is that benchmarks are meaningless. The second approach
There are two ways of installing the Encore compiler. The first (@secref{building-vm})
uses a virtual box image and it is easy getting the compiler up and running. The
disadvantage of this approach is that benchmarks are meaningless. The second approach
(@secref{building-source}) is a proper installation of all the dependencies (Haskell, llvm, etc).

@section[#:tag "building-vm"]{Playing Around with Encore}
Expand Down Expand Up @@ -59,15 +59,15 @@ disadvantage of this approach is that benchmarks are meaningless. The second app
@code{halt} stops the VM as in turning off the computer while @code{suspend} saves the current state of the VM and allows you to get a
faster boot up next time you run @code{vagrant up}.
}

@item{To connect to the VM:
@codeblock|{
localhost$ vagrant up && vagrant ssh
}|
}
]

You can work on your @code{localhost} machine with your favorite editor and use the
You can work on your @code{localhost} machine with your favorite editor and use the
terminal with the @code{vm} only for compilation purposes.

Please take into account that your local folder is shared with the VM, so any files you remove from the VM will be removed
Expand All @@ -85,18 +85,18 @@ Make sure you have installed:

@itemlist[#:style 'ordered
@item{@code{doxygen v1.8.6}}
@item{@code{clang}: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.1.0 Thread model: posix}
@item{@code{clang}: Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin14.5.0 Thread model: posix}
@item{@code{g++ 4.8}}
@item{@code{ghc} The Glorious Glasgow Haskell Compilation System, version 7.8.3}
@item{@code{ghc} The Glorious Glasgow Haskell Compilation System, version 7.10.2}
@item{@code{premake4} (Premake Build Script Generator) 4.3}
]

@subsubsection[#:style 'unnumbered]{Installing dependencies on Mac OS X}

@bold{Installing homebrew}

Go to @hyperlink["http://brew.sh/"]{http://brew.sh/}, the instructions there work nicely.
Make sure that your normal user is an admin (that you can use @code{sudo}). You should
Go to @hyperlink["http://brew.sh/"]{http://brew.sh/}, the instructions there work nicely.
Make sure that your normal user is an admin (that you can use @code{sudo}). You should
not need @code{sudo} to use @code{brew} in the future.

@bold{Installing @code{doxygen}}
Expand All @@ -108,32 +108,28 @@ Run: @code{brew update; brew install doxygen}

Run: @code{brew update; brew install llvm}

If you have a newer version of clang (clang-600.0.1), please downgrade to clang-503.0.40
by installing the @hyperlink["Command Line Tools for Xcode - April 2014."]{https://developer.apple.com/downloads/index.action}


@bold{Installing ghc}

You need at least version @code{7.6.3}.
You need version @code{7.10.2}.

If you have an older version of @code{ghc} installed with @code{homebrew}: get rid of
If you have an older version of @code{ghc} installed with @code{homebrew}: get rid of
it by saying:

@codeblock|{
brew uninstall haskell-platform; brew uninstall ghc
}|

If you have an older version of @code{ghc} installed downloaded from the haskell webpage:
If you have an older version of @code{ghc} installed downloaded from the haskell webpage:
you need to remove it. Here is a @hyperlink["discussion thread on how to do that"]{http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html}.

@bold{Warning}: we did not test this, and even if we did, every computer is configured differently.
In the future: please use homebrew for every installation where a formula is available.
@bold{Warning}: we did not test this, and even if we did, every computer is configured differently.
In the future: please use homebrew for every installation where a formula is available.
It allows you to uninstall stuff easily once you don't need it any more.

Then install the newest version:

@codeblock|{
brew update; brew install cabal; cabal install cabal-install.
brew update && brew install cabal && cabal install cabal-install && brew install ghc
}|

@subsubsection[#:style 'unnumbered]{Installing dependencies on Linux}
Expand All @@ -142,16 +138,19 @@ It's only tested on Ubuntu 14.04 and hopefully it works on other distributions b

@codeblock|{
sudo add-apt-repository -y ppa:hvr/ghc
apt-get update

apt-get install -y clang lldb-3.5 g++ make premake4 zlib1g-dev \
ghc-7.8.3 cabal-install-1.22 unzip valgrind git emacs vim
sudo apt-get update

sudo apt-get install -y clang lldb-3.5 g++ make premake4 zlib1g-dev \
ghc-7.10.2 cabal-install-1.22 racket doxygen

cabal update && cabal install cabal-install

ln -s /usr/bin/cabal-1.22 /usr/bin/cabal
ln -s /usr/bin/lldb-3.5 /usr/bin/lldb

export PATH=/opt/ghc/7.8.3/bin:$PATH
cabal update && cabal install cabal-install
export PATH=/opt/ghc/7.10.2/bin:$PATH
cabal update
}|

@subsection{Compiling and installing Encore}
Expand All @@ -171,7 +170,7 @@ This will allow you to invoke the compiler:
$ encorec my_file.enc
}|

in any directory. To do this, add this line to your @code{~/.bashrc} file, inserting
in any directory. To do this, add this line to your @code{~/.bashrc} file, inserting
the proper path for @code{<SOME_DIR>}:

@codeblock|{
Expand All @@ -194,7 +193,7 @@ This will produce an executable that you can run as usual:
Alternatively, you can use the .enc-file as a script by adding:

@codeblock|{
#! /usr/bin/env encorec -run
#! /usr/bin/env encorec -run
}|

as its FIRST line. After you made the file executable:
Expand Down
1 change: 1 addition & 0 deletions mylittlepony.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ executable encorec
, process >=1.2 && <1.3
, template-haskell
, text >=1.1
, ghc == 7.10.2
, unix >=2.7 && <2.8
, unordered-containers
hs-source-dirs: src/back src/front src/ir src/opt src/parser src/types
Expand Down

0 comments on commit 8087bef

Please sign in to comment.