summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <fj5358cc@fujitsu.com>2022-03-15 16:01:15 +0900
committerGitHub <noreply@github.com>2022-03-15 00:01:15 -0700
commitaee763015e92c478112f0b583aa6abe241336d66 (patch)
tree507dede2d66fe5c4ed0656a667259f9e22d51b4e
parent50b5b314b3306c8121b82e6876a0064b2d3e42ce (diff)
downloadspack-aee763015e92c478112f0b583aa6abe241336d66.tar.gz
spack-aee763015e92c478112f0b583aa6abe241336d66.tar.bz2
spack-aee763015e92c478112f0b583aa6abe241336d66.tar.xz
spack-aee763015e92c478112f0b583aa6abe241336d66.zip
glugen: new package. (#29312)
-rw-r--r--var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch266
-rw-r--r--var/spack/repos/builtin/packages/gluegen/javalib.aarch64.patch13
-rw-r--r--var/spack/repos/builtin/packages/gluegen/package.py76
3 files changed, 355 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch b/var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch
new file mode 100644
index 0000000000..67d83fa99c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch
@@ -0,0 +1,266 @@
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/CompilerEnum.java b/src/main/java/net/sf/antcontrib/cpptasks/CompilerEnum.java
+index e7af352..7b977c8 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/CompilerEnum.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/CompilerEnum.java
+@@ -60,6 +60,10 @@ import org.apache.tools.ant.types.EnumeratedAttribute;
+ * <td>xcode.clang</td>
+ * <td>Xcode clang / llvm C compiler (via xcrun)</td>
+ * </tr>
++ * <td>fcc</td>
++ * <td>fcc / Fujitsu C compiler</td>
++ * </tr>
++ * <tr>
+ * <tr>
+ * <td>g++</td>
+ * <td>GCC C++ compiler</td>
+@@ -69,6 +73,10 @@ import org.apache.tools.ant.types.EnumeratedAttribute;
+ * <td>clang++ / llvm C++ compiler</td>
+ * </tr>
+ * <tr>
++ * <td>FCC</td>
++ * <td>FCC / Fujitsu C++ compiler</td>
++ * </tr>
++ * <tr>
+ * <td>xcode.clang++</td>
+ * <td>Xcode clang++ / llvm C++ compiler (via xcrun)</td>
+ * </tr>
+@@ -209,6 +217,8 @@ public class CompilerEnum extends EnumeratedAttribute {
+ new ProcessorEnumValue("clang++", GccCCompiler.getCPPLangInstance()),
+ new ProcessorEnumValue("xcode.clang", GccCCompiler.getXCodeCLangInstance()),
+ new ProcessorEnumValue("xcode.clang++", GccCCompiler.getXCodeCPPLangInstance()),
++ new ProcessorEnumValue("fcc", GccCCompiler.getFccInstance()),
++ new ProcessorEnumValue("FCC", GccCCompiler.getFCCPPInstance()),
+ new ProcessorEnumValue("c++", GccCCompiler.getCppInstance()),
+ new ProcessorEnumValue("g77", GccCCompiler.getG77Instance()),
+ new ProcessorEnumValue("msvc", DevStudioCCompiler.getInstance()),
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/LinkerEnum.java b/src/main/java/net/sf/antcontrib/cpptasks/LinkerEnum.java
+index 38800ae..e57de43 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/LinkerEnum.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/LinkerEnum.java
+@@ -52,6 +52,8 @@ public class LinkerEnum extends EnumeratedAttribute {
+ new ProcessorEnumValue("clang++", GppLinker.getClangInstance()),
+ new ProcessorEnumValue("xcode.clang", GccLinker.getXcodeClangInstance()),
+ new ProcessorEnumValue("xcode.clang++", GppLinker.getXcodeClangInstance()),
++ new ProcessorEnumValue("fcc", GccLinker.getFccInstance()),
++ new ProcessorEnumValue("FCC", GppLinker.getFccInstance()),
+ new ProcessorEnumValue("ld", LdLinker.getInstance()),
+ new ProcessorEnumValue("ar", GccLibrarian.getInstance()),
+ new ProcessorEnumValue("msvc", DevStudioLinker.getInstance()),
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java
+index da6de52..585b6dd 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java
+@@ -75,6 +75,14 @@ public final class GccCCompiler extends GccCompatibleCCompiler {
+ sourceExtensions, headerExtensions, false,
+ false, new GccCCompiler("clang++", sourceExtensions, headerExtensions, false,
+ true, null, false, null), false, null);
++ private static final GccCCompiler fccInstance = new GccCCompiler("fcc",
++ sourceExtensions, headerExtensions, false,
++ false, new GccCCompiler("fcc", sourceExtensions, headerExtensions, false,
++ true, null, false, null), false, null);
++ private static final GccCCompiler fccppInstance = new GccCCompiler("FCC",
++ sourceExtensions, headerExtensions, false,
++ false, new GccCCompiler("FCC", sourceExtensions, headerExtensions, false,
++ true, null, false, null), false, null);
+ /**
+ * Gets c++ adapter
+ */
+@@ -111,6 +119,18 @@ public final class GccCCompiler extends GccCompatibleCCompiler {
+ public static GccCCompiler getCPPLangInstance() {
+ return cpplangInstance;
+ }
++ /**
++ * Gets fcc adapter
++ */
++ public static GccCCompiler getFccInstance() {
++ return fccInstance;
++ }
++ /**
++ * Gets FCC adapter
++ */
++ public static GccCCompiler getFCCPPInstance() {
++ return fccppInstance;
++ }
+ /**
+ * Gets XCode clang adapter
+ */
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
+index f9c51ef..94ac8c2 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
+@@ -41,16 +41,22 @@ public class GccLinker extends GnuLinker {
+ private static final GccLinker clangInstance = new GccLinker("clang", objFiles,
+ discardFiles, "", "", false, null);
+ private static final GccLinker xcodeClangInstance = new GccLinker(clangInstance, true);
++ private static final GccLinker fccInstance = new GccLinker("fcc", objFiles,
++ discardFiles, "", "", false, null);
+
+ private static final GccLinker dllLinker = new GccLinker("gcc", objFiles,
+ discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles, discardFiles, "lib", ".so", true, null));
+ private static final GccLinker dllClangLinker = new GccLinker("clang", objFiles,
+ discardFiles, "lib", ".so", false, new GccLinker("clang", objFiles, discardFiles, "lib", ".so", true, null));
++ private static final GccLinker dllFccLinker = new GccLinker("fcc", objFiles,
++ discardFiles, "lib", ".so", false, new GccLinker("fcc", objFiles, discardFiles, "lib", ".so", true, null));
+
+ private static final GccLinker arLinker = new GccLinker("gcc", objFiles,
+ discardFiles, "lib", ".a", false, new GccLinker("gcc", objFiles, discardFiles, "lib", ".a", true, null));
+ private static final GccLinker arClangLinker = new GccLinker("clang", objFiles,
+ discardFiles, "lib", ".a", false, new GccLinker("clang", objFiles, discardFiles, "lib", ".a", true, null));
++ private static final GccLinker arFccLinker = new GccLinker("fcc", objFiles,
++ discardFiles, "lib", ".a", false, new GccLinker("fcc", objFiles, discardFiles, "lib", ".a", true, null));
+
+ private static final GccLinker machBundleLinker = new GccLinker("gcc",
+ objFiles, discardFiles, "lib", ".bundle", false, null);
+@@ -76,6 +82,9 @@ public class GccLinker extends GnuLinker {
+ public static GccLinker getClangInstance() {
+ return clangInstance;
+ }
++ public static GccLinker getFccInstance() {
++ return fccInstance;
++ }
+ public static GccLinker getXcodeClangInstance() {
+ return xcodeClangInstance;
+ }
+@@ -102,10 +111,18 @@ public class GccLinker extends GnuLinker {
+ return dllClangLinker;
+ }
+ @Override
++ protected final GnuLinker getStaticDllFccLinker() {
++ return dllFccLinker;
++ }
++ @Override
+ protected final GnuLinker getStaticArLinker() {
+ return arLinker;
+ }
+ @Override
++ protected final GnuLinker getStaticArFccLinker() {
++ return arFccLinker;
++ }
++ @Override
+ protected final GnuLinker getStaticArClangLinker() {
+ return arClangLinker;
+ }
+@@ -114,6 +131,10 @@ public class GccLinker extends GnuLinker {
+ return clangInstance;
+ }
+ @Override
++ protected final GnuLinker getStaticFccInstance() {
++ return fccInstance;
++ }
++ @Override
+ protected final GnuLinker getStaticXcodeClangInstance() {
+ return xcodeClangInstance;
+ }
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java
+index f6d477f..9ad9894 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GnuLinker.java
+@@ -35,6 +35,9 @@ public abstract class GnuLinker extends AbstractLdLinker {
+ protected abstract GnuLinker getStaticArLinker();
+ protected abstract GnuLinker getStaticArClangLinker();
+ protected abstract GnuLinker getStaticClangInstance();
++ protected abstract GnuLinker getStaticDllFccLinker();
++ protected abstract GnuLinker getStaticArFccLinker();
++ protected abstract GnuLinker getStaticFccInstance();
+ protected abstract GnuLinker getStaticXcodeClangInstance();
+ protected abstract GnuLinker getStaticMachBundleLinker();
+ protected abstract GnuLinker getStaticMachClangBundleLinker();
+@@ -129,24 +132,24 @@ public abstract class GnuLinker extends AbstractLdLinker {
+ if (isDarwin()) {
+ return isGNU() ? getStaticMachArLinker() : ( isXcodeRun() ? getStaticXcodeMachArClangLinker() : getStaticMachArClangLinker() );
+ } else {
+- return isGNU() ? getStaticArLinker() : getStaticArClangLinker();
++ return isGNU() ? getStaticArLinker() : (isCLANG()? getStaticArClangLinker(): getStaticArFccLinker());
+ }
+ }
+ if (type.isPluginModule()) {
+ if (isDarwin()) {
+ return isGNU() ? getStaticMachBundleLinker() : ( isXcodeRun() ? getStaticXcodeMachClangBundleLinker() : getStaticMachClangBundleLinker() );
+ } else {
+- return isGNU() ? getStaticDllLinker() : getStaticDllClangLinker();
++ return isGNU() ? getStaticDllLinker() : (isCLANG()? getStaticDllClangLinker(): getStaticDllFccLinker());
+ }
+ }
+ if (type.isSharedLibrary()) {
+ if (isDarwin()) {
+ return isGNU() ? getStaticMachDllLinker() : ( isXcodeRun() ? getStaticXcodeMachDllClangLinker() : getStaticMachDllClangLinker() );
+ } else {
+- return isGNU() ? getStaticDllLinker() : getStaticDllClangLinker();
++ return isGNU() ? getStaticDllLinker() : (isCLANG()? getStaticDllClangLinker(): getStaticDllFccLinker());
+ }
+ }
+ return isGNU() ? getStaticInstance() : ( isXcodeRun() ? getStaticXcodeClangInstance() : getStaticClangInstance() ) ;
+ }
+
+-}
+\ No newline at end of file
++}
+diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+index 833556e..ac8b688 100644
+--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
++++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+@@ -46,6 +46,8 @@ public class GppLinker extends GnuLinker {
+ discardFiles, "", "", false, false, null);
+ private static final GppLinker clangInstance = new GppLinker("clang", objFiles,
+ discardFiles, "", "", false, false, null);
++ private static final GppLinker fccInstance = new GppLinker("fcc", objFiles,
++ discardFiles, "", "", false, false, null);
+ private static final GppLinker xcodeClangInstance = new GppLinker(clangInstance, true);
+
+ private static final GppLinker dllLinker = new GppLinker("gcc", objFiles,
+@@ -54,6 +56,9 @@ public class GppLinker extends GnuLinker {
+ private static final GppLinker dllClangLinker = new GppLinker("clang", objFiles,
+ discardFiles, "lib", ".so", false, false, new GppLinker("clang", objFiles,
+ discardFiles, "lib", ".so", false, true, null));
++ private static final GppLinker dllFccLinker = new GppLinker("fcc", objFiles,
++ discardFiles, "lib", ".so", false, false, new GppLinker("fcc", objFiles,
++ discardFiles, "lib", ".so", false, true, null));
+
+ private static final GppLinker arLinker = new GppLinker("gcc", objFiles,
+ discardFiles, "lib", ".a", false, false, new GppLinker("gcc", objFiles,
+@@ -61,6 +66,9 @@ public class GppLinker extends GnuLinker {
+ private static final GppLinker arClangLinker = new GppLinker("clang", objFiles,
+ discardFiles, "lib", ".a", false, false, new GppLinker("clang", objFiles,
+ discardFiles, "lib", ".a", false, true, null));
++ private static final GppLinker arFccLinker = new GppLinker("fcc", objFiles,
++ discardFiles, "lib", ".a", false, false, new GppLinker("fcc", objFiles,
++ discardFiles, "lib", ".a", false, true, null));
+
+ private static final GppLinker machBundleLinker = new GppLinker("gcc",
+ objFiles, discardFiles, "lib", ".bundle", false, false, null);
+@@ -86,6 +94,9 @@ public class GppLinker extends GnuLinker {
+ public static GppLinker getClangInstance() {
+ return clangInstance;
+ }
++ public static GppLinker getFccInstance() {
++ return fccInstance;
++ }
+ public static GppLinker getXcodeClangInstance() {
+ return xcodeClangInstance;
+ }
+@@ -112,6 +123,10 @@ public class GppLinker extends GnuLinker {
+ return dllClangLinker;
+ }
+ @Override
++ protected final GnuLinker getStaticDllFccLinker() {
++ return dllFccLinker;
++ }
++ @Override
+ protected final GnuLinker getStaticArLinker() {
+ return arLinker;
+ }
+@@ -124,6 +139,14 @@ public class GppLinker extends GnuLinker {
+ return clangInstance;
+ }
+ @Override
++ protected final GnuLinker getStaticArFccLinker() {
++ return arFccLinker;
++ }
++ @Override
++ protected final GnuLinker getStaticFccInstance() {
++ return fccInstance;
++ }
++ @Override
+ protected final GnuLinker getStaticXcodeClangInstance() {
+ return xcodeClangInstance;
+ }
diff --git a/var/spack/repos/builtin/packages/gluegen/javalib.aarch64.patch b/var/spack/repos/builtin/packages/gluegen/javalib.aarch64.patch
new file mode 100644
index 0000000000..f73fea7d04
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gluegen/javalib.aarch64.patch
@@ -0,0 +1,13 @@
+diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml
+index a3b231e..98190a9 100755
+--- a/make/gluegen-cpptasks-base.xml
++++ b/make/gluegen-cpptasks-base.xml
+@@ -1460,7 +1460,7 @@
+ <echo message="Linux.aarch64" />
+ <property name="compiler.cfg.id.base" value="compiler.cfg.linux.aarch64" />
+ <property name="linker.cfg.id.base" value="linker.cfg.linux.aarch64" />
+- <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/aarch64" />
++ <property name="java.lib.dir.platform" value="${java.home.dir}/lib" />
+ </target>
+
+ <target name="gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinuxIA64">
diff --git a/var/spack/repos/builtin/packages/gluegen/package.py b/var/spack/repos/builtin/packages/gluegen/package.py
new file mode 100644
index 0000000000..b4dcf8cf74
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gluegen/package.py
@@ -0,0 +1,76 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import os
+
+from spack import *
+
+
+class Gluegen(Package):
+ """GlueGen is a tool which automatically generates the Java and JNI code
+ necessary to call C libraries. """
+
+ homepage = "https://jogamp.org/gluegen/www/"
+ git = "https://github.com/WadeWalker/gluegen.git"
+
+ version('java-11-fixes', branch='java-11-fixes', submodules=True)
+
+ # ant optional jar file to execute antlr tasks
+ resource(name='ant-optional', sha256='89ea82846b9ff4f4a5d51c7b5504e30462c64ddb990b014af5ded93b7d5e2b82',
+ url='https://repo1.maven.org/maven2/ant/optional/1.5.4/optional-1.5.4.jar',
+ placement='ant-optional', expand=False)
+
+ # source file of jogadm version cpptask to support Fujitsu compiler
+ resource(name='cpptasks', git='http://jogamp.org/cgit/ant-cpptasks.git', when='%fj')
+
+ depends_on('ant', type='build')
+ depends_on('java@11', type=('build', 'run'))
+
+ # Change java library directory for java11
+ patch('javalib.aarch64.patch', when='target=aarch64:')
+
+ # patch for build with Fujitsu Compiler
+ patch('cpptasks.fj.patch', working_dir='ant-cpptasks', when='%fj')
+
+ phases = ['build', 'install']
+
+ compiler_mapping = {'gcc': 'gcc', 'clang': 'clang', 'fj': 'fcc'}
+
+ def build(self, spec, prefix):
+ ant = spec['ant'].command
+ cname = spec.compiler.name
+ compiler = self.compiler_mapping.get(cname, 'gcc')
+ antarg = ['-Dgcc.compat.compiler={0}'.format(compiler)]
+
+ if self.spec.satisfies('%fj'):
+ with working_dir('ant-cpptasks'):
+ ant()
+ copy(join_path('ant-cpptasks', 'target', 'lib', 'cpptasks.jar'),
+ join_path('make', 'lib'))
+
+ with working_dir('make'):
+ ant(*antarg)
+
+ def install(self, spec, prefix):
+ install_tree('build', prefix.build)
+ install(join_path('ant-optional', 'optional-1.5.4.jar'), prefix.build)
+ install_tree('make', prefix.make)
+ filter_file('..', prefix, join_path(prefix.make, 'build.xml'),
+ string=True)
+
+ def setup_build_environment(self, env):
+ env.prepend_path('CLASSPATH',
+ join_path(self.stage.source_path,
+ 'ant-optional', 'optional-1.5.4.jar'))
+
+ def setup_run_environment(self, env):
+ class_paths = find(prefix.build, '*.jar')
+ classpath = os.pathsep.join(class_paths)
+ env.prepend_path('CLASSPATH', classpath)
+
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ class_paths = find(prefix.build, '*.jar')
+ classpath = os.pathsep.join(class_paths)
+ env.prepend_path('CLASSPATH', classpath)