{"id":20270422,"url":"https://github.com/zcaudate/sample-jep-graal","last_synced_at":"2025-03-03T23:12:51.577Z","repository":{"id":81855727,"uuid":"283988840","full_name":"zcaudate/sample-jep-graal","owner":"zcaudate","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-31T09:15:55.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T05:42:31.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zcaudate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T08:54:20.000Z","updated_at":"2020-11-16T05:07:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e203a46-bbcd-4e0e-9750-763c18a18a2a","html_url":"https://github.com/zcaudate/sample-jep-graal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaudate%2Fsample-jep-graal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaudate%2Fsample-jep-graal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaudate%2Fsample-jep-graal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaudate%2Fsample-jep-graal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcaudate","download_url":"https://codeload.github.com/zcaudate/sample-jep-graal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241753145,"owners_count":20014252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T12:30:21.192Z","updated_at":"2025-03-03T23:12:51.529Z","avatar_url":"https://github.com/zcaudate.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sample-jep-graal\n\nBasic compilation of Jep with Graal\n\n## Prerequisites\n\nMake sure that [graal](https://www.graalvm.org/) and [leiningen](https://leiningen.org/) are installed. Also make sure that the python installation is `v3+` If need be, the runtime python and pip commands can be set through ENV variables:\n\n```\nexport JEP_PIP=pip3\nexport JEP_PYTHON=python3\n\n```\n[jep](https://github.com/ninia/jep) will be installed if not found.\n\n## Building\n\nThe `prebuild.sh` command needs to be run once. It builds a jar and instruments it with `-agentlib:native-image-agent` attached.\n\n```\n$ preimage.sh\n╰─$ ./prebuild.sh                                                                                                                               \nBUILDING JAR\n                                                               \nINSTRUMENTING JAR\n                                                              \n.... \u003cOUTPUTS\u003e ....\n                  \nINSTRUMENTING COMPLETE\n\nCOPYING CONFIGS from ./log to ./native\n\nPREIMAGE SUCCESS\n\n```\n\nOnce the two files `jni-config.json` and `reflect-config.json` are generated, the native image can be built:\n\n```\n$ lein native-image\n\n╰─$ lein native-image\n[../jep.graal/target/jep-graal:92601]    classlist:   3,616.95 ms,  0.96 GB\n[../jep.graal/target/jep-graal:92601]        (cap):   1,569.69 ms,  0.96 GB\n[../jep.graal/target/jep-graal:92601]        setup:   3,552.43 ms,  0.96 GB\n\n\u003cETC\u003e\n\n[../jep.graal/target/jep-graal:92601]        write:     697.21 ms,  2.61 GB\n[../jep.graal/target/jep-graal:92601]      [total]:  70,857.87 ms,  2.61 GB\nCreated native image .../jep.graal/target/jep-graal\n\n```\n\nThe binary is compiled to `target/jep-graal`.\n\n\n## Running\n\nCurrently running the binary causes an error:\n\n```\n$ target/jep-graal\n\nTEST EXAMPLE: a = 1 + 1, return a\nException in thread \"main\" java.lang.UnsatisfiedLinkError: jdk.internal.loader.BootLoader.getSystemPackageNames()[Ljava/lang/String; [symbol: Java_jdk_internal_loader_BootLoader_getSystemPackageNames or Java_jdk_internal_loader_BootLoader_getSystemPackageNames__]\n        at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:145)\n        at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)\n        at jdk.internal.loader.BootLoader.getSystemPackageNames(BootLoader.java)\n        at jdk.internal.loader.BootLoader.packages(BootLoader.java:192)\n        at java.lang.ClassLoader.getPackages(ClassLoader.java:2354)\n        at java.lang.Package.getPackages(Package.java:377)\n        at jep.ClassList.loadPackages(ClassList.java:170)\n        at jep.ClassList.\u003cinit\u003e(ClassList.java:68)\n        at jep.ClassList.getInstance(ClassList.java:366)\n        at jep.Jep.setupJavaImportHook(Jep.java:320)\n        at jep.Jep.configureInterpreter(Jep.java:310)\n        at jep.SharedInterpreter.configureInterpreter(SharedInterpreter.java:64)\n        at jep.Jep.\u003cinit\u003e(Jep.java:282)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaudate%2Fsample-jep-graal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcaudate%2Fsample-jep-graal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaudate%2Fsample-jep-graal/lists"}