Skip to content

Commit

Permalink
Do not use the Intel inflater or deflater on OS X 10.14 (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 authored Oct 7, 2019
1 parent 4f11a43 commit 8f9d01a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/com/fulcrumgenomics/cmdline/FgBioMain.scala
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ private[cmdline] object SystemUtils {
private val OsName: Option[String] = getSystemProperty("os.name")
/** The current OS architecture */
private val OsArch: Option[String] = getSystemProperty("os.arch")
/** The current OS version */
private val OsVersion: Option[String] = getSystemProperty("os.version")

/** Gets a system property. Returns None if not found or not allowed to look at. */
private def getSystemProperty(property: String): Option[String] = {
@@ -66,11 +68,14 @@ private[cmdline] object SystemUtils {
private val IsOsMac: Boolean = MacNamePrefixes.exists(prefix => OsName.exists(_.startsWith(prefix)))
/** Returns true if the architecture is the given name, false otherwise. */
private def IsOsArch(name: String): Boolean = OsArch.contains(name)
/** Returns true if the operating system version starts with the given version string, false otherwise. */
private def IsOsVersion(prefix: String): Boolean = OsVersion.exists(_.startsWith(prefix))

/** True if the current system supports the Intel Inflater and Deflater, false otherwise. */
val IntelCompressionLibrarySupported: Boolean = {
if (!SystemUtils.IsOsLinux && !SystemUtils.IsOsMac) false
else if (SystemUtils.IsOsArch("ppc64le")) false
else if (SystemUtils.IsOsMac && SystemUtils.IsOsVersion("10.14.")) false // FIXME: https://github.com/Intel-HLS/GKL/issues/101
else true
}
}

0 comments on commit 8f9d01a

Please sign in to comment.