has anyone tried getting Swarm up and running?

19 views
Skip to first unread message

Ian Clarke

unread,
Oct 5, 2009, 3:05:24 AM10/5/09
to swarm-...@googlegroups.com
Has anyone tried following the instructions on this page :

http://code.google.com/p/swarm-dpl/wiki/GettingStarted

I'd love to get some feedback on whether someone (other than me) can
get Swarm up and running.

Ian.

--
Ian Clarke
CEO, Uprizer Labs
Email: i...@uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674

Patrick Wright

unread,
Oct 5, 2009, 3:26:47 AM10/5/09
to swarm-...@googlegroups.com
Hi Ian

Just tried it out. Building Swarm fails

>./build.sh
src/swarm/collections/TreeMap.scala:38: error: no type parameters for
method apply: (value: AnyRef)swarm.Ref[Type]
@scala.continuations.cps[swarm.Bee,swarm.Bee] in object Ref exist so
that it can be applied to arguments (swarm.collections.TreeMap[A,B])
--- because ---
no unique instantiation of type variable Type could be found
left = Some(Ref(new TreeMap[A, B]()));
^
src/swarm/collections/TreeMap.scala:44: error: no type parameters for
method apply: (value: AnyRef)swarm.Ref[Type]
@scala.continuations.cps[swarm.Bee,swarm.Bee] in object Ref exist so
that it can be applied to arguments (swarm.collections.TreeMap[A,B])
--- because ---
no unique instantiation of type variable Type could be found
right = Some(Ref(new TreeMap[A, B]()));
^
two errors found

Scala installed
>scala
Welcome to Scala version 2.8.0.r18915-b20091005020911 (Java
HotSpot(TM) 64-Bit Server VM, Java 1.6.0_16).
Type in expressions to have them evaluated.
Type :help for more information.

Have built the continuations plugin and assigned env vars.


Regards
Patrick

Ian Clarke

unread,
Oct 5, 2009, 11:03:44 AM10/5/09
to swarm-...@googlegroups.com
Ah, ok, can you go a "git pull origin master" and try again?

Regards,

Ian.

Patrick Wright

unread,
Oct 5, 2009, 11:43:41 AM10/5/09
to swarm-...@googlegroups.com
Hi Ian

Build gave one warning

>./build.sh
mkdir: cannot create directory `bin': File exists


Test worked!


Patrick

Ian Clarke

unread,
Oct 5, 2009, 12:12:44 PM10/5/09
to swarm-...@googlegroups.com
Yeah, the build script is sloppy right now, we really need something
better.

Ian.

--
Typed with thumbs, please excuse typos and brevity

ejc

unread,
Oct 5, 2009, 2:07:13 PM10/5/09
to swarm-...@googlegroups.com
I succeeded in getting it running a few weeks ago with the same issue
Patrick reported. I filed a report on it here:

http://code.google.com/p/swarm-dpl/issues/detail?id=1

and came up with a fix.
The only thing I'd mention is that the continuations plugin is
dependent on Java6.

Eric

Ian Clarke

unread,
Oct 5, 2009, 2:13:15 PM10/5/09
to swarm-...@googlegroups.com
Ah, I'd overlooked that. I implemented your fix and closed the bug.

TreeMap.scala is a work in progress anyway.

Ian.

Rick Richardson

unread,
Oct 12, 2009, 3:43:15 PM10/12/09
to Swarm Discussion
I just got the latest scala, continuations and Swarm as per the
directions.

The only thing I had to do was mkdir Swarm/target/classes. (I'm
guessing the empty directory problem struck again)

Aside from that, everything went swimmingly.

Patrick Wright

unread,
Oct 12, 2009, 4:11:12 PM10/12/09
to swarm-...@googlegroups.com
Hi Rick

> The only thing I had to do was mkdir Swarm/target/classes. (I'm
> guessing the empty directory problem struck again)

No, that was my fault. I'd told Ian that Maven wrote to target/, but
actually target is for all build artifacts, and classes go to
target/classes. I had missed adding /classes to the top part of the
build script. Just fixed it, thanks for letting us know.

Glad it worked for you.

Cheers
Patrick

Alasdair Maclean

unread,
Oct 14, 2009, 5:33:59 PM10/14/09
to Swarm Discussion
Hi guys,

I've been folling the GettingStarted guide but I'm getting the
following error when I do a ./build.sh in the Swarm directory:

src/main/scala/swarm/ContTest.scala:3: error: value continuations is
not a member of package scala
import scala.continuations._
^
src/main/scala/swarm/Swarm.scala:3: error: value continuations is not
a member of package scala
import scala.continuations._
<snip>
5 errors found

I'm assuming I've not set up the continuations plugin properly,
although the "pack" ant task in continuations ran successfully (I did
have to provide -Dscala.home to ant for it to work however).

Does anyone know what I could be doing wrong?

Cheers,
Alasdair

ejc

unread,
Oct 15, 2009, 2:04:51 PM10/15/09
to swarm-...@googlegroups.com
On Wed, Oct 14, 2009 at 4:33 PM, Alasdair Maclean
<alasdairm...@googlemail.com> wrote:
>
> Hi guys,
>
> I've been folling the GettingStarted guide but I'm getting the
> following error when I do a ./build.sh in the Swarm directory:
>
> src/main/scala/swarm/ContTest.scala:3: error: value continuations is
> not a member of package scala
> import scala.continuations._
>             ^
> src/main/scala/swarm/Swarm.scala:3: error: value continuations is not
> a member of package scala
> import scala.continuations._
> <snip>
> 5 errors found
>
> I'm assuming I've not set up the continuations plugin properly,
> although the "pack" ant task in continuations ran successfully (I did
> have to provide -Dscala.home to ant for it to work however).
>
> Does anyone know what I could be doing wrong?

It sounds like scalac isn't finding the plugin jar. Do you have the
SCALA_HOME
and
SCALA_C_DIR
environment variables set?

I just tried rebuilding continuations and I had to provide
-Dscala.home when I didn't have SCALA_HOME env variable set.
What platform are you running this on?

Thanks,
Eric

Alasdair Maclean

unread,
Oct 15, 2009, 5:45:01 PM10/15/09
to Swarm Discussion
Hi Eric,

definitely have those environment variables set:

am@amnix:~$ ls $SCALA_HOME
bin compiler-plugins doc lib man src
am@amnix:~$ ls $SCALA_C_DIR
build doc misc README runprof test
build.xml lib plugin.properties run src

This is on Ubuntu 9.04, Java 1.6.0_16, Scala 2.8.0.r19084-
b20091014022846 (is there any other environment info that'd be
relevant?)

You mention plugin.jar, but after a successful pack I can only find
the following jars:

am@amnix:~$ find $SCALA_HOME -name *.jar/home/am/scala/lib/scala-
swing.jar
/home/am/scala/lib/scala-partest.jar
/home/am/scala/lib/jline.jar
/home/am/scala/lib/scala-compiler.jar
/home/am/scala/lib/scalap.jar
/home/am/scala/lib/scala-dbc.jar
/home/am/scala/lib/scala-library.jar
/home/am/scala/compiler-plugins/continuations/lib/jsr166y.jar
/home/am/scala/compiler-plugins/continuations/build/pack/selectivecps-
plugin.jar
/home/am/scala/compiler-plugins/continuations/build/pack/selectivecps-
library.jar
/home/am/scala/compiler-plugins/continuations/build/pack/selectivecps-
src.jar
/home/am/scala/src/scala-library-src.jar
/home/am/scala/src/scalap-src.jar
/home/am/scala/src/scala-dbc-src.jar
/home/am/scala/src/scala-partest-src.jar
/home/am/scala/src/scala-compiler-src.jar
/home/am/scala/src/scala-swing-src.jar
/home/am/scala/doc/scala-devel-docs/examples/plugintemplate/lib/
scalatest.jar

Has the ant pack not built something?

Cheers,
Alasdair

Patrick Wright

unread,
Oct 15, 2009, 5:54:05 PM10/15/09
to swarm-...@googlegroups.com
Hi

The scala.continuations package is part of the selectivecps-library.jar.

What do you get for
jar tf $SCALA_C_DIR/build/pack/selectivecps-library.jar

Patrick

Alasdair Maclean

unread,
Oct 15, 2009, 6:22:59 PM10/15/09
to Swarm Discussion
Hi Patrick,

am@amnix:~$ jar tf $SCALA_C_DIR/build/pack/selectivecps-library.jar
META-INF/
META-INF/MANIFEST.MF
jsr166y.jar
jsr166y/
scala/
scala/concurrent/
scala/continuations/
jsr166y/FJTaskWrapper$.class
jsr166y/FJTaskWrapper.class
scala/concurrent/AbstractSequentialTaskRunner.class
scala/concurrent/AbstractTaskRunner.class
scala/concurrent/FJTaskRunners$FJTaskRunner$$anon$1.class
scala/concurrent/FJTaskRunners$FJTaskRunner.class
scala/concurrent/FJTaskRunners$class.class
scala/concurrent/FJTaskRunners.class
scala/concurrent/ImmediateTaskRunners$ImmediateTaskRunner.class
scala/concurrent/ImmediateTaskRunners$class.class
scala/concurrent/ImmediateTaskRunners.class
scala/concurrent/SimpleTaskRunners$SimpleTaskRunner.class
scala/concurrent/SimpleTaskRunners$class.class
scala/concurrent/SimpleTaskRunners.class
scala/concurrent/TaskRunnersBase$class.class
scala/concurrent/TaskRunnersBase.class
scala/concurrent/ThreadTaskRunners$ThreadTaskRunner$$anon$1.class
scala/concurrent/ThreadTaskRunners$ThreadTaskRunner.class
scala/concurrent/ThreadTaskRunners$class.class
scala/concurrent/ThreadTaskRunners.class
scala/concurrent/cpsops$$anonfun$spawn$1.class
scala/concurrent/cpsops$.class
scala/concurrent/cpsops.class
scala/continuations/ControlContext$$anonfun$flatMap$1$$anonfun$apply
$2.class
scala/continuations/ControlContext$$anonfun$flatMap$1.class
scala/continuations/ControlContext$$anonfun$map$1$$anonfun$apply
$1.class
scala/continuations/ControlContext$$anonfun$map$1.class
scala/continuations/ControlContext$$anonfun$reset$1.class
scala/continuations/ControlContext$$anonfun$run$1.class
scala/continuations/ControlContext$$anonfun$shiftUnitR$1.class
scala/continuations/ControlContext$.class
scala/continuations/ControlContext.class
scala/continuations/Loops$$anon$1.class
scala/continuations/Loops$$anonfun$loopWhile$1.class
scala/continuations/Loops$.class
scala/continuations/Loops$SuspendableListView$$anonfun$flatMap$1$
$anonfun$apply$2.class
scala/continuations/Loops$SuspendableListView$$anonfun$flatMap$1.class
scala/continuations/Loops$SuspendableListView$$anonfun$flatMap$2.class
scala/continuations/Loops$SuspendableListView$$anonfun$foreach$1.class
scala/continuations/Loops$SuspendableListView$$anonfun$foreach$2.class
scala/continuations/Loops$SuspendableListView$$anonfun$map$1$$anonfun
$apply$1.class
scala/continuations/Loops$SuspendableListView$$anonfun$map$1.class
scala/continuations/Loops$SuspendableListView$$anonfun$map$2.class
scala/continuations/Loops$SuspendableListView.class
scala/continuations/Loops.class
scala/continuations/TaskScheduler$.class
scala/continuations/TaskScheduler.class
scala/continuations/cps.class
scala/continuations/cpsv.class
scala/continuations/docps.class
scala/continuations/uncps.class
plugin.properties

scala.continuations would appear (at a glance) to be in there. How
does that jar normally end up on the classpath for the build.sh? Could
this be the step I'm missing?

Cheers,
Alasdair

Patrick Wright

unread,
Oct 15, 2009, 6:37:24 PM10/15/09
to swarm-...@googlegroups.com
Hi

the library looks correct. It's added to the classpath in the build.sh
script, explicitly

#!/bin/bash
if [ ! -d target/classes ]
then
mkdir -p target/classes
fi
scalac -cp $SCALA_C_DIR/build/pack/selectivecps-library.jar \
-unchecked \
-Xpluginsdir $SCALA_C_DIR/build/pack \
-sourcepath src/main/scala -d target/classes \
`find src/main/scala -name '*.scala'`


Try adding -verbose after the scalac command in the build.sh script

scalac -verbose -cp ...

You'll probably want to pipe the output somewhere.

The other thing to double-check is that you're running the right build
of Scala itself. Try

$SCALA_HOME/bin/scala

and see what you get.


Patrick

Alasdair Maclean

unread,
Oct 15, 2009, 7:03:28 PM10/15/09
to Swarm Discussion
Hi Patrick,

right enough, with -verbose show selectivecps-library.jar doesn't get
added to the classpath (note selectivecps-library.jar is missing):
am@amnix:~/Swarm$ ./build.sh
[Classpath = /usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/resources.jar:/
usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/rt.jar:/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/jsse.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/
jce.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/charsets.jar:/home/am/
scala/lib/scala-library.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/
ext/localedata.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/ext/
sunjce_provider.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/ext/
sunpkcs11.jar:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/ext/dnsns.jar:/
home/am/scala/lib/scala-swing.jar:/home/am/scala/lib/scala-
partest.jar:/home/am/scala/lib/jline.jar:/home/am/scala/lib/scala-
compiler.jar:/home/am/scala/lib/scalap.jar:/home/am/scala/lib/scala-
dbc.jar:/home/am/scala/lib/scala-library.jar:target/classes source=src/
main/scala true]
[loaded directory path /usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/
resources.jar:::/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/rt.jar:::/usr/
lib/jvm/java-6-sun-1.6.0.16/jre/lib/jsse.jar:::/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/jce.jar:::/usr/lib/jvm/java-6-sun-1.6.0.16/jre/
lib/charsets.jar:::/home/am/scala/lib/scala-library.jar:::/usr/lib/jvm/
java-6-sun-1.6.0.16/jre/lib/ext/localedata.jar:::/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/ext/sunjce_provider.jar:::/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/ext/sunpkcs11.jar:::/usr/lib/jvm/java-6-
sun-1.6.0.16/jre/lib/ext/dnsns.jar:::/home/am/scala/lib/scala-
swing.jar:::/home/am/scala/lib/scala-partest.jar:::/home/am/scala/lib/
jline.jar:::/home/am/scala/lib/scala-compiler.jar:::/home/am/scala/lib/
scalap.jar:::/home/am/scala/lib/scala-dbc.jar:::/home/am/scala/lib/
scala-library.jar:::target/classes with_source=src/main/scala::: in
1000ms]
<snip>

Scala looks to be the correct one:
am@amnix:~/Swarm$ $SCALA_HOME/bin/scala
Welcome to Scala version 2.8.0.r19084-b20091014022846 (Java HotSpot
(TM) Client VM, Java 1.6.0_16)

I've double checked that $SCALA_C_DIR/build/pack/selectivecps-
library.jar exists:
am@amnix:~/Swarm$ ls $SCALA_C_DIR/build/pack/selectivecps-library.jar
-rw-r--r-- 1 am am 91494 2009-10-14 22:24 /home/am/scala/compiler-
plugins/continuations/build/pack/selectivecps-library.jar

However, if I run scala -verbose -cp $SCALA_C_DIR/build/pack/
selectivecps-library.jar, it does appear in the classpath (as reported
by the verbose logging) - very strange!

Cheers,
Alasdair

Alasdair Maclean

unread,
Oct 15, 2009, 7:19:47 PM10/15/09
to Swarm Discussion
Right, sorted it out - schoolboy error from me I'm afraid.

.bashrc:
*export* SCALA_HOME=...
*export* SCALA_C_DIR=...

Thanks for the help though :-)

Alasdair

P.S. with the environment variables set up properly the GettingStarted
guide worked perfectly, just needed Java 6 (as per my comment on the
guide page)

On Oct 16, 12:03 am, Alasdair Maclean
Reply all
Reply to author
Forward
0 new messages