forked from rarias/jungle
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb5f98647a |
@ -12,9 +12,4 @@ jobs:
|
||||
runs-on: native
|
||||
steps:
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.all
|
||||
build:cross:
|
||||
runs-on: native
|
||||
steps:
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.cross
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc-ci.all
|
||||
|
@ -42,7 +42,9 @@ in
|
||||
# full nixpkgs with our overlay applied
|
||||
legacyPackages.${system} = pkgs;
|
||||
|
||||
hydraJobs = self.legacyPackages.${system}.bsc.hydraJobs;
|
||||
hydraJobs = {
|
||||
inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
|
||||
};
|
||||
|
||||
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||
inherit (nixpkgs) lib;
|
||||
|
@ -11,7 +11,6 @@
|
||||
./base/hw.nix
|
||||
./base/net.nix
|
||||
./base/nix.nix
|
||||
./base/sys-devices.nix
|
||||
./base/ntp.nix
|
||||
./base/rev.nix
|
||||
./base/ssh.nix
|
||||
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
nix.settings.system-features = [ "sys-devices" ];
|
||||
|
||||
programs.nix-required-mounts.enable = true;
|
||||
programs.nix-required-mounts.allowedPatterns.sys-devices.paths = [
|
||||
"/sys/devices/system/cpu"
|
||||
"/sys/devices/system/node"
|
||||
];
|
||||
}
|
56
overlay.nix
56
overlay.nix
@ -8,6 +8,9 @@ let
|
||||
|
||||
bscPkgs = {
|
||||
amd-uprof = prev.callPackage ./pkgs/amd-uprof/default.nix { };
|
||||
aoccUnwrapped = callPackage ./pkgs/aocc/unwrapped.nix { };
|
||||
aocc = callPackage ./pkgs/aocc/default.nix { };
|
||||
stdenvAocc = final.overrideCC final.stdenv final.aocc;
|
||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
||||
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
|
||||
@ -62,7 +65,7 @@ let
|
||||
};
|
||||
|
||||
tests = rec {
|
||||
hwloc = callPackage ./test/bugs/hwloc.nix { };
|
||||
#hwloc = callPackage ./test/bugs/hwloc.nix { }; # Broken, no /sys
|
||||
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
|
||||
hello-c = callPackage ./test/compilers/hello-c.nix { };
|
||||
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
|
||||
@ -94,18 +97,12 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
# For now, only build toplevel packages in CI/Hydra
|
||||
pkgsTopLevel = filterAttrs (_: isDerivation) bscPkgs;
|
||||
pkgs = filterAttrs (_: isDerivation) bscPkgs;
|
||||
|
||||
# Native build in that platform doesn't imply cross build works
|
||||
canCrossCompile = platform: pkg:
|
||||
(isDerivation pkg) &&
|
||||
# Must be defined explicitly
|
||||
(pkg.meta.cross or false) &&
|
||||
(meta.availableOn platform pkg);
|
||||
|
||||
# For now only RISC-V
|
||||
crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgsTopLevel; };
|
||||
crossTargets = [ "riscv64" ];
|
||||
cross = prev.lib.genAttrs crossTargets (target:
|
||||
final.pkgsCross.${target}.bsc-ci.pkgs
|
||||
);
|
||||
|
||||
buildList = name: paths:
|
||||
final.runCommandLocal name { } ''
|
||||
@ -119,31 +116,22 @@ let
|
||||
printf '%s\n' $deps >$out
|
||||
'';
|
||||
|
||||
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgsTopLevel);
|
||||
testsList = buildList "ci-tests" (collect isDerivation tests);
|
||||
allList = buildList' "ci-all" [ pkgsList testsList ];
|
||||
# For now only RISC-V
|
||||
crossList = buildList "ci-cross"
|
||||
(filter
|
||||
(canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform)
|
||||
(builtins.attrValues crossSet.riscv64));
|
||||
crossList = builtins.mapAttrs (t: v: buildList t (builtins.attrValues v)) cross;
|
||||
|
||||
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs);
|
||||
testList = buildList "ci-tests" (collect isDerivation tests);
|
||||
|
||||
all = buildList' "ci-all" [ pkgsList testList ];
|
||||
|
||||
in bscPkgs // {
|
||||
# Prevent accidental usage of bsc-ci attribute
|
||||
bsc-ci = throw "the bsc-ci attribute is deprecated, use bsc.ci";
|
||||
# Prevent accidental usage of bsc attribute
|
||||
bsc = throw "the bsc attribute is deprecated, packages are now in the root";
|
||||
|
||||
# Internal for our CI tests
|
||||
bsc = {
|
||||
# CI targets for nix build
|
||||
ci = { pkgs = pkgsList; tests = testsList; all = allList; cross = crossList; };
|
||||
|
||||
# Direct access to package sets
|
||||
tests = tests;
|
||||
pkgs = bscPkgs;
|
||||
pkgsTopLevel = pkgsTopLevel;
|
||||
cross = crossSet;
|
||||
|
||||
# Hydra uses attribute sets of pkgs
|
||||
hydraJobs = { tests = tests; pkgs = pkgsTopLevel; cross = crossSet; };
|
||||
bsc-ci = {
|
||||
inherit pkgs pkgsList;
|
||||
inherit tests testList;
|
||||
inherit cross crossList;
|
||||
inherit all;
|
||||
};
|
||||
}
|
||||
|
16
pkgs/aocc/default.nix
Normal file
16
pkgs/aocc/default.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ wrapCCWith
|
||||
, aoccUnwrapped
|
||||
}:
|
||||
|
||||
let
|
||||
cc = aoccUnwrapped;
|
||||
in wrapCCWith {
|
||||
inherit cc;
|
||||
|
||||
extraBuildCommands = ''
|
||||
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
|
||||
|
||||
wrap aocc $wrapper $ccPath/clang
|
||||
wrap aocc++ $wrapper $ccPath/clang++
|
||||
'';
|
||||
}
|
51
pkgs/aocc/unwrapped.nix
Normal file
51
pkgs/aocc/unwrapped.nix
Normal file
@ -0,0 +1,51 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, stdenv
|
||||
, autoPatchelfHook
|
||||
, rocmPackages
|
||||
, zlib
|
||||
, libffi
|
||||
, elfutils
|
||||
}:
|
||||
|
||||
let
|
||||
# in newer nixpkgs the runtime is hsakmt
|
||||
rocmRuntime =
|
||||
if rocmPackages ? hsakmt then
|
||||
rocmPackages.hsakmt
|
||||
else
|
||||
rocmPackages.rocm-runtime;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "aocc-compiler";
|
||||
version = "5.0.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.amd.com/developer/eula/aocc/aocc-5-0/aocc-compiler-5.0.0.tar";
|
||||
sha256 = "sha256-lm+sLSx1np3m6WnBCtp6ezBsET9/HgfqN2gp7IY4Dao=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
buildInputs = [
|
||||
elfutils
|
||||
zlib
|
||||
rocmRuntime
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -a . $out/
|
||||
|
||||
ln -s ${lib.getLib libffi}/lib/libffi.so $out/lib/libffi.so.6
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit rocmRuntime;
|
||||
isClang = true; # Needed for wrapCCWith
|
||||
};
|
||||
|
||||
meta.mainProgram = "clang";
|
||||
}
|
@ -20,7 +20,6 @@
|
||||
#, python3Packages
|
||||
, installShellFiles
|
||||
, symlinkJoin
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
}:
|
||||
|
||||
let
|
||||
@ -88,7 +87,7 @@ stdenv.mkDerivation rec {
|
||||
--enable-sampling
|
||||
--with-unwind=${libunwind.dev}
|
||||
--with-xml-prefix=${libxml2.dev}
|
||||
${lib.optionalString enablePapi "--with-papi=${papi}"}
|
||||
--with-papi=${papi}
|
||||
${if (mpi != null) then ''--with-mpi=${mpi}''
|
||||
else ''--without-mpi''}
|
||||
--without-dyninst)
|
||||
|
@ -35,8 +35,6 @@ stdenv.mkDerivation rec {
|
||||
CFLAGS=-Wno-implicit-int
|
||||
CPPFLAGS=-I${libtirpc.dev}/include/tirpc
|
||||
LDFLAGS=-ltirpc
|
||||
CC=$CC
|
||||
AR=$AR
|
||||
)
|
||||
'';
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
, jemallocNanos6 ? null
|
||||
, cachelineBytes ? 64
|
||||
, enableGlibcxxDebug ? false
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
, useGit ? false
|
||||
, gitUrl ? "ssh://git@bscpm04.bsc.es/nanos6/nanos6"
|
||||
, gitBranch ? "master"
|
||||
@ -48,8 +47,6 @@ let
|
||||
};
|
||||
|
||||
source = if (useGit) then git else release;
|
||||
|
||||
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||
in
|
||||
stdenv.mkDerivation (source // {
|
||||
pname = "nanos6";
|
||||
@ -74,13 +71,9 @@ in
|
||||
"--disable-all-instrumentations"
|
||||
"--enable-ovni-instrumentation"
|
||||
"--with-ovni=${ovni}"
|
||||
"--with-boost=${boost.dev}"
|
||||
] ++
|
||||
(optional enableJemalloc "--with-jemalloc=${jemallocNanos6}") ++
|
||||
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG") ++
|
||||
# Most nanos6 api symbols are resolved at runtime, so prefer
|
||||
# ifunc by default
|
||||
(optional isCross "--with-symbol-resolution=ifunc");
|
||||
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG");
|
||||
|
||||
postConfigure = lib.optionalString (!enableDebug) ''
|
||||
# Disable debug
|
||||
@ -104,14 +97,16 @@ in
|
||||
# TODO: papi_version is needed for configure:
|
||||
# ./configure: line 27378: papi_version: command not found
|
||||
# This probably breaks cross-compilation
|
||||
] ++ lib.optionals enablePapi [ papi ];
|
||||
papi
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
numactl
|
||||
hwloc
|
||||
papi
|
||||
ovni
|
||||
] ++ lib.optionals enablePapi [ papi ];
|
||||
];
|
||||
|
||||
# Create a script that sets NANOS6_HOME
|
||||
postInstall = ''
|
||||
|
@ -7,7 +7,7 @@
|
||||
, numactl
|
||||
, hwloc
|
||||
, papi
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
, enablePapi ? true
|
||||
, cacheline ? 64 # bits
|
||||
, ovni ? null
|
||||
, useGit ? false
|
||||
|
@ -55,7 +55,4 @@ in
|
||||
doCheck = true;
|
||||
checkTarget = "test";
|
||||
hardeningDisable = [ "all" ];
|
||||
meta = {
|
||||
cross = true;
|
||||
};
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "hwloc-test";
|
||||
requiredSystemFeatures = [ "sys-devices" ];
|
||||
|
||||
src = ./.;
|
||||
|
||||
@ -15,7 +14,7 @@ stdenv.mkDerivation {
|
||||
buildPhase = ''
|
||||
ls -l /sys
|
||||
gcc -lhwloc hwloc.c -o hwloc
|
||||
strace ./hwloc > $out
|
||||
strace ./hwloc
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -23,8 +23,9 @@ in stdenv.mkDerivation {
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
# nOS-V requires access to /sys/devices to request NUMA information
|
||||
requiredSystemFeatures = [ "sys-devices" ];
|
||||
# nOS-V requires access to /sys/devices to request NUMA information. It will
|
||||
# fail to run otherwise, so we disable the sandbox for this test.
|
||||
__noChroot = true;
|
||||
|
||||
buildInputs = [ openmp ];
|
||||
|
||||
|
@ -36,8 +36,9 @@ in stdenv.mkDerivation {
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
# nOS-V requires access to /sys/devices to request NUMA information
|
||||
requiredSystemFeatures = [ "sys-devices" ];
|
||||
# nOS-V requires access to /sys/devices to request NUMA information. It will
|
||||
# fail to run otherwise, so we disable the sandbox for this test.
|
||||
__noChroot = true;
|
||||
|
||||
buildInputs = [ nosv ];
|
||||
|
||||
|
@ -24,8 +24,9 @@ in stdenv.mkDerivation {
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
# nOS-V requires access to /sys/devices to request NUMA information
|
||||
requiredSystemFeatures = [ "sys-devices" ];
|
||||
# nOS-V requires access to /sys/devices to request NUMA information. It will
|
||||
# fail to run otherwise, so we disable the sandbox for this test.
|
||||
__noChroot = true;
|
||||
|
||||
buildPhase = ''
|
||||
set -x
|
||||
|
@ -25,10 +25,9 @@ stdenv.mkDerivation rec {
|
||||
hardeningDisable = [ "all" ];
|
||||
#NIX_DEBUG = 1;
|
||||
buildInputs = [ ]; #strace gdb;
|
||||
|
||||
# NODES requires access to /sys/devices to request NUMA information
|
||||
requiredSystemFeatures = [ "sys-devices" ];
|
||||
|
||||
# NODES requires access to /sys/devices to request NUMA information. It will
|
||||
# fail to run otherwise, so we disable the sandbox for this test.
|
||||
__noChroot = true;
|
||||
buildPhase = ''
|
||||
set -x
|
||||
#$CC -v
|
||||
|
Loading…
x
Reference in New Issue
Block a user