Building Scala 2 from Source

As any Gentoo user can confirm, compiling a software yourself generally makes it run faster than using unoptimized binary-bloatware. In order to get another 2% more performance from Scala, I've built it not only once, but twice (two-pass). Note, however, that a third compile may make your system unstable, so I suggest you not to do it.

Check out a copy from SVN:

$ svn co http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk scala

Build

$ cd scala
$ export ANT_OPTS="-Xms512M -Xmx512M"
$ ant dist
..
[stopwatch] [timer.locker: 3:35.597 sec]
..
[stopwatch] [timer.quick: 6:35.216 sec]
..
[stopwatch] [timer.strap: 27:37.100 sec]
..
BUILD SUCCESSFUL
Total time: 52 minutes 51 seconds

With ant from Apple, I am running into the following problem:

..
BUILD FAILED
/Users/daniel/scala/build.xml:174: Execute failed:
java.io.IOException: /usr/share/ant/bin/antRun: not found
..

.. so I got ant from macports.org, which solved the problem for me:

$ sudo port install apache-ant

Now wait about an hour for the build to complete and be prepared for a lot of swapping. Remember, however, that ultimately a hand-compiled system runs much smoother and more efficient, so it's worth the wait.

Run tests

$ test/scalatest

Scala on Androids

The Scala team seems to be on steroids Androids:

$ ant -p | grep android
 android.build      Convert this project's .class files into .dex files
 android.libraries  Builds the Scala library for Android
 android.sources    Create the source directory for Android library

Trac also shows some activity on this matter, such as several Android examples written in or ported to Scala. Interesting. Indeed.

Post a comment

Posting is disabled due to excessive spamming.

 

Last modified on 31.07.2008 at 12:30 GMT