Lightweight Java OMP-like preprocessor written in Scala and Java.
The input of the preprocessor are valid Java source files with proper directives (i.e.
// omp ... comments).
One can use
omp4j either as blackbox compiler (i.e. a preprocessor using
javac) or as pure preprocessor.
In latter case the output is valid paralellized Java source files.
The described method is for UNIX-like systems. While Microsoft Windows are supported, the users are expected to figure the installation steps by themselves.
Only JDK is required in case only the preprocessor is used. This is a common use-case.
The following JDKs are supported and tested.
omp4j-*.jar from the releases page.
java -jar omp4j-*.jar <args>
<args> represent the desired program arguments as described in tutorial
We advise the users to create an
omp4j alias which represents
java -jar omp4j-*.jar.
By this trick, the previous preprocessor call might be replaced with
In case of development, a slightly different environment and installation steps are recommended.
The developer is expected to work with an UNIX-like up-to-date operating system. The officially supported operating systems are ArchLinux and Ubuntu 16.04 LTS.
The following software must be installed in order to fetch, compile and test
- supported JDK (see above)
The version of Scala used for running
sbt is irrelevant as long as
sbt can be launched in the specified version above.
sbt employs Scala
Forking the project is strongly recommended since pushing directly to the official repository is forbidden. However, we provide the URL for this repository. The URL should be modified accordingly.
$ git clone firstname.lastname@example.org:omp4j/omp4j.git --recursive $ cd omp4j
Once the source code is fetched, it might be easily compiled via
$ sbt compile
When the code is compiled, the unit tests should be run.
$ sbt test
In development mode,
omp4j might be invoked
$ sbt run <args>
This option is not suggested and it should be employed only for the development purposes since it perform significantly more poorly and the runtime library must be present in the classpath.
For this reason, we encourage the user to assembly the preprocessor and use the final
See Using omp4j above.
The preprocessor should be distributed as a dependency-less
For this purpose,
sbt is provided with the
$ sbt assembly
This command creates
.jar package in
This package is ready for deployment as has no further dependencies.
See Using omp4j above.
sbt might be used to generate the API reference.
$ sbt doc
This command creates directory
target/scala-<version>/api/ including file
index.html. One can simply open it in web browser in order to browse API reference.
See project website for contacts and details.
Developed under BSD license, please refer to LICENCE file.