glugen: new package. (#29312)
This commit is contained in:
parent
50b5b314b3
commit
aee763015e
266
var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch
Normal file
266
var/spack/repos/builtin/packages/gluegen/cpptasks.fj.patch
Normal file
@ -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;
|
||||
}
|
@ -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">
|
76
var/spack/repos/builtin/packages/gluegen/package.py
Normal file
76
var/spack/repos/builtin/packages/gluegen/package.py
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user