qbicc

Project Url: qbicc/qbicc
Introduction: Experimental static compiler for Java programs.
More: Author   ReportBugs   OfficialWebsite   
Tags:

= qbicc

This is the README for qbicc. There's not much here yet but be sure to read link:Overview.adoc[the overview].

Our https://qbicc.zulipchat.com[`Zulip`] chat is a great place to ask questions and get started.

== Building

To build the project, execute mvn install in the root.

The first time you build qbicc, the tests will fail as the class library isn't built yet. Use mvn install -DskipTests the first time to build so that the class library can be built.

== Class Library

QBICC cannot run without https://github.com/qbicc/qbicc-class-library[`qbicc-class-library`].

After you have built qbicc, fetch and install the class libraries as follows:

git clone --recurse-submodules git@github.com:qbicc/qbicc-class-library.git cd qbicc-class-library

mvn install

== Rebuild qbicc

After building the class library, rebuild qbicc with the tests enabled using mvn clean install to get qbicc is ready for further development and use.

== Running

To run the driver, first build the project and then use https://jbang.dev[`jbang`] to run it:

[source,shell]

jbang --quiet org.qbicc:qbicc-main:0.2.0-SNAPSHOT --boot-path-append-file /path/to/main.jar --output-path /tmp/output hello/world/Main

For a step-by-step example, see examples/helloworld/hello/world/Main.java

== JBang cache

When plugins are added or removed, the jbang cache may become inconsistent and result in build errors. If that happens, add the --fresh option to the above command line. Eg: jbang --fresh ... Alternatively, clear the entire cache using:

[source,shell]

jbang cache clear

== Requirements

Please ensure the follow are installed and available on your path:

  • LLVM 12
  • JDK 11
  • Maven 3.6.1+

=== MacOS

To prevent Java versioning errors it is best to install Maven manually rather than with homebrew (see https://maven.apache.org/install.html). The homebrew Maven install has a dependency on Java 16 which may cause Maven to use the wrong version of Java when building qbicc.

The libgcc_s.dylib is also required to be available and must be present (or symlinked) to /usr/local/lib/libgcc_s.dylib.

One way to get this library, if it's not already on your system, is to brew install gcc and symlink the file.

For Catalina, it may already be present and the following symlink will resolve the compile failures

[source,shell]

ln -s /usr/lib/libgcc_s.1.dylib /usr/local/lib/libgcc_s.dylib

For BigSur, the brew install gcc path is likely necessary and following symlink resolves the issue

[source,shell]

ln -s /usr/local/Cellar/gcc/11.1.0/lib/gcc/11/libgcc_s.1.dylib /usr/local/lib/libgcc_s.dylib

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools