Skip to content

Commit

Permalink
Major update to FFX uses of Groovy to accomodate JDKs 8, 9 and 10. We…
Browse files Browse the repository at this point in the history
… now depend on the 2.5.0 release version of Groovy, and the PicoCLI version of CLIBuilder
  • Loading branch information
mjschnie committed Jun 8, 2018
1 parent 77c16ff commit 223d469
Show file tree
Hide file tree
Showing 85 changed files with 214 additions and 502 deletions.
14 changes: 6 additions & 8 deletions bin/ffx
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,27 @@ fi
# Detect JVM version; disallow 1.7 or below, warn for JDK 9+ that experimental flags are in use.
if [ $hasAwkSed ]; then
JVERS="`java -version 2>&1 | awk '/version/ {print $3;}' | sed 's/\"//g'`"
JVFIRST="`echo "$JVERS" | awk 'BEGIN { FS = "."; } { print $1 }'`"
JVFIRST="`echo "$JVERS" | awk 'BEGIN { FS = "[.-]"; } { print $1 }'`"
JVSEC="`echo "$JVERS" | awk 'BEGIN { FS = "."; } { print $2 }'`"

USE_EXPTL_FLAGS=''
if [ $JVFIRST -gt 9 ]; then
echo " FFX does not currently support Java 10+ (JDK 1.8 is preferred) - detected ${JVERS}" 1>&2
if [ $JVFIRST -gt 10 ]; then
echo " Illegal Java version detected (${JVERS}). Please use JRE 1.8, JDK 9 or JDK 10." 1>&2
exit 1
elif [ $JVFIRST -eq 9 ]; then
USE_EXPTL_FLAGS='1'
elif [ $JVSEC -eq 9 ]; then
elif [ $JVFIRST -eq 10 ]; then
USE_EXPTL_FLAGS='1'
elif [ $JVSEC -lt 8 ]; then
echo " Illegal Java version detected. Must use JDK 1.8 or JDK 9, found ${JVERS}" 1>&2
echo " Illegal Java version detected (${JVERS}). Please use JRE 1.8, JDK 9 or JDK 10." 1>&2
exit 1
fi

if [ $USE_EXPTL_FLAGS ]; then
echo " WARNING: JDK 9 detected: support is experimental." 1>&2
echo '' 1>&2
EXTRA_JVM_ARGUMENTS="${EXTRA_JVM_ARGUMENTS} --illegal-access=permit --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-exports=java.base/java.lang=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED"
fi
else
echo " The JRE version could not be autodetected. JRE 1.8 is preferred, and JRE 9 is experimental."
echo " The JRE version could not be autodetected. Please use JRE 1.8, JDK 9 or JDK 10."
fi

# For Cygwin, switch paths to Windows format before running java
Expand Down
16 changes: 7 additions & 9 deletions bin/ffxc
Original file line number Diff line number Diff line change
Expand Up @@ -113,29 +113,27 @@ fi
# Detect JVM version; disallow 1.7 or below, warn for JDK 9+ that experimental flags are in use.
if [ $hasAwkSed ]; then
JVERS="`java -version 2>&1 | awk '/version/ {print $3;}' | sed 's/\"//g'`"
JVFIRST="`echo "$JVERS" | awk 'BEGIN { FS = "."; } { print $1 }'`"
JVFIRST="`echo "$JVERS" | awk 'BEGIN { FS = "[.-]"; } { print $1 }'`"
JVSEC="`echo "$JVERS" | awk 'BEGIN { FS = "."; } { print $2 }'`"

USE_EXPTL_FLAGS=''
if [ $JVFIRST -gt 9 ]; then
echo " FFX does not currently support Java 10+ (JDK 1.8 is preferred) - detected ${JVERS}" 1>&2
exit 1
if [ $JVFIRST -gt 10 ]; then
echo " Illegal Java version detected (${JVERS}). Please use JRE 1.8, JDK 9 or JDK 10." 1>&2
# exit 1
elif [ $JVFIRST -eq 9 ]; then
USE_EXPTL_FLAGS='1'
elif [ $JVSEC -eq 9 ]; then
elif [ $JVFIRST -eq 10 ]; then
USE_EXPTL_FLAGS='1'
elif [ $JVSEC -lt 8 ]; then
echo " Illegal Java version detected. Must use JDK 1.8 or JDK 9, found ${JVERS}" 1>&2
echo " Illegal Java version detected (${JVERS}). Please use JRE 1.8, JDK 9 or JDK 10." 1>&2
exit 1
fi

if [ $USE_EXPTL_FLAGS ]; then
echo " WARNING: JDK 9 detected: support is experimental." 1>&2
echo '' 1>&2
EXTRA_JVM_ARGUMENTS="${EXTRA_JVM_ARGUMENTS} --illegal-access=permit --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-exports=java.base/java.lang=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED"
fi
else
echo " The JRE version could not be autodetected. JRE 1.8 is preferred, and JRE 9 is experimental."
echo " The JRE version could not be autodetected. Please use JRE 1.8, JDK 9 or JDK 10."
fi

# For Cygwin, switch paths to Windows format before running java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.algorithms.integrators.IntegratorEnum
import ffx.algorithms.thermostats.ThermostatEnum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.potential.MolecularAssembly
import ffx.potential.bonded.Polymer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import static org.apache.commons.math3.util.FastMath.abs

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.potential.ForceFieldEnergy
import ffx.potential.MolecularAssembly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import edu.rit.pj.Comm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.algorithms.integrators.Integrator
import ffx.algorithms.integrators.IntegratorEnum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.potential.ForceFieldEnergy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import edu.rit.pj.Comm

Expand All @@ -14,7 +15,6 @@ import ffx.potential.bonded.Residue.ResidueType
import ffx.potential.bonded.ResidueEnumerations.CommonAminoAcid3
import ffx.potential.bonded.Rotamer
import ffx.potential.bonded.RotamerLibrary
import static ffx.potential.extended.ExtUtils.prop

/**
* The ManyBody script performs a discrete optimization using a many-body expansion and elimination expressions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.numerics.Potential
import ffx.numerics.PowerSwitch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

package ffx.potentials
package ffx.algorithms

import org.apache.commons.configuration.CompositeConfiguration

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.algorithms.RotamerOptimization
import ffx.potential.ForceFieldEnergy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ffx.algorithms

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder;

/**
* Run a Parallel Java Job Scheduler on a cluster with multiple nodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import ffx.potential.DualTopologyEnergy
import ffx.potential.ForceFieldEnergy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.apache.commons.io.FilenameUtils

import groovy.cli.Option
import groovy.cli.Unparsed
import groovy.cli.picocli.CliBuilder

import edu.rit.pj.Comm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import org.apache.commons.io.FilenameUtils
import org.biojava.bio.structure.Structure
import org.biojava.bio.structure.io.PDBFileReader

import groovy.cli.picocli.CliBuilder

import ffx.algorithms.AlgorithmFunctions
import ffx.algorithms.AlgorithmUtils
import ffx.potential.MolecularAssembly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

package ffx.algorithms

import groovy.cli.picocli.CliBuilder

import ffx.potential.parsers.CoordinateFileFilter
import ffx.potential.parsers.PDBFileFilter
import static ffx.algorithms.ClusterStructures.ClustAlg.AV_LINK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import org.apache.commons.io.FilenameUtils
import org.apache.commons.math3.geometry.euclidean.threed.Rotation

import groovy.cli.picocli.CliBuilder

import ffx.algorithms.Minimize
import ffx.crystal.Crystal
import ffx.potential.ForceFieldEnergy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
* exception statement from your version.
*/


import org.apache.commons.io.FilenameUtils

import groovy.cli.picocli.CliBuilder

import ffx.algorithms.GenerateRotamers
import ffx.potential.bonded.Polymer
import ffx.potential.bonded.Residue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

import org.apache.commons.io.FilenameUtils

import groovy.cli.picocli.CliBuilder

import edu.rit.mp.DoubleBuf
import edu.rit.mp.IntegerBuf
import edu.rit.pj.Comm
Expand Down
62 changes: 0 additions & 62 deletions modules/algorithms/src/main/groovy/ffx/algorithms/mbMiner.groovy

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
* exception statement from your version.
*/

import groovy.cli.picocli.CliBuilder

import ffx.algorithms.MMgksa
import ffx.potential.MolecularAssembly
import ffx.potential.bonded.Atom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

import org.apache.commons.io.FilenameUtils

import groovy.cli.picocli.CliBuilder

import edu.rit.pj.Comm

import ffx.algorithms.mc.CoordShakeMove
Expand Down
Loading

0 comments on commit 223d469

Please sign in to comment.