[Virgil] virgil installation on Ubuntu 6.06 desktop - not without trouble

Bill Maas bill at stsx.org
Sat Jun 16 05:36:55 PDT 2007


I discovered Virgil just yesterday, and I have high hopes for using it
to replace the AVR-libc/Linux and BASCOM/Windows duo that I've been
involved with for the last 1 1/2 year or so. While I'd personally go for
the AVR-libc, I have to work 15-to-18 year old Windows users who I just
can't bother with C's intricacies. And having to start WXP everytime I
want to do someting with BASCOM has proven to be quite annoying (BASCOM
is the only reason why I have a Windows installation at home). So I hope
that in Virgil I've found a platform-independent language, which suits
me, that is no more difficult to use than BASCOM, which will suit the
user base.

However, even installing Virgil onto my Ubuntu/Linux desktop has proven
to be quite a pain. Admitted, Java on Linux has always required "special
attention". I have zero knowledge of Java, and I don't think I should
need that knowledge: I've compiled many a C program without the
slightest insight in the workings of a C compiler. But I do expect some
elaboration on behalf of a program's makers whenever something special
needs to be done. In that respect, the otherwise excellent Virgil
documentation is, to say the most, terse.

So I decided to put my experiences onto virtual paper. I don't mean to
criticize anyone here, just see it as a collection of hints towards
enhanced user-friendliness.

The docs state that:

"Java uses an environment variable called $CLASSPATH to search for the
classes of an application. In order to run the Virgil compiler, you will
need to set this environment variable to point to the compiler/bin
directory under the virgil directory."

As it turns out, compiling Virgil also requires the CLASSPATH env. var.
to be set:

Without CLASSPATH set:

exocat at aurora:~/virgil-03/compiler$ make
javac -source 1.5 -d bin `find src/vpc src/cck -name '*.java'`
src/vpc/Compiler.java:36: error: Can't find default package ‘cck.util’.
Check the CLASSPATH environment variable and the access to the archives
src/vpc/Compiler.java:41: error: Package ‘vpc.sched’ not found in


exocat at aurora:~/virgil-03/compiler$ export
exocat at aurora:~/virgil-03/compiler$ make
javac -source 1.5 -d bin `find src/vpc src/cck -name '*.java'`
src/vpc/Compiler.java:152: error: Invalid declaration.
        for (String f: files) c.addFile(f);

Looks better, but still produces errors. Unsettling detail: "javac
-source 1.5 .." vs. the actual jvm dir used: 

Let's not dwell on GNU/Debian version numbering..;). But I clearly have
[an equivalent of] Java 1.5 installed. GNU people hate man pages because
they think that info(1) is better, so the javac(1) manpage refers to the
javac(1) manpage (unbelievable). There's also a reference to gcj-4.1(1),
which reveals that gcj(1) does not understand a "-source" option. And as
javac(1) explains: "Options different for javac(1) and gcj(1) are
translated". It doesn't mention those options however, let alone what
they are translated to. So the 1.4 vs. 1.5 hypothesis must remain
unconfirmed, at least from the part of the available documentation.

Anyway, let's just see if there is a Jave 1.5 .deb available. Just
trying it out won't hurt (hopefully). Thank heavens for those unpaid
souls who care to share their experiences and write instructions, like

Alarming sidenote: "Installing Java on Debian is not the simplest thing
in the world [...]". Sounds promising. Getting the right Sun package
proves to be rocket science in its own right - just don't use Sun's
front door. Finally, after following these instructions and some
additional cramps, 1.5 is installed:

exocat at aurora:~/virgil-03/compiler$ make
javac -source 1.5 -d bin `find src/vpc src/cck -name '*.java'`
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

That seems to work. Changing the CLASSPATH line in ~/.bashrc:

export CLASSPATH="/home/exocat/virgil-03/compiler/bin:$CLASSPATH"

Now using the command from the docs:

exocat at aurora:~/virgil-03/compiler$ java vpc.Compiler
Virgil Prototype Compiler [Release B-03]
Copyright (c) 2004-2007, Regents of the University of California
All rights reserved.

Usage: vpc [options] <files>
Usage: vpc -help [category]

Unexpected exception: class java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: vpc.sched.AutoScheduler
   at java.lang.Class.initializeClass(libgcj.so.7)
   at java.lang.Class.isAssignableFrom(libgcj.so.7)
   at vpc.Help.addSubCategories(Help.java:260)
   at vpc.Help.buildCategories(Help.java:117)
   at vpc.Help.printHelp(Help.java:73)
   at vpc.Compiler.main(Compiler.java:105)
Caused by: java.lang.ClassNotFoundException: java.util.Queue not found
gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/exocat/virgil-03/compiler/bin/,file:/home/exocat/virgil-03/compiler/src/,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7)
   at java.lang.ClassLoader.loadClass(libgcj.so.7)
   at java.lang.ClassLoader.loadClass(libgcj.so.7)
   at java.lang.Class.forName(libgcj.so.7)
   at java.lang.Class.initializeClass(libgcj.so.7)
   ...5 more

When will this end? Will it??

I do intend to be sarcastic or otherwise negative here, and a lot of the
quirks described above have nothing to d with Virgil itself. I'm also
not going to question the choice for writing Virgil in Java, of all
languages. I write software myself from time to time, mostly in the for
of shell scripts, and I've more than once experienced the "pleasure" of
being told that "you MUST use XML!!" and stuff like that. I just don't
get the impression that the writers of Virgil realize what they're
expecting from their users. From the docs it all seems pretty obvious,
in reality it definitely isn't.

>From what I've seen, I believe that Virgil is an excellent programming
language with great internal features that I haven't even heard of. But
setting it up is another story. What lacks in the first place is a
comprehensive guide to installing Virgil onto various platforms. I'd be
happy to add my part and share my experiences, as I'm already doing
right now.

I really need something that can bridge the AVR-libc/BASCOM gap, and it
does look like I've found something that does. I just don't see myself
"selling" Virgil to my Windows-oriented peers, at least not this way
(and from what I've seen about how gcc is run on Windows, I fear the
worst..). On the other hand, some of these kiddos will soon be learning
languages like C++ and (yes!) Java, some already have, and Virgil
obviously does comply better with these languages than QBASIC-based
BASCOM does. From a language point of view, it just seems the obvious

Any suggestions on how to make an anything-to-Virgil transition happen
more smoothly? As said, I'm willing to put my share of energy into
writing documentation, install scripts, installation packages (not my
favorite pastime, but nonetheless..), whatever. And, of course: why am I
still getting errors?

Looking forward to making Virgil installation and usage a bit more


"Fix bugs first, add features later"

More information about the Virgil mailing list