Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor project to build its own OpenSHA jar file after upstream refactoring #3

Merged
merged 26 commits into from
Oct 19, 2023

Conversation

kevinmilner
Copy link
Contributor

This is a fix for #2, and removes the OpenSHA jar file. It will instead try to checkout the OpenSHA git repository, and will also check for updates whenever you run the code. It will fallback to downloading a nightly build.

NOTE: this branch requires java 11, in line with the new OpenSHA project

@kevinmilner
Copy link
Contributor Author

@wsavran would you be willing to give this a test run? You'll need a java 11 jdk or newer.

To try it out, check out the 2021_05-build-jar-refactor branch. You should be able to do this with your existing version by just doing a:

git fetch
git checkout 2021_05-build-jar-refactor

Then if you run any U3ETAS commands it should prompt you to check out and build the project. The easiest is to run this script: u3etas_env_test.sh

@wsavran
Copy link

wsavran commented May 17, 2021

just ran the tests and it runs successfully! here is the output from the build.

u3etas_env_test.sh
Testing environmental variables...
	You have set ETAS_MEM_GB to 10 gigabytes
	You have set ETAS_THREADS to 2 threads
	You have set the ETAS_LAUNCHER path to /Users/wsavran/Code/ucerf3-etas-launcher
	/Users/wsavran/Code/ucerf3-etas-launcher exists!

Looking for java in PATH
	found java: /usr/bin/java
	checking java version wtih 'java -version', ensure that the version is Java 8 (1.8) or above (will print below)
java version "11.0.10" 2021-01-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.10+8-LTS-162)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.10+8-LTS-162, mixed mode)

Testing running java, the following output should be multiple lines ending with 'ETAS_EnvTest DONE'
Using global ETAS_MEM_GB=10
Checking for updates to OpenSHA. You can disable these checks by setting the environmental variable ETAS_DISABLE_JAR_UPDATE=1
We need to download/build OpenSHA. The preferred method is to checkout the OpenSHA project from GitHub and build it. Checking if we have java compilers available (must have version 11 or greater):
javac 11.0.10
Checking if we have git installed:
git version 2.20.1
javac and git are available and building is preferred for smart update checking, but you can optionally download (and routinely re-download) nightly builds instead.
     Would you like to use nightly builds instead? [y/N]
Need to check out OpenSHA from GitHub (this may take a little while and only needs to happen once)
Cloning into 'opensha'...
remote: Enumerating objects: 16011, done.
remote: Counting objects: 100% (79/79), done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 16011 (delta 24), reused 60 (delta 11), pack-reused 15932
Receiving objects: 100% (16011/16011), 165.19 MiB | 7.30 MiB/s, done.
Resolving deltas: 100% (6807/6807), done.
Checking out files: 100% (4737/4737), done.
Building OpenSHA jar with Gradle in /Users/wsavran/Code/ucerf3-etas-launcher/opensha/git/opensha
Downloading https://services.gradle.org/distributions/gradle-7.0.1-bin.zip
..........................................................................................................

Welcome to Gradle 7.0.1!

Here are the highlights of this release:
 - File system watching enabled by default
 - Support for running with and building Java 16 projects
 - Native support for Apple Silicon processors
 - Dependency catalog feature preview

For more details see https://docs.gradle.org/7.0.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL in 4m 41s
3 actionable tasks: 3 executed
Running ETAS_EnvTest java class
	Maximum available memory to java (after overhead): 10240 MB
	$ETAS_LAUNCHER defined? true, Value: /Users/wsavran/Code/ucerf3-etas-launcher
ETAS_EnvTest DONE

@kevinmilner
Copy link
Contributor Author

Great, thanks @wsavran! I'll merge it in shortly, just have to get Java 11 tested and working on all of the machines first

@kevinmilner kevinmilner merged commit 6137dca into master Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants