TornadoVM provides two main approaches for building and running applications:
This is the traditional approach using the make build system and the tornado wrapper script.
maketornado --jvm="-Dtornado.option=value" -cp <classpath> <MainClass> [args]Example:
tornado --jvm="-Dtornado.debug=true" -cp target/examples.jar examples.MatrixMultiplication- Standard development workflow
- When you want simplified command-line interface
- When working with pre-configured TornadoVM installations
makebuilds the entire TornadoVM SDK inbin/sdk/- The
tornadocommand is a wrapper script that:- Sets up the Java module path
- Configures all required JVM flags and exports
- Adds TornadoVM modules and native libraries
- Launches the application with proper configuration
This is a Maven-friendly approach that uses an argument file for JVM configuration.
./mvnw clean install -DskipTestsjava @tornado-argfile -cp <classpath> <MainClass> [args]Example:
java @tornado-argfile \
-cp tornado-examples/target/tornado-examples-1.1.2-SNAPSHOT.jar \
uk.ac.manchester.tornado.examples.compute.MatrixMultiplication- Maven-based projects and workflows
- IDE integration (IntelliJ, Eclipse, VS Code)
- CI/CD pipelines
- When you need explicit control over JVM arguments
- When debugging with IDEs
./mvnw clean installbuilds all TornadoVM modules using Maven- The
tornado-argfilecontains all necessary JVM flags:- JVM mode and memory settings (
-XX:+EnableJVMCI, etc.) - Native library paths (
-Djava.library.path=...) - Module system configuration (
--module-path,--add-modules, etc.) - Required exports and opens for Graal compiler access
- JVM mode and memory settings (
- The
@tornado-argfilesyntax tells Java to read arguments from the file
The tornado-argfile is located at the root of the TornadoVM repository. You can examine it to see all JVM configuration:
cat tornado-argfile| Aspect | Make + Tornado Command | Maven + Java @argfile |
|---|---|---|
| Build Tool | Make | Maven |
| Run Command | tornado wrapper |
java @tornado-argfile |
| IDE Integration | Limited | Excellent |
| Flexibility | Simplified | Full control |
| CI/CD | Traditional scripts | Maven-native |
| JVM Config | Hidden in wrapper | Explicit in argfile |
Located at the repository root, this file contains:
- JVM server mode and experimental VM options
- JVMCI enablement for Graal compiler
- Native library paths for TornadoVM
- Tornado runtime class implementations
- Module path and upgrade paths
- Extensive
--add-exportsand--add-opensdeclarations for Graal compiler internals
Maven configuration file that applies to all Maven builds (both ./mvnw and bin/compile):
- Parallel builds:
-T1.5C(1.5 threads per CPU core) - Colored output:
-Dstyle.color=alwaysfor better readability - Default profiles: JDK 21 + OpenCL backend (can be overridden)
- Skip Javadoc:
-Dmaven.javadoc.skip=truefor faster builds - Fail fast:
-Dfailfast=truefor quicker feedback during development - Timestamps: Shows build timestamps for performance tracking
These settings are automatically applied. To override:
# Single-threaded build
./mvnw -T1 install
# Generate Javadocs
./mvnw install -Dmaven.javadoc.skip=falseBoth approaches load these core TornadoVM modules:
tornado.runtime- Core runtime implementationtornado.annotation- Annotation processingtornado.drivers.common- Common driver infrastructuretornado.drivers.opencl- OpenCL backend (additional drivers may be added)
Standard workflow (same as master branch):
make # Full clean build every time
bin/compile --jdk jdk21 --backend openclOption 1:
tornado --jvm="-Xmx8g -Dtornado.debug=true" -cp app.jar MainOption 2:
java @tornado-argfile -Xmx8g -Dtornado.debug=true -cp app.jar MainOption 1:
tornado --devicesOption 2:
java @tornado-argfile -cp bin/sdk/share/java/tornado/tornado-drivers-opencl-1.1.2-SNAPSHOT.jar \
uk.ac.manchester.tornado.drivers.opencl.OCLDeviceQueryFor IntelliJ IDEA, Eclipse, or VS Code, use Option 2:
- Import as Maven project
- Configure run configuration with VM options:
@tornado-argfile - Set classpath to include your application jar
- Run directly from the IDE
- Ensure
tornado-argfilepaths are correct for your installation - Check that
--module-pathpoints to the built SDK location
- Verify
-Djava.library.pathintornado-argfilepoints to correct location - Ensure native libraries were built successfully
- The
tornado-argfilecontains all necessary--add-exports - If custom modules are added, you may need to extend the argfile
For more information, see the TornadoVM Documentation.