aboutsummaryrefslogtreecommitdiff
path: root/prepare_SamuelYvon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prepare_SamuelYvon.sh')
-rwxr-xr-xprepare_SamuelYvon.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/prepare_SamuelYvon.sh b/prepare_SamuelYvon.sh
index f83a3ff..11fe5e8 100755
--- a/prepare_SamuelYvon.sh
+++ b/prepare_SamuelYvon.sh
@@ -15,5 +15,22 @@
# limitations under the License.
#
+# THIS IS A DIRECT COPY OF royvanrijn's PREPARE SCRIPT; I AM NOT FAMILIAR WITH AOT STUFF ON JAVA.
+# THANKS royvanrijn!!
+
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk use java 21.0.1-graal 1>&2
+
+# ./mvnw clean verify removes target/ and will re-trigger native image creation.
+if [ ! -f target/CalculateAverage_SamuelYvon_image ]; then
+
+ JAVA_OPTS="--enable-preview -dsa"
+
+ # No vector API because it does not link :(
+# JAVA_OPTS="--enable-preview -dsa --add-modules jdk.incubator.vector"
+
+# Enable the GC because I need memory :D
+ NATIVE_IMAGE_OPTS="--gc=G1 -O3 -march=native --strict-image-heap $JAVA_OPTS"
+
+ native-image $NATIVE_IMAGE_OPTS -cp target/average-1.0.0-SNAPSHOT.jar -o target/CalculateAverage_SamuelYvon_image dev.morling.onebrc.CalculateAverage_SamuelYvon
+fi