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

More stringent check for installed JDK #151

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
sed -i "s|/home/theuser/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|g" $SIGMA_HOME/KBs/config.xml
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_HOME/KBs/config.xml

- name: Set up JDK 11 for x64
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'

- name: Build with Ant
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.MacOS
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ these variables created before the next step, and replace

Next, execute step-by-step the commands below (tested on MacOS 10.14.5 to Sonoma 14.5):

You will need at least Java 11+ (avoid JDK 17) to compile SigmaKEE and to run
You will need at least Java 21+ (avoid JDK 17) to compile SigmaKEE and to run
Apache Tomcat.

! For ARM processors download it from here: https://jdk.java.net/archive/
Expand All @@ -66,7 +66,7 @@ Apache Tomcat.
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH

Install (ensure the above preparation have been performed)
Install (ensure the above preparations have been performed)
> ant install

*** Legacy install steps now taken care of by the above command "ant install"
Expand Down
62 changes: 45 additions & 17 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<property name="tomcat.version" value="9.0.97"/>

<!-- Define the sigma user spaces -->
<property name="workspace.dir" value="${git.home}/workspace"/>
<property name="workspace.dir" value="${user.home}/workspace"/>
<property name="programs.dir" value="${user.home}/Programs"/>

<condition property="isUnixNotMac">
Expand All @@ -140,10 +140,19 @@
</path>

<target name="init" depends="init-ivy">
<available property="jdk11+" classname="java.net.http.HttpClient"/>
<fail message="Unsupported JDK version: ${ant.java.version}. Please use JDK version 11 or greater, but avoid JDK 17."
unless="jdk11+">
<condition property="jdk21+">
<javaversion atleast="21"/>
</condition>
<fail message="Unsupported JDK version: ${ant.java.version}. Please use a Java Development Kit (JDK) version 21 or greater."
unless="jdk21+">
</fail>
<condition property="nojdk">
<contains string="${java.home}" substring="jdk"/>
</condition>
<fail message="Please install a Java Development Kit (JDK) version 21 or greater."
unless="nojdk">
</fail>

<echo message="Welcome to the ${product.Name} v${product.Version}"/>
<echo message="Specification Vendor: ${spec.vendor}"/>
<echo message=""/>
Expand All @@ -156,6 +165,7 @@
<echo message="classpath: ${env.SIGMA_CP}"/>
<echo message="Java Version via Ant: ${ant.java.version}"/>
<echo message="Java Version System Prop: ${java.version}"/>
<echo message="JDK HOME: is set to: ${java.home}"/>

<tstamp>
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
Expand Down Expand Up @@ -358,7 +368,12 @@
<!-- At this point we will assume you have already complied with the
README.md under the heading "System preparation on Linux." This task
will take over from the heading "Linux Installation." -->
<target name="install" depends="init" description="Installs WordNetMappings and SUMO to ${sigma.home}/KBs">
<target name="install" depends="init" description="Appends .*hrc files, clones Sigma tools, installs WordNetMappings and SUMO to ${sigma.home}/KBs and builds the E and Vampire Theorem provers">

<!-- Configure ~/.bashrc ~/.zshrc for SigmaKEE -->
<antcall target="append.bashrc"/>
<antcall target="append.zshrc"/>

<mkdir dir="${workspace.dir}"/>
<mkdir dir="${programs.dir}"/>

Expand All @@ -369,7 +384,7 @@
<antcall target="retrieve.wordnet"/>

<!-- Retrieve E prover -->
<antcall tareget="retrieve.E"/>
<antcall target="retrieve.E"/>

<!-- Clone the sigma tools -->
<antcall target="clone.sumo"/>
Expand All @@ -387,10 +402,6 @@
<antcall target="clone.z3"/>
<antcall target="build.z3"/>
<antcall target="build.vampire"/>

<!-- Configure ~/.bashrc ~/.zshrc -->
<antcall target="append.bashrc"/>
<antcall target="append.zshrc"/>
</target>

<target name="retrieve.wordnet">
Expand Down Expand Up @@ -421,7 +432,8 @@
</target>

<target name="clone.sumo">
<git command="clone">
<mkdir dir="${workspace.dir}/sumo"/>
<git command="clone" dir="${workspace.dir}/sumo">
<args>
<arg value="--progress"/>
<arg value="--verbose"/>
Expand All @@ -431,7 +443,8 @@
</git>
</target>
<target name="clone.tptpantlr">
<git command="clone">
<mkdir dir="${workspace.dir}/TPTP-ANTLR"/>
<git command="clone" dir="${workspace.dir}/TPTP-ANTLR">
<args>
<arg value="--progress"/>
<arg value="--verbose"/>
Expand All @@ -441,7 +454,8 @@
</git>
</target>
<target name="clone.sigmautils">
<git command="clone">
<mkdir dir="${workspace.dir}/SigmaUtils"/>
<git command="clone" dir="${workspace.dir}/SigmaUtils">
<args>
<arg value="--progress"/>
<arg value="--verbose"/>
Expand Down Expand Up @@ -469,6 +483,14 @@
</args>
</git>
</target>
<target name="update.sigmakee">
<git command="pull" dir="${user.dir}">
<args>
<arg value="--progress"/>
<arg value="--verbose"/>
</args>
</git>
</target>

<!-- git macro utils setup from: https://tonyyan.wordpress.com/2017/03/10/integrate-git-into-ant-targets/-->
<macrodef name="git">
Expand Down Expand Up @@ -528,30 +550,36 @@
</exec>
</target>

<!-- If Vampire fails to build on Hamming, here is a alternate source of the binary -->
<target name="alternate.vampire">
<get src="https://github.com/vprover/vampire/releases/download/v4.9casc2024/vampire" dest="${programs.dir}/vampire/build" tryGzipEncoding="true"/>
<chmod dir="${programs.dir}/${programs.dir}/vampire/build" perm="ugo+rx" includes="vampire"/>
</target>

<target name="append.bashrc" if="isUnixNotMac">
<echo file="${user.home}/.bashrc" append="true">

# For SIGMA
export SIGMA_HOME=${user.home}/.${app.name}
export ONTOLOGYPORTAL_GIT=${workspace.dir}
export SIGMA_SRC=$ONTOLOGYPORTAL_GIT/${app.name}
export CATALINA_OPTS="$CATALINA_OPTS ${run.jvmargs}"
export CATALINA_HOME=${programs.dir}/apache-tomcat-${tomcat.version}
export PATH=$CATALINA_HOME/bin:$PATH
export SIGMA_CP=$SIGMA_SRC/build/${app.name}.jar:$SIGMA_SRC/lib/*</echo>
export SIGMA_CP=$SIGMA_SRC/build/${app.name}.jar:$SIGMA_SRC/lib/*
</echo>
</target>

<target name="append.zshrc" unless="isUnixNotMac">
<echo file="${user.home}/.zshrc" append="true">

# For SIGMA
export SIGMA_HOME=${user.home}/.${app.name}
export ONTOLOGYPORTAL_GIT=${workspace.dir}
export SIGMA_SRC=$ONTOLOGYPORTAL_GIT/${app.name}
export CATALINA_OPTS="$CATALINA_OPTS ${run.jvmargs}"
export CATALINA_HOME=${programs.dir}/apache-tomcat-${tomcat.version}
export PATH=$CATALINA_HOME/bin:$PATH
export SIGMA_CP=$SIGMA_SRC/build/${app.name}.jar:$SIGMA_SRC/lib/*</echo>
export SIGMA_CP=$SIGMA_SRC/build/${app.name}.jar:$SIGMA_SRC/lib/*
</echo>
</target>

<target name="api_doc" depends="init" description="Build the JavaDocs and place in ${dist.javadoc.dir}.">
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<preference name="sumokbname" value="SUMO" />
<preference name="systemsDir" value="/home/theuser" />
<preference name="termFormats" value="no" />
<preference name="testOutputDir" value="/var/tomcat/apache-tomcat-9.0.96/webapps/sigma/tests" />
<preference name="testOutputDir" value="/var/tomcat/apache-tomcat-9.0.97/webapps/sigma/tests" />
<preference name="TPTPDisplay" value="no" />
<preference name="tptpHomeDir" value="/home/theuser" />
<preference name="TPTP" value="yes" />
Expand Down
4 changes: 2 additions & 2 deletions docker/sigma-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tomcat:9.0.96-jdk11-temurin-jammy AS builder
FROM tomcat:9.0.97-jdk21-temurin-jammy AS builder

# Followed instructions from: https://github.com/vprover/vampire/wiki/Source-Build-for-Users
# for buildling latest vampire w/ latest Z3
Expand Down Expand Up @@ -33,7 +33,7 @@ RUN apt update; \

#################################################
# runtime image.
FROM tomcat:9.0.96-jdk11-temurin-jammy AS runtime
FROM tomcat:9.0.97-jdk21-temurin-jammy AS runtime

COPY --from=builder \
/usr/local/tomcat/E/PROVER/e_ltb_runner /usr/local/bin/e_ltb_runner
Expand Down
2 changes: 1 addition & 1 deletion docker/sigmakee/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#################################################
# runtime image.
FROM tomcat:9.0.96-jdk11-temurin-jammy AS runtime
FROM tomcat:9.0.97-jdk21-temurin-jammy AS runtime

RUN apt update; \
apt-get install -y --no-install-recommends \
Expand All @@ -25,4 +25,4 @@
COPY ./sigma.war $CATALINA_HOME/webapps/sigma.war

ENV SIGMA_HOME=/root/sigmakee-runtime
ENV CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m"

Check warning on line 28 in docker/sigmakee/Dockerfile

View workflow job for this annotation

GitHub Actions / build-sumo-ci

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CATALINA_OPTS' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
2 changes: 1 addition & 1 deletion docker/sigmakee2023/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN cd /root \
&& echo "export SIGMA_SRC=/root/workspace/sigmakee" >> .bashrc \
&& echo "export ONTOLOGYPORTAL_GIT=/root/workspace" >> .bashrc \
&& echo 'export CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m"' >> .bashrc \
&& echo "export CATALINA_HOME=/root/Programs/apache-tomcat-9.0.96" >> .bashrc \
&& echo "export CATALINA_HOME=/root/Programs/apache-tomcat-9.0.97" >> .bashrc \
&& source .bashrc

# Setup Vampire
Expand Down
2 changes: 1 addition & 1 deletion docker/sumo-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM $IMAGE_ACCOUNT/sigma-ci:latest AS builder

#################################################
# runtime image.
FROM tomcat:9.0.96-jdk11-temurin-jammy AS runtime
FROM tomcat:9.0.97-jdk21-temurin-jammy AS runtime

RUN apt update; \
apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ auxiliary.show.customizer.message=<message>
</ide-actions>
<export>
<type>folder</type>
<location>build/test/classes</location>
<location>build/WEB-INF/classes</location>
<script>${ant.script}</script>
<build-target>dist</build-target>
</export>
Expand Down
Loading
Loading