forked from rarias/jungle
Compare commits
1 Commits
pkgs/groma
...
remove-old
| Author | SHA1 | Date | |
|---|---|---|---|
|
3816c1bcb2
|
82
flake.lock
generated
82
flake.lock
generated
@@ -1,5 +1,71 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"agenix": {
|
||||||
|
"inputs": {
|
||||||
|
"darwin": "darwin",
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750173260,
|
||||||
|
"narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=",
|
||||||
|
"owner": "ryantm",
|
||||||
|
"repo": "agenix",
|
||||||
|
"rev": "531beac616433bac6f9e2a19feb8e99a22a66baf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ryantm",
|
||||||
|
"repo": "agenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"agenix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1744478979,
|
||||||
|
"narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=",
|
||||||
|
"owner": "lnl7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "43975d782b418ebf4969e9ccba82466728c2851b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lnl7",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"agenix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1745494811,
|
||||||
|
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752436162,
|
"lastModified": 1752436162,
|
||||||
@@ -18,8 +84,24 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"agenix": "agenix",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
|
agenix.url = "github:ryantm/agenix";
|
||||||
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }:
|
outputs = { self, nixpkgs, agenix, ... }:
|
||||||
let
|
let
|
||||||
mkConf = name: nixpkgs.lib.nixosSystem {
|
mkConf = name: nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit nixpkgs; theFlake = self; };
|
specialArgs = { inherit nixpkgs agenix; theFlake = self; };
|
||||||
modules = [ "${self.outPath}/m/${name}/configuration.nix" ];
|
modules = [ "${self.outPath}/m/${name}/configuration.nix" ];
|
||||||
};
|
};
|
||||||
# For now we only support x86
|
# For now we only support x86
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{ pkgs, ... }:
|
{ agenix, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ../../module/agenix.nix ];
|
imports = [ agenix.nixosModules.default ];
|
||||||
|
|
||||||
# Add agenix to system packages
|
environment.systemPackages = [
|
||||||
environment.systemPackages = [ pkgs.agenix ];
|
agenix.packages.x86_64-linux.default
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,19 +180,6 @@
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmMqKqPg4uocNOr3O41kLbZMOMJn3m2ZdN1JvTR96z3 bsccns@arnau-bsc"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmMqKqPg4uocNOr3O41kLbZMOMJn3m2ZdN1JvTR96z3 bsccns@arnau-bsc"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
aaguirre = {
|
|
||||||
uid = 9655;
|
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/Computational/aaguirre";
|
|
||||||
description = "Alejandro Aguirre";
|
|
||||||
group = "Computational";
|
|
||||||
hosts = [ "apex" "hut" ];
|
|
||||||
hashedPassword = "$6$TXRXQT6jjBvxkxU6$E.sh5KspAm1qeG5Ct7OPHpo8REmbGDwjFGvqeGgTVz3GASGOAnPL7UMZsMAsAKBoahOw.v8LNno6XGrTEPzZH1";
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOlRX7ZCnqtUJYCxKgWmgSrFCYuA2LHY96rVwqxXPl86 aaguirre@BSC-8488184117"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
groups = {
|
groups = {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
./postgresql.nix
|
./postgresql.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
./p.nix
|
./p.nix
|
||||||
./ompss2-timer.nix
|
|
||||||
#./pxe.nix
|
#./pxe.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow gitea user to send mail
|
|
||||||
users.users.gitea.extraGroups = [ "mail-robot" ];
|
|
||||||
|
|
||||||
services.gitea-actions-runner.instances = {
|
services.gitea-actions-runner.instances = {
|
||||||
runrun = {
|
runrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
# Robot user that can see the password to send mail from jungle-robot
|
|
||||||
users.groups.mail-robot = {};
|
|
||||||
|
|
||||||
age.secrets.jungleRobotPassword = {
|
age.secrets.jungleRobotPassword = {
|
||||||
file = ../../secrets/jungle-robot-password.age;
|
file = ../../secrets/jungle-robot-password.age;
|
||||||
group = "mail-robot";
|
group = "gitea";
|
||||||
mode = "440";
|
mode = "440";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ let
|
|||||||
name = "jungle-web";
|
name = "jungle-web";
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://jungle.bsc.es/git/rarias/jungle-website.git";
|
url = "https://jungle.bsc.es/git/rarias/jungle-website.git";
|
||||||
rev = "52abaf4d71652a9ef77a0b098db14ca33bffff4c";
|
rev = "739bf0175a7f05380fe7ad7023ff1d60db1710e1";
|
||||||
hash = "sha256-/ul9GazbOrOkmlvSgDz/+2W+V+ir5725Y7mVLc3rb0M=";
|
hash = "sha256-ea5DzhYTzZ9TmqD+x95rdNdLbxPnBluqlYH2NmBYmc4=";
|
||||||
};
|
};
|
||||||
buildInputs = [ pkgs.hugo ];
|
buildInputs = [ pkgs.hugo ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
systemd.timers = {
|
|
||||||
"ompss2-closing" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
Unit = "ompss2-closing.service";
|
|
||||||
OnCalendar = [ "*-03-15 07:00:00" "*-09-15 07:00:00"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"ompss2-freeze" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
Unit = "ompss2-freeze.service";
|
|
||||||
OnCalendar = [ "*-04-15 07:00:00" "*-10-15 07:00:00" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"ompss2-release" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
Unit = "ompss2-release.service";
|
|
||||||
OnCalendar = [ "*-05-15 07:00:00" "*-11-15 07:00:00" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services =
|
|
||||||
let
|
|
||||||
closing = pkgs.writeText "closing.txt"
|
|
||||||
''
|
|
||||||
Subject: OmpSs-2 release enters closing period
|
|
||||||
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
You have one month to merge the remaining features for the next OmpSs-2
|
|
||||||
release. Please, identify what needs to be merged and discuss it in the next
|
|
||||||
OmpSs-2 meeting.
|
|
||||||
|
|
||||||
Thanks!,
|
|
||||||
Jungle robot
|
|
||||||
'';
|
|
||||||
freeze = pkgs.writeText "freeze.txt"
|
|
||||||
''
|
|
||||||
Subject: OmpSs-2 release enters freeze period
|
|
||||||
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
The period to introduce new features or breaking changes is over, only bug
|
|
||||||
fixes are allowed now. During this time, please prepare the release notes
|
|
||||||
to be included in the next OmpSs-2 release.
|
|
||||||
|
|
||||||
Thanks!,
|
|
||||||
Jungle robot
|
|
||||||
'';
|
|
||||||
release = pkgs.writeText "release.txt"
|
|
||||||
''
|
|
||||||
Subject: OmpSs-2 release now
|
|
||||||
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
The period to introduce bug fixes is now over. Please, proceed to do the
|
|
||||||
OmpSs-2 release.
|
|
||||||
|
|
||||||
Thanks!,
|
|
||||||
Jungle robot
|
|
||||||
'';
|
|
||||||
mkServ = name: mail: {
|
|
||||||
"ompss2-${name}" = {
|
|
||||||
script = ''
|
|
||||||
set -eu
|
|
||||||
set -o pipefail
|
|
||||||
cat ${mail} | ${config.security.wrapperDir}/sendmail star@bsc.es
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
DynamicUser = true;
|
|
||||||
Group = "mail-robot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(mkServ "closing" closing) //
|
|
||||||
(mkServ "freeze" freeze) //
|
|
||||||
(mkServ "release" release);
|
|
||||||
}
|
|
||||||
@@ -1,357 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.age;
|
|
||||||
|
|
||||||
isDarwin = lib.attrsets.hasAttrByPath [ "environment" "darwinConfig" ] options;
|
|
||||||
|
|
||||||
ageBin = config.age.ageBin;
|
|
||||||
|
|
||||||
users = config.users.users;
|
|
||||||
|
|
||||||
sysusersEnabled =
|
|
||||||
if isDarwin then
|
|
||||||
false
|
|
||||||
else
|
|
||||||
options.systemd ? sysusers && (config.systemd.sysusers.enable || config.services.userborn.enable);
|
|
||||||
|
|
||||||
mountCommand =
|
|
||||||
if isDarwin then
|
|
||||||
''
|
|
||||||
if ! diskutil info "${cfg.secretsMountPoint}" &> /dev/null; then
|
|
||||||
num_sectors=1048576
|
|
||||||
dev=$(hdiutil attach -nomount ram://"$num_sectors" | sed 's/[[:space:]]*$//')
|
|
||||||
newfs_hfs -v agenix "$dev"
|
|
||||||
mount -t hfs -o nobrowse,nodev,nosuid,-m=0751 "$dev" "${cfg.secretsMountPoint}"
|
|
||||||
fi
|
|
||||||
''
|
|
||||||
else
|
|
||||||
''
|
|
||||||
grep -q "${cfg.secretsMountPoint} ramfs" /proc/mounts ||
|
|
||||||
mount -t ramfs none "${cfg.secretsMountPoint}" -o nodev,nosuid,mode=0751
|
|
||||||
'';
|
|
||||||
newGeneration = ''
|
|
||||||
_agenix_generation="$(basename "$(readlink ${cfg.secretsDir})" || echo 0)"
|
|
||||||
(( ++_agenix_generation ))
|
|
||||||
echo "[agenix] creating new generation in ${cfg.secretsMountPoint}/$_agenix_generation"
|
|
||||||
mkdir -p "${cfg.secretsMountPoint}"
|
|
||||||
chmod 0751 "${cfg.secretsMountPoint}"
|
|
||||||
${mountCommand}
|
|
||||||
mkdir -p "${cfg.secretsMountPoint}/$_agenix_generation"
|
|
||||||
chmod 0751 "${cfg.secretsMountPoint}/$_agenix_generation"
|
|
||||||
'';
|
|
||||||
|
|
||||||
chownGroup = if isDarwin then "admin" else "keys";
|
|
||||||
# chown the secrets mountpoint and the current generation to the keys group
|
|
||||||
# instead of leaving it root:root.
|
|
||||||
chownMountPoint = ''
|
|
||||||
chown :${chownGroup} "${cfg.secretsMountPoint}" "${cfg.secretsMountPoint}/$_agenix_generation"
|
|
||||||
'';
|
|
||||||
|
|
||||||
setTruePath = secretType: ''
|
|
||||||
${
|
|
||||||
if secretType.symlink then
|
|
||||||
''
|
|
||||||
_truePath="${cfg.secretsMountPoint}/$_agenix_generation/${secretType.name}"
|
|
||||||
''
|
|
||||||
else
|
|
||||||
''
|
|
||||||
_truePath="${secretType.path}"
|
|
||||||
''
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
installSecret = secretType: ''
|
|
||||||
${setTruePath secretType}
|
|
||||||
echo "decrypting '${secretType.file}' to '$_truePath'..."
|
|
||||||
TMP_FILE="$_truePath.tmp"
|
|
||||||
|
|
||||||
IDENTITIES=()
|
|
||||||
for identity in ${toString cfg.identityPaths}; do
|
|
||||||
test -r "$identity" || continue
|
|
||||||
test -s "$identity" || continue
|
|
||||||
IDENTITIES+=(-i)
|
|
||||||
IDENTITIES+=("$identity")
|
|
||||||
done
|
|
||||||
|
|
||||||
test "''${#IDENTITIES[@]}" -eq 0 && echo "[agenix] WARNING: no readable identities found!"
|
|
||||||
|
|
||||||
mkdir -p "$(dirname "$_truePath")"
|
|
||||||
[ "${secretType.path}" != "${cfg.secretsDir}/${secretType.name}" ] && mkdir -p "$(dirname "${secretType.path}")"
|
|
||||||
(
|
|
||||||
umask u=r,g=,o=
|
|
||||||
test -f "${secretType.file}" || echo '[agenix] WARNING: encrypted file ${secretType.file} does not exist!'
|
|
||||||
test -d "$(dirname "$TMP_FILE")" || echo "[agenix] WARNING: $(dirname "$TMP_FILE") does not exist!"
|
|
||||||
LANG=${
|
|
||||||
config.i18n.defaultLocale or "C"
|
|
||||||
} ${ageBin} --decrypt "''${IDENTITIES[@]}" -o "$TMP_FILE" "${secretType.file}"
|
|
||||||
)
|
|
||||||
chmod ${secretType.mode} "$TMP_FILE"
|
|
||||||
mv -f "$TMP_FILE" "$_truePath"
|
|
||||||
|
|
||||||
${optionalString secretType.symlink ''
|
|
||||||
[ "${secretType.path}" != "${cfg.secretsDir}/${secretType.name}" ] && ln -sfT "${cfg.secretsDir}/${secretType.name}" "${secretType.path}"
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
|
|
||||||
testIdentities = map (path: ''
|
|
||||||
test -f ${path} || echo '[agenix] WARNING: config.age.identityPaths entry ${path} not present!'
|
|
||||||
'') cfg.identityPaths;
|
|
||||||
|
|
||||||
cleanupAndLink = ''
|
|
||||||
_agenix_generation="$(basename "$(readlink ${cfg.secretsDir})" || echo 0)"
|
|
||||||
(( ++_agenix_generation ))
|
|
||||||
echo "[agenix] symlinking new secrets to ${cfg.secretsDir} (generation $_agenix_generation)..."
|
|
||||||
ln -sfT "${cfg.secretsMountPoint}/$_agenix_generation" ${cfg.secretsDir}
|
|
||||||
|
|
||||||
(( _agenix_generation > 1 )) && {
|
|
||||||
echo "[agenix] removing old secrets (generation $(( _agenix_generation - 1 )))..."
|
|
||||||
rm -rf "${cfg.secretsMountPoint}/$(( _agenix_generation - 1 ))"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
installSecrets = builtins.concatStringsSep "\n" (
|
|
||||||
[ "echo '[agenix] decrypting secrets...'" ]
|
|
||||||
++ testIdentities
|
|
||||||
++ (map installSecret (builtins.attrValues cfg.secrets))
|
|
||||||
++ [ cleanupAndLink ]
|
|
||||||
);
|
|
||||||
|
|
||||||
chownSecret = secretType: ''
|
|
||||||
${setTruePath secretType}
|
|
||||||
chown ${secretType.owner}:${secretType.group} "$_truePath"
|
|
||||||
'';
|
|
||||||
|
|
||||||
chownSecrets = builtins.concatStringsSep "\n" (
|
|
||||||
[ "echo '[agenix] chowning...'" ]
|
|
||||||
++ [ chownMountPoint ]
|
|
||||||
++ (map chownSecret (builtins.attrValues cfg.secrets))
|
|
||||||
);
|
|
||||||
|
|
||||||
secretType = types.submodule (
|
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
name = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = config._module.args.name;
|
|
||||||
defaultText = literalExpression "config._module.args.name";
|
|
||||||
description = ''
|
|
||||||
Name of the file used in {option}`age.secretsDir`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
file = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
description = ''
|
|
||||||
Age file the secret is loaded from.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
path = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "${cfg.secretsDir}/${config.name}";
|
|
||||||
defaultText = literalExpression ''
|
|
||||||
"''${cfg.secretsDir}/''${config.name}"
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Path where the decrypted secret is installed.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
mode = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "0400";
|
|
||||||
description = ''
|
|
||||||
Permissions mode of the decrypted secret in a format understood by chmod.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
owner = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "0";
|
|
||||||
description = ''
|
|
||||||
User of the decrypted secret.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
group = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = users.${config.owner}.group or "0";
|
|
||||||
defaultText = literalExpression ''
|
|
||||||
users.''${config.owner}.group or "0"
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Group of the decrypted secret.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
symlink = mkEnableOption "symlinking secrets to their destination" // {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(mkRenamedOptionModule [ "age" "sshKeyPaths" ] [ "age" "identityPaths" ])
|
|
||||||
];
|
|
||||||
|
|
||||||
options.age = {
|
|
||||||
ageBin = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "${pkgs.age}/bin/age";
|
|
||||||
defaultText = literalExpression ''
|
|
||||||
"''${pkgs.age}/bin/age"
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
The age executable to use.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
secrets = mkOption {
|
|
||||||
type = types.attrsOf secretType;
|
|
||||||
default = { };
|
|
||||||
description = ''
|
|
||||||
Attrset of secrets.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
secretsDir = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = "/run/agenix";
|
|
||||||
description = ''
|
|
||||||
Folder where secrets are symlinked to
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
secretsMountPoint = mkOption {
|
|
||||||
type =
|
|
||||||
types.addCheck types.str (
|
|
||||||
s:
|
|
||||||
(builtins.match "[ \t\n]*" s) == null # non-empty
|
|
||||||
&& (builtins.match ".+/" s) == null
|
|
||||||
) # without trailing slash
|
|
||||||
// {
|
|
||||||
description = "${types.str.description} (with check: non-empty without trailing slash)";
|
|
||||||
};
|
|
||||||
default = "/run/agenix.d";
|
|
||||||
description = ''
|
|
||||||
Where secrets are created before they are symlinked to {option}`age.secretsDir`
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
identityPaths = mkOption {
|
|
||||||
type = types.listOf types.path;
|
|
||||||
default =
|
|
||||||
if isDarwin then
|
|
||||||
[
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
]
|
|
||||||
else if (config.services.openssh.enable or false) then
|
|
||||||
map (e: e.path) (
|
|
||||||
lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys
|
|
||||||
)
|
|
||||||
else
|
|
||||||
[ ];
|
|
||||||
defaultText = literalExpression ''
|
|
||||||
if isDarwin
|
|
||||||
then [
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
]
|
|
||||||
else if (config.services.openssh.enable or false)
|
|
||||||
then map (e: e.path) (lib.filter (e: e.type == "rsa" || e.type == "ed25519") config.services.openssh.hostKeys)
|
|
||||||
else [];
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
Path to SSH keys to be used as identities in age decryption.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf (cfg.secrets != { }) (mkMerge [
|
|
||||||
{
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = cfg.identityPaths != [ ];
|
|
||||||
message = "age.identityPaths must be set, for example by enabling openssh.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
(optionalAttrs (!isDarwin) {
|
|
||||||
# When using sysusers we no longer be started as an activation script
|
|
||||||
# because those are started in initrd while sysusers is started later.
|
|
||||||
systemd.services.agenix-install-secrets = mkIf sysusersEnabled {
|
|
||||||
wantedBy = [ "sysinit.target" ];
|
|
||||||
after = [ "systemd-sysusers.service" ];
|
|
||||||
unitConfig.DefaultDependencies = "no";
|
|
||||||
|
|
||||||
path = [ pkgs.mount ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = pkgs.writeShellScript "agenix-install" (concatLines [
|
|
||||||
newGeneration
|
|
||||||
installSecrets
|
|
||||||
chownSecrets
|
|
||||||
]);
|
|
||||||
RemainAfterExit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Create a new directory full of secrets for symlinking (this helps
|
|
||||||
# ensure removed secrets are actually removed, or at least become
|
|
||||||
# invalid symlinks).
|
|
||||||
system.activationScripts = mkIf (!sysusersEnabled) {
|
|
||||||
agenixNewGeneration = {
|
|
||||||
text = newGeneration;
|
|
||||||
deps = [
|
|
||||||
"specialfs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
agenixInstall = {
|
|
||||||
text = installSecrets;
|
|
||||||
deps = [
|
|
||||||
"agenixNewGeneration"
|
|
||||||
"specialfs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# So user passwords can be encrypted.
|
|
||||||
users.deps = [ "agenixInstall" ];
|
|
||||||
|
|
||||||
# Change ownership and group after users and groups are made.
|
|
||||||
agenixChown = {
|
|
||||||
text = chownSecrets;
|
|
||||||
deps = [
|
|
||||||
"users"
|
|
||||||
"groups"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# So other activation scripts can depend on agenix being done.
|
|
||||||
agenix = {
|
|
||||||
text = "";
|
|
||||||
deps = [ "agenixChown" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(optionalAttrs isDarwin {
|
|
||||||
launchd.daemons.activate-agenix = {
|
|
||||||
script = ''
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
||||||
${newGeneration}
|
|
||||||
${installSecrets}
|
|
||||||
${chownSecrets}
|
|
||||||
exit 0
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
RunAtLoad = true;
|
|
||||||
KeepAlive.SuccessfulExit = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
@@ -86,7 +86,9 @@ in {
|
|||||||
# when a task runs (srun) so we can ssh early.
|
# when a task runs (srun) so we can ssh early.
|
||||||
PrologFlags=Alloc,Contain,X11
|
PrologFlags=Alloc,Contain,X11
|
||||||
|
|
||||||
LaunchParameters=use_interactive_step
|
# LaunchParameters=ulimit_pam_adopt will set RLIMIT_RSS in processes
|
||||||
|
# adopted by the external step, similar to tasks running in regular steps
|
||||||
|
# LaunchParameters=ulimit_pam_adopt
|
||||||
SlurmdDebug=debug5
|
SlurmdDebug=debug5
|
||||||
#DebugFlags=Protocol,Cgroup
|
#DebugFlags=Protocol,Cgroup
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ let
|
|||||||
name = "jungle-web";
|
name = "jungle-web";
|
||||||
src = pkgs.fetchgit {
|
src = pkgs.fetchgit {
|
||||||
url = "https://jungle.bsc.es/git/rarias/jungle-website.git";
|
url = "https://jungle.bsc.es/git/rarias/jungle-website.git";
|
||||||
rev = "52abaf4d71652a9ef77a0b098db14ca33bffff4c";
|
rev = "739bf0175a7f05380fe7ad7023ff1d60db1710e1";
|
||||||
hash = "sha256-/ul9GazbOrOkmlvSgDz/+2W+V+ir5725Y7mVLc3rb0M=";
|
hash = "sha256-ea5DzhYTzZ9TmqD+x95rdNdLbxPnBluqlYH2NmBYmc4=";
|
||||||
};
|
};
|
||||||
buildInputs = [ pkgs.hugo ];
|
buildInputs = [ pkgs.hugo ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|||||||
20
overlay.nix
20
overlay.nix
@@ -7,7 +7,6 @@ let
|
|||||||
callPackage = final.callPackage;
|
callPackage = final.callPackage;
|
||||||
|
|
||||||
bscPkgs = {
|
bscPkgs = {
|
||||||
agenix = prev.callPackage ./pkgs/agenix/default.nix { };
|
|
||||||
amd-uprof = prev.callPackage ./pkgs/amd-uprof/default.nix { };
|
amd-uprof = prev.callPackage ./pkgs/amd-uprof/default.nix { };
|
||||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||||
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
||||||
@@ -19,11 +18,7 @@ let
|
|||||||
cudainfo = prev.callPackage ./pkgs/cudainfo/default.nix { };
|
cudainfo = prev.callPackage ./pkgs/cudainfo/default.nix { };
|
||||||
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
|
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
|
||||||
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
|
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
|
||||||
intel-apt = callPackage ./pkgs/intel-oneapi/packages.nix { };
|
|
||||||
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
|
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
|
||||||
intelPackages_2024 = final.intel-apt.hpckit_2024;
|
|
||||||
intelPackages_2025 = final.intel-apt.hpckit_2025;
|
|
||||||
intelPackages = final.intelPackages_2025;
|
|
||||||
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
|
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
|
||||||
# FIXME: Extend this to all linuxPackages variants. Open problem, see:
|
# FIXME: Extend this to all linuxPackages variants. Open problem, see:
|
||||||
# https://discourse.nixos.org/t/whats-the-right-way-to-make-a-custom-kernel-module-available/4636
|
# https://discourse.nixos.org/t/whats-the-right-way-to-make-a-custom-kernel-module-available/4636
|
||||||
@@ -46,7 +41,6 @@ let
|
|||||||
#nix-wrap = callPackage ./pkgs/nix-wrap/default.nix { };
|
#nix-wrap = callPackage ./pkgs/nix-wrap/default.nix { };
|
||||||
nodes = callPackage ./pkgs/nodes/default.nix { };
|
nodes = callPackage ./pkgs/nodes/default.nix { };
|
||||||
nosv = callPackage ./pkgs/nosv/default.nix { };
|
nosv = callPackage ./pkgs/nosv/default.nix { };
|
||||||
oneMath = callPackage ./pkgs/onemath/default.nix { };
|
|
||||||
openmp = callPackage ./pkgs/llvm-ompss2/openmp.nix { monorepoSrc = final.clangOmpss2Unwrapped.src; version = final.clangOmpss2Unwrapped.version; };
|
openmp = callPackage ./pkgs/llvm-ompss2/openmp.nix { monorepoSrc = final.clangOmpss2Unwrapped.src; version = final.clangOmpss2Unwrapped.version; };
|
||||||
openmpv = final.openmp.override { enableNosv = true; enableOvni = true; };
|
openmpv = final.openmp.override { enableNosv = true; enableOvni = true; };
|
||||||
osumb = callPackage ./pkgs/osu/default.nix { };
|
osumb = callPackage ./pkgs/osu/default.nix { };
|
||||||
@@ -56,7 +50,6 @@ let
|
|||||||
prometheus-slurm-exporter = prev.callPackage ./pkgs/slurm-exporter/default.nix { };
|
prometheus-slurm-exporter = prev.callPackage ./pkgs/slurm-exporter/default.nix { };
|
||||||
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned
|
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned
|
||||||
#psmpi = callPackage ./pkgs/parastation/psmpi.nix { }; # Unmaintaned
|
#psmpi = callPackage ./pkgs/parastation/psmpi.nix { }; # Unmaintaned
|
||||||
slurm = import ./pkgs/slurm/default.nix { slurm = prev.slurm; };
|
|
||||||
sonar = callPackage ./pkgs/sonar/default.nix { };
|
sonar = callPackage ./pkgs/sonar/default.nix { };
|
||||||
stdenvClangOmpss2 = final.stdenv.override { cc = final.clangOmpss2; allowedRequisites = null; };
|
stdenvClangOmpss2 = final.stdenv.override { cc = final.clangOmpss2; allowedRequisites = null; };
|
||||||
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.clangOmpss2Nanos6; allowedRequisites = null; };
|
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.clangOmpss2Nanos6; allowedRequisites = null; };
|
||||||
@@ -64,12 +57,8 @@ let
|
|||||||
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
||||||
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
||||||
tampi = callPackage ./pkgs/tampi/default.nix { };
|
tampi = callPackage ./pkgs/tampi/default.nix { };
|
||||||
tasycl = callPackage ./pkgs/tasycl/default.nix { };
|
|
||||||
tasycl-acpp = callPackage ./pkgs/tasycl/default.nix { useIntel = false; };
|
|
||||||
upc-qaire-exporter = prev.callPackage ./pkgs/upc-qaire-exporter/default.nix { };
|
upc-qaire-exporter = prev.callPackage ./pkgs/upc-qaire-exporter/default.nix { };
|
||||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||||
|
|
||||||
gromacs = callPackage ./pkgs/gromacs/default.nix { enableSYCL = true; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tests = rec {
|
tests = rec {
|
||||||
@@ -77,8 +66,6 @@ let
|
|||||||
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
|
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
|
||||||
hello-c = callPackage ./test/compilers/hello-c.nix { };
|
hello-c = callPackage ./test/compilers/hello-c.nix { };
|
||||||
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
|
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
|
||||||
hello-sycl = callPackage ./test/compilers/hello-sycl.nix { };
|
|
||||||
hello-syclompss = callPackage ./test/compilers/icpx-ompss2.nix { };
|
|
||||||
lto = callPackage ./test/compilers/lto.nix { };
|
lto = callPackage ./test/compilers/lto.nix { };
|
||||||
asan = callPackage ./test/compilers/asan.nix { };
|
asan = callPackage ./test/compilers/asan.nix { };
|
||||||
intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; };
|
intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; };
|
||||||
@@ -88,13 +75,6 @@ let
|
|||||||
intel2023-ifort = callPackage ./test/compilers/hello-f.nix {
|
intel2023-ifort = callPackage ./test/compilers/hello-f.nix {
|
||||||
stdenv = final.intelPackages_2023.stdenv-ifort;
|
stdenv = final.intelPackages_2023.stdenv-ifort;
|
||||||
};
|
};
|
||||||
intel2024-icx-c = hello-c.override { stdenv = final.intelPackages_2024.stdenv; };
|
|
||||||
intel2025-icx-c = hello-c.override { stdenv = final.intelPackages_2025.stdenv; };
|
|
||||||
intel2024-icx-cpp = hello-cpp.override { stdenv = final.intelPackages_2024.stdenv; };
|
|
||||||
intel2025-icx-cpp = hello-cpp.override { stdenv = final.intelPackages_2025.stdenv; };
|
|
||||||
# intel2023-sycl = hello-sycl.override { intelPackages = final.intelPackages_2023; }; # broken
|
|
||||||
intel2024-sycl = hello-sycl.override { intelPackages = final.intelPackages_2024; };
|
|
||||||
intel2025-sycl = hello-sycl.override { intelPackages = final.intelPackages_2025; };
|
|
||||||
clangOmpss2-lto = lto.override { stdenv = final.stdenvClangOmpss2Nanos6; };
|
clangOmpss2-lto = lto.override { stdenv = final.stdenvClangOmpss2Nanos6; };
|
||||||
clangOmpss2-asan = asan.override { stdenv = final.stdenvClangOmpss2Nanos6; };
|
clangOmpss2-asan = asan.override { stdenv = final.stdenvClangOmpss2Nanos6; };
|
||||||
clangOmpss2-task = callPackage ./test/compilers/ompss2.nix {
|
clangOmpss2-task = callPackage ./test/compilers/ompss2.nix {
|
||||||
|
|||||||
@@ -1,212 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -Eeuo pipefail
|
|
||||||
|
|
||||||
PACKAGE="agenix"
|
|
||||||
|
|
||||||
function show_help () {
|
|
||||||
echo "$PACKAGE - edit and rekey age secret files"
|
|
||||||
echo " "
|
|
||||||
echo "$PACKAGE -e FILE [-i PRIVATE_KEY]"
|
|
||||||
echo "$PACKAGE -r [-i PRIVATE_KEY]"
|
|
||||||
echo ' '
|
|
||||||
echo 'options:'
|
|
||||||
echo '-h, --help show help'
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
echo '-e, --edit FILE edits FILE using $EDITOR'
|
|
||||||
echo '-r, --rekey re-encrypts all secrets with specified recipients'
|
|
||||||
echo '-d, --decrypt FILE decrypts FILE to STDOUT'
|
|
||||||
echo '-i, --identity identity to use when decrypting'
|
|
||||||
echo '-v, --verbose verbose output'
|
|
||||||
echo ' '
|
|
||||||
echo 'FILE an age-encrypted file'
|
|
||||||
echo ' '
|
|
||||||
echo 'PRIVATE_KEY a path to a private SSH key used to decrypt file'
|
|
||||||
echo ' '
|
|
||||||
echo 'EDITOR environment variable of editor to use when editing FILE'
|
|
||||||
echo ' '
|
|
||||||
echo 'If STDIN is not interactive, EDITOR will be set to "cp /dev/stdin"'
|
|
||||||
echo ' '
|
|
||||||
echo 'RULES environment variable with path to Nix file specifying recipient public keys.'
|
|
||||||
echo "Defaults to './secrets.nix'"
|
|
||||||
echo ' '
|
|
||||||
echo "agenix version: @version@"
|
|
||||||
echo "age binary path: @ageBin@"
|
|
||||||
echo "age version: $(@ageBin@ --version)"
|
|
||||||
}
|
|
||||||
|
|
||||||
function warn() {
|
|
||||||
printf '%s\n' "$*" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
function err() {
|
|
||||||
warn "$*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
test $# -eq 0 && (show_help && exit 1)
|
|
||||||
|
|
||||||
REKEY=0
|
|
||||||
DECRYPT_ONLY=0
|
|
||||||
DEFAULT_DECRYPT=(--decrypt)
|
|
||||||
|
|
||||||
while test $# -gt 0; do
|
|
||||||
case "$1" in
|
|
||||||
-h|--help)
|
|
||||||
show_help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-e|--edit)
|
|
||||||
shift
|
|
||||||
if test $# -gt 0; then
|
|
||||||
export FILE=$1
|
|
||||||
else
|
|
||||||
echo "no FILE specified"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-i|--identity)
|
|
||||||
shift
|
|
||||||
if test $# -gt 0; then
|
|
||||||
DEFAULT_DECRYPT+=(--identity "$1")
|
|
||||||
else
|
|
||||||
echo "no PRIVATE_KEY specified"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-r|--rekey)
|
|
||||||
shift
|
|
||||||
REKEY=1
|
|
||||||
;;
|
|
||||||
-d|--decrypt)
|
|
||||||
shift
|
|
||||||
DECRYPT_ONLY=1
|
|
||||||
if test $# -gt 0; then
|
|
||||||
export FILE=$1
|
|
||||||
else
|
|
||||||
echo "no FILE specified"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-v|--verbose)
|
|
||||||
shift
|
|
||||||
set -x
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
show_help
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
RULES=${RULES:-./secrets.nix}
|
|
||||||
function cleanup {
|
|
||||||
if [ -n "${CLEARTEXT_DIR+x}" ]
|
|
||||||
then
|
|
||||||
rm -rf -- "$CLEARTEXT_DIR"
|
|
||||||
fi
|
|
||||||
if [ -n "${REENCRYPTED_DIR+x}" ]
|
|
||||||
then
|
|
||||||
rm -rf -- "$REENCRYPTED_DIR"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
trap "cleanup" 0 2 3 15
|
|
||||||
|
|
||||||
function keys {
|
|
||||||
(@nixInstantiate@ --json --eval --strict -E "(let rules = import $RULES; in rules.\"$1\".publicKeys)" | @jqBin@ -r .[]) || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function armor {
|
|
||||||
(@nixInstantiate@ --json --eval --strict -E "(let rules = import $RULES; in (builtins.hasAttr \"armor\" rules.\"$1\" && rules.\"$1\".armor))") || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function decrypt {
|
|
||||||
FILE=$1
|
|
||||||
KEYS=$2
|
|
||||||
if [ -z "$KEYS" ]
|
|
||||||
then
|
|
||||||
err "There is no rule for $FILE in $RULES."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$FILE" ]
|
|
||||||
then
|
|
||||||
DECRYPT=("${DEFAULT_DECRYPT[@]}")
|
|
||||||
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
|
||||||
if [ -f "$HOME/.ssh/id_rsa" ]; then
|
|
||||||
DECRYPT+=(--identity "$HOME/.ssh/id_rsa")
|
|
||||||
fi
|
|
||||||
if [ -f "$HOME/.ssh/id_ed25519" ]; then
|
|
||||||
DECRYPT+=(--identity "$HOME/.ssh/id_ed25519")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${DECRYPT[*]}" != *"--identity"* ]]; then
|
|
||||||
err "No identity found to decrypt $FILE. Try adding an SSH key at $HOME/.ssh/id_rsa or $HOME/.ssh/id_ed25519 or using the --identity flag to specify a file."
|
|
||||||
fi
|
|
||||||
|
|
||||||
@ageBin@ "${DECRYPT[@]}" -- "$FILE" || exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function edit {
|
|
||||||
FILE=$1
|
|
||||||
KEYS=$(keys "$FILE") || exit 1
|
|
||||||
ARMOR=$(armor "$FILE") || exit 1
|
|
||||||
|
|
||||||
CLEARTEXT_DIR=$(@mktempBin@ -d)
|
|
||||||
CLEARTEXT_FILE="$CLEARTEXT_DIR/$(basename -- "$FILE")"
|
|
||||||
DEFAULT_DECRYPT+=(-o "$CLEARTEXT_FILE")
|
|
||||||
|
|
||||||
decrypt "$FILE" "$KEYS" || exit 1
|
|
||||||
|
|
||||||
[ ! -f "$CLEARTEXT_FILE" ] || cp -- "$CLEARTEXT_FILE" "$CLEARTEXT_FILE.before"
|
|
||||||
|
|
||||||
[ -t 0 ] || EDITOR='cp -- /dev/stdin'
|
|
||||||
|
|
||||||
$EDITOR "$CLEARTEXT_FILE"
|
|
||||||
|
|
||||||
if [ ! -f "$CLEARTEXT_FILE" ]
|
|
||||||
then
|
|
||||||
warn "$FILE wasn't created."
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
[ -f "$FILE" ] && [ "$EDITOR" != ":" ] && @diffBin@ -q -- "$CLEARTEXT_FILE.before" "$CLEARTEXT_FILE" && warn "$FILE wasn't changed, skipping re-encryption." && return
|
|
||||||
|
|
||||||
ENCRYPT=()
|
|
||||||
if [[ "$ARMOR" == "true" ]]; then
|
|
||||||
ENCRYPT+=(--armor)
|
|
||||||
fi
|
|
||||||
while IFS= read -r key
|
|
||||||
do
|
|
||||||
if [ -n "$key" ]; then
|
|
||||||
ENCRYPT+=(--recipient "$key")
|
|
||||||
fi
|
|
||||||
done <<< "$KEYS"
|
|
||||||
|
|
||||||
REENCRYPTED_DIR=$(@mktempBin@ -d)
|
|
||||||
REENCRYPTED_FILE="$REENCRYPTED_DIR/$(basename -- "$FILE")"
|
|
||||||
|
|
||||||
ENCRYPT+=(-o "$REENCRYPTED_FILE")
|
|
||||||
|
|
||||||
@ageBin@ "${ENCRYPT[@]}" <"$CLEARTEXT_FILE" || exit 1
|
|
||||||
|
|
||||||
mkdir -p -- "$(dirname -- "$FILE")"
|
|
||||||
|
|
||||||
mv -f -- "$REENCRYPTED_FILE" "$FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
function rekey {
|
|
||||||
FILES=$( (@nixInstantiate@ --json --eval -E "(let rules = import $RULES; in builtins.attrNames rules)" | @jqBin@ -r .[]) || exit 1)
|
|
||||||
|
|
||||||
for FILE in $FILES
|
|
||||||
do
|
|
||||||
warn "rekeying $FILE..."
|
|
||||||
EDITOR=: edit "$FILE"
|
|
||||||
cleanup
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
[ $REKEY -eq 1 ] && rekey && exit 0
|
|
||||||
[ $DECRYPT_ONLY -eq 1 ] && DEFAULT_DECRYPT+=("-o" "-") && decrypt "${FILE}" "$(keys "$FILE")" && exit 0
|
|
||||||
edit "$FILE" && cleanup && exit 0
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
age,
|
|
||||||
jq,
|
|
||||||
nix,
|
|
||||||
mktemp,
|
|
||||||
diffutils,
|
|
||||||
replaceVars,
|
|
||||||
ageBin ? "${age}/bin/age",
|
|
||||||
shellcheck,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
bin = "${placeholder "out"}/bin/agenix";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "agenix";
|
|
||||||
version = "0.15.0";
|
|
||||||
src = replaceVars ./agenix.sh {
|
|
||||||
inherit ageBin version;
|
|
||||||
jqBin = "${jq}/bin/jq";
|
|
||||||
nixInstantiate = "${nix}/bin/nix-instantiate";
|
|
||||||
mktempBin = "${mktemp}/bin/mktemp";
|
|
||||||
diffBin = "${diffutils}/bin/diff";
|
|
||||||
};
|
|
||||||
dontUnpack = true;
|
|
||||||
doInstallCheck = true;
|
|
||||||
installCheckInputs = [ shellcheck ];
|
|
||||||
postInstallCheck = ''
|
|
||||||
shellcheck ${bin}
|
|
||||||
${bin} -h | grep ${version}
|
|
||||||
|
|
||||||
test_tmp=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
|
|
||||||
export HOME="$test_tmp/home"
|
|
||||||
export NIX_STORE_DIR="$test_tmp/nix/store"
|
|
||||||
export NIX_STATE_DIR="$test_tmp/nix/var"
|
|
||||||
mkdir -p "$HOME" "$NIX_STORE_DIR" "$NIX_STATE_DIR"
|
|
||||||
function cleanup {
|
|
||||||
rm -rf "$test_tmp"
|
|
||||||
}
|
|
||||||
trap "cleanup" 0 2 3 15
|
|
||||||
|
|
||||||
mkdir -p $HOME/.ssh
|
|
||||||
cp -r "${./example}" $HOME/secrets
|
|
||||||
chmod -R u+rw $HOME/secrets
|
|
||||||
(
|
|
||||||
umask u=rw,g=r,o=r
|
|
||||||
cp ${./example_keys/user1.pub} $HOME/.ssh/id_ed25519.pub
|
|
||||||
chown $UID $HOME/.ssh/id_ed25519.pub
|
|
||||||
)
|
|
||||||
(
|
|
||||||
umask u=rw,g=,o=
|
|
||||||
cp ${./example_keys/user1} $HOME/.ssh/id_ed25519
|
|
||||||
chown $UID $HOME/.ssh/id_ed25519
|
|
||||||
)
|
|
||||||
|
|
||||||
cd $HOME/secrets
|
|
||||||
test $(${bin} -d secret1.age) = "hello"
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
install -D $src ${bin}
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta.description = "age-encrypted secrets for NixOS";
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 V3XmEA zirqdzZZ1E+sedBn7fbEHq4ntLEkokZ4GctarBBOHXY
|
|
||||||
Rvs5YHaAUeCZyNwPedubPcHClWYIuXXWA5zadXPWY6w
|
|
||||||
-> ssh-ed25519 KLPP8w BVp4rDkOYSQyn8oVeHFeinSqW+pdVtxBF9+5VM1yORY
|
|
||||||
bMwppAi8Nhz0328taU4AzUkTVyWtSLvFZG6c5W/Fs78
|
|
||||||
--- xCbqLhXAcOziO2wmbjTiSQfZvt5Rlsc4SCvF+iEzpQA
|
|
||||||
<EFBFBD>KB<EFBFBD><EFBFBD>/<2F>Z<><5A>r<EFBFBD>%<01><>4<EFBFBD><34><EFBFBD>Mq5<71><35>_<EFBFBD><5F>ݒ<><DD92><EFBFBD><EFBFBD><EFBFBD>11ܨqM;& <20><>Lr<4C><72><EFBFBD>f<EFBFBD><66><EFBFBD>]>N
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFYzWG1FQSBpZkZW
|
|
||||||
aFpLNnJxc0VUMHRmZ2dZS0pjMGVENnR3OHd5K0RiT1RjRUhibFZBCnN5UG5vUjA3
|
|
||||||
SXpsNGtiVUw4T0tIVFo5Wkk5QS9NQlBndzVvektiQ0ozc0kKLS0tIGxyY1Q4dEZ1
|
|
||||||
VGZEanJyTFNta2JNRmpZb2FnK2JyS1hSVml1UGdMNWZKQXMKYla+wTXcRedyZoEb
|
|
||||||
LVWaSx49WoUTU0KBPJg9RArxaeC23GoCDzR/aM/1DvYU
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 KLPP8w s1DYZRlZuSsyhmZCF1lFB+E9vB8bZ/+ZhBRlx8nprwE
|
|
||||||
nmYVCsVBrX2CFXXPU+D+bbkkIe/foofp+xoUrg9DHZw
|
|
||||||
-> ssh-ed25519 V3XmEA Pwv3oCwcY0DX8rY48UNfsj9RumWsn4dbgorYHCwObgI
|
|
||||||
FKxRYkL3JHtJxUwymWDF0rAtJ33BivDI6IfPsfumM90
|
|
||||||
-> V'v(/u$-grease em/Vgf 2qDuk
|
|
||||||
7I3iiQLPGi1COML9u/JeYkr7EqbSLoU
|
|
||||||
--- 57WJRigUGtmcObrssS3s4PvmR8wgh1AOC/ijJn1s3xI
|
|
||||||
<EFBFBD>'K<>ƷY&<26>7G<37>O<EFBFBD><4F>Fj<13>k<EFBFBD>X<EFBFBD><58>BnuJ<75><4A>:9<>(<><7F><EFBFBD>X<EFBFBD>#<23>A<EFBFBD><41><EFBFBD><EFBFBD>ڧj<DAA7>,<02>_<17><><EFBFBD>?<3F>Z<EFBFBD><17>v<EFBFBD><76>V<EFBFBD>96]oks~%<25>c <04>e^C<>%JQ5<51><H<>z}<7D>C<EFBFBD>,<2C>p<EFBFBD><70>*!W<><57><EFBFBD>A<EFBFBD><41><EFBFBD>҅dC<15>K)<10><>-<2D>y
|
|
||||||
Binary file not shown.
@@ -1,5 +0,0 @@
|
|||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 V3XmEA OB4+1FbPhQ3r6iGksM7peWX5it8NClpXIq/o5nnP7GA
|
|
||||||
FmHVUj+A5i5+bDFgySQskmlvynnosJiWUTJmBRiNA9I
|
|
||||||
--- tP+3mFVtd7ogVu1Lkboh55zoi5a77Ht08Uc/QuIviv4
|
|
||||||
<EFBFBD><EFBFBD>X<EFBFBD>{<7B><>O<EFBFBD><4F><1F><04>tMXx<58>vӪ(<28>I<EFBFBD>myP<79><50><EFBFBD><EFBFBD>+3<>S3i
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
let
|
|
||||||
user1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH";
|
|
||||||
system1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPJDyIr/FSz1cJdcoW69R+NrWzwGK/+3gJpqD1t8L2zE";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
"secret1.age".publicKeys = [
|
|
||||||
user1
|
|
||||||
system1
|
|
||||||
];
|
|
||||||
"secret2.age".publicKeys = [ user1 ];
|
|
||||||
"passwordfile-user1.age".publicKeys = [
|
|
||||||
user1
|
|
||||||
system1
|
|
||||||
];
|
|
||||||
"-leading-hyphen-filename.age".publicKeys = [
|
|
||||||
user1
|
|
||||||
system1
|
|
||||||
];
|
|
||||||
"armored-secret.age" = {
|
|
||||||
publicKeys = [ user1 ];
|
|
||||||
armor = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
|
||||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|
||||||
QyNTUxOQAAACDyQ8iK/xUs9XCXXKFuvUfja1s8Biv/t4Caag9bfC9sxAAAAJA3yvCWN8rw
|
|
||||||
lgAAAAtzc2gtZWQyNTUxOQAAACDyQ8iK/xUs9XCXXKFuvUfja1s8Biv/t4Caag9bfC9sxA
|
|
||||||
AAAEA+J2V6AG1NriAIvnNKRauIEh1JE9HSdhvKJ68a5Fm0w/JDyIr/FSz1cJdcoW69R+Nr
|
|
||||||
WzwGK/+3gJpqD1t8L2zEAAAADHJ5YW50bUBob21lMQE=
|
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPJDyIr/FSz1cJdcoW69R+NrWzwGK/+3gJpqD1t8L2zE
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
|
||||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|
||||||
QyNTUxOQAAACC9InTb4BornFoLqf5j+/M8gtt7hY2KtHr3FnYxkFGgRwAAAJC2JJ8htiSf
|
|
||||||
IQAAAAtzc2gtZWQyNTUxOQAAACC9InTb4BornFoLqf5j+/M8gtt7hY2KtHr3FnYxkFGgRw
|
|
||||||
AAAEDxt5gC/s53IxiKAjfZJVCCcFIsdeERdIgbYhLO719+Kb0idNvgGiucWgup/mP78zyC
|
|
||||||
23uFjYq0evcWdjGQUaBHAAAADHJ5YW50bUBob21lMQE=
|
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL0idNvgGiucWgup/mP78zyC23uFjYq0evcWdjGQUaBH
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# All operations are done relative to root
|
|
||||||
GITROOT=$(git rev-parse --show-toplevel)
|
|
||||||
cd "$GITROOT"
|
|
||||||
|
|
||||||
REVISION=${1:-main}
|
|
||||||
|
|
||||||
TMPCLONE=$(mktemp -d)
|
|
||||||
trap "rm -rf ${TMPCLONE}" EXIT
|
|
||||||
|
|
||||||
git clone https://github.com/ryantm/agenix.git --revision="$REVISION" "$TMPCLONE" --depth=1
|
|
||||||
|
|
||||||
cp "${TMPCLONE}/pkgs/agenix.sh" pkgs/agenix/agenix.sh
|
|
||||||
cp "${TMPCLONE}/pkgs/agenix.nix" pkgs/agenix/default.nix
|
|
||||||
sed -i 's#../example#./example#' pkgs/agenix/default.nix
|
|
||||||
|
|
||||||
cp "${TMPCLONE}/example/"* pkgs/agenix/example/
|
|
||||||
cp "${TMPCLONE}/example_keys/"* pkgs/agenix/example_keys/
|
|
||||||
|
|
||||||
cp "${TMPCLONE}/modules/age.nix" m/module/agenix.nix
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, pkg-config, glib, libuuid, popt, elfutils, swig4, python3 }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "babeltrace-1.5.8";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://www.efficios.com/files/babeltrace/${name}.tar.bz2";
|
|
||||||
sha256 = "1hkg3phnamxfrhwzmiiirbhdgckzfkqwhajl0lmr1wfps7j47wcz";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ glib libuuid popt elfutils swig4 python3 ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Command-line tool and library to read and convert LTTng tracefiles";
|
|
||||||
homepage = "https://www.efficios.com/babeltrace";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = [ maintainers.bjornfor ];
|
|
||||||
};
|
|
||||||
|
|
||||||
configureFlags = [
|
|
||||||
"--enable-python-bindings"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, fetchurl
|
|
||||||
, pkg-config
|
|
||||||
, glib
|
|
||||||
, libuuid
|
|
||||||
, popt
|
|
||||||
, elfutils
|
|
||||||
, python3
|
|
||||||
, swig4
|
|
||||||
, ncurses
|
|
||||||
, breakpointHook
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "babeltrace2";
|
|
||||||
version = "2.0.3";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://www.efficios.com/files/babeltrace/${pname}-${version}.tar.bz2";
|
|
||||||
sha256 = "1804pyq7fz6rkcz4r1abkkn0pfnss13m6fd8if32s42l4lajadm5";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [ glib libuuid popt elfutils python3 swig4 ncurses breakpointHook ];
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
|
|
||||||
configureFlags = [
|
|
||||||
"--enable-python-plugins"
|
|
||||||
"--enable-python-bindings"
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, fetchFromGitHub
|
|
||||||
, libcap
|
|
||||||
, libcgroup
|
|
||||||
, libmhash
|
|
||||||
, doxygen
|
|
||||||
, graphviz
|
|
||||||
, autoreconfHook
|
|
||||||
, pkg-config
|
|
||||||
, glib
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "0.4.4";
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
pname = "clsync";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
repo = "clsync";
|
|
||||||
owner = "clsync";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "0sdiyfwp0iqr6l1sirm51pirzmhi4jzgky5pzfj24nn71q3fwqgz";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
autoreconfHook
|
|
||||||
libcap
|
|
||||||
libcgroup
|
|
||||||
libmhash
|
|
||||||
doxygen
|
|
||||||
graphviz
|
|
||||||
pkg-config
|
|
||||||
glib
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
./configure --help
|
|
||||||
'';
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "File live sync daemon based on inotify/kqueue/bsm (Linux, FreeBSD), written in GNU C";
|
|
||||||
homepage = "https://github.com/clsync/clsync";
|
|
||||||
license = licenses.gpl3Plus;
|
|
||||||
maintainers = [ ];
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, lib
|
|
||||||
, babeltrace2
|
|
||||||
, pkg-config
|
|
||||||
, uthash
|
|
||||||
, enableTest ? false
|
|
||||||
, mpi ? null
|
|
||||||
, clangOmpss2 ? null
|
|
||||||
, tampi ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
assert (enableTest -> (mpi != null));
|
|
||||||
assert (enableTest -> (clangOmpss2 != null));
|
|
||||||
assert (enableTest -> (tampi != null));
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "cn6";
|
|
||||||
version = "${src.shortRev}";
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
babeltrace2
|
|
||||||
pkg-config
|
|
||||||
uthash
|
|
||||||
mpi
|
|
||||||
] ++ optionals (enableTest) [ mpi clangOmpss2 tampi ];
|
|
||||||
|
|
||||||
src = builtins.fetchGit {
|
|
||||||
url = "ssh://git@bscpm04.bsc.es/rarias/cn6.git";
|
|
||||||
ref = "master";
|
|
||||||
rev = "c72c3b66b720c2a33950f536fc819051c8f20a69";
|
|
||||||
};
|
|
||||||
|
|
||||||
makeFlags = [ "PREFIX=$(out)" ];
|
|
||||||
|
|
||||||
postBuild = optionalString (enableTest) ''
|
|
||||||
(
|
|
||||||
cd test
|
|
||||||
make timediff timediff_mpi
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = optionalString (enableTest) ''
|
|
||||||
(
|
|
||||||
cd test
|
|
||||||
cp timediff timediff_mpi sync-err.sh $out/bin/
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, perl # For the pod2man command
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
version = "20201006";
|
|
||||||
pname = "cpuid";
|
|
||||||
|
|
||||||
buildInputs = [ perl ];
|
|
||||||
|
|
||||||
# Replace /usr install directory for $out
|
|
||||||
postPatch = ''
|
|
||||||
sed -i "s@/usr@$out@g" Makefile
|
|
||||||
'';
|
|
||||||
|
|
||||||
src = builtins.fetchTarball {
|
|
||||||
url = "http://www.etallen.com/cpuid/${pname}-${version}.src.tar.gz";
|
|
||||||
sha256 = "04qhs938gs1kjxpsrnfy6lbsircsprfyh4db62s5cf83a1nrwn9w";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "dummy";
|
|
||||||
|
|
||||||
src = null;
|
|
||||||
dontUnpack = true;
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
programPath = "/bin/dummy";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
|
|
||||||
cat > $out/bin/dummy <<EOF
|
|
||||||
#!/bin/sh
|
|
||||||
echo Hello worlda!
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod +x $out/bin/dummy
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
{ fetchurl, stdenv, lib, llvmPackages ? null, precision ? "double", perl, mpi }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
assert stdenv.cc.isClang -> llvmPackages != null;
|
|
||||||
assert elem precision [ "single" "double" "long-double" "quad-precision" ];
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "3.3.8";
|
|
||||||
withDoc = stdenv.cc.isGNU;
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "fftw-${precision}-${version}";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
urls = [
|
|
||||||
"http://fftw.org/fftw-${version}.tar.gz"
|
|
||||||
"ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz"
|
|
||||||
];
|
|
||||||
sha256 = "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = [ "out" "dev" "man" ]
|
|
||||||
++ optional withDoc "info"; # it's dev-doc only
|
|
||||||
outputBin = "dev"; # fftw-wisdom
|
|
||||||
|
|
||||||
buildInputs = [ mpi ]
|
|
||||||
++ lib.optionals stdenv.cc.isClang [
|
|
||||||
# TODO: This may mismatch the LLVM version sin the stdenv, see #79818.
|
|
||||||
llvmPackages.openmp
|
|
||||||
];
|
|
||||||
|
|
||||||
configureFlags =
|
|
||||||
[ "--enable-shared"
|
|
||||||
"--enable-threads"
|
|
||||||
"--enable-mpi"
|
|
||||||
"--disable-openmp"
|
|
||||||
]
|
|
||||||
++ optional (precision != "double") "--enable-${precision}"
|
|
||||||
# all x86_64 have sse2
|
|
||||||
# however, not all float sizes fit
|
|
||||||
++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2"
|
|
||||||
# doc generation causes Fortran wrapper generation which hard-codes gcc
|
|
||||||
++ optional (!withDoc) "--disable-doc";
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
checkInputs = [ perl ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Fastest Fourier Transform in the West library";
|
|
||||||
homepage = "http://www.fftw.org/";
|
|
||||||
license = licenses.gpl2Plus;
|
|
||||||
maintainers = [ maintainers.spwhitt ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
From 1454525f70b43a6957b7c9e1870e997368787da3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
|
|
||||||
Date: Fri, 8 Nov 2019 21:59:21 -0500
|
|
||||||
Subject: [PATCH] Fix cross-compilation by looking for `ar`.
|
|
||||||
|
|
||||||
---
|
|
||||||
Makefile.am | 2 +-
|
|
||||||
configure.ac | 2 ++
|
|
||||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/Makefile.am b/Makefile.am
|
|
||||||
index d18c49b8..b1b53338 100644
|
|
||||||
--- a/Makefile.am
|
|
||||||
+++ b/Makefile.am
|
|
||||||
@@ -494,7 +494,7 @@ CCC=@CXX@
|
|
||||||
# INSTALL_INFO
|
|
||||||
# LN_S
|
|
||||||
|
|
||||||
-AR=ar
|
|
||||||
+AR=@AR@
|
|
||||||
ETAGS=etags
|
|
||||||
ETAGSFLAGS=
|
|
||||||
# Flag that tells etags to assume C++.
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 28e75f17..2449b9f5 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -37,6 +37,7 @@ AC_CONFIG_AUX_DIR([build-aux])
|
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
|
|
||||||
AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
|
|
||||||
+AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
|
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
|
||||||
|
|
||||||
@@ -72,6 +73,7 @@ GROFF_DOC_CHECK
|
|
||||||
GROFF_MAKEINFO
|
|
||||||
GROFF_TEXI2DVI
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
+AC_CHECK_TOOL([AR], [ar], [ar])
|
|
||||||
GROFF_INSTALL_SH
|
|
||||||
GROFF_INSTALL_INFO
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, perl
|
|
||||||
, ghostscript #for postscript and html output
|
|
||||||
, psutils, netpbm #for html output
|
|
||||||
, buildPackages
|
|
||||||
, autoreconfHook
|
|
||||||
, pkg-config
|
|
||||||
, texinfo
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "groff";
|
|
||||||
version = "1.22.4";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "mirror://gnu/groff/${pname}-${version}.tar.gz";
|
|
||||||
sha256 = "14q2mldnr1vx0l9lqp9v2f6iww24gj28iyh4j2211hyynx67p3p7";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableParallelBuilding = false;
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./0001-Fix-cross-compilation-by-looking-for-ar.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = lib.optionalString (psutils != null) ''
|
|
||||||
substituteInPlace src/preproc/html/pre-html.cpp \
|
|
||||||
--replace "psselect" "${psutils}/bin/psselect"
|
|
||||||
'' + lib.optionalString (netpbm != null) ''
|
|
||||||
substituteInPlace src/preproc/html/pre-html.cpp \
|
|
||||||
--replace "pnmcut" "${lib.getBin netpbm}/bin/pnmcut" \
|
|
||||||
--replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \
|
|
||||||
--replace "pnmtopng" "${lib.getBin netpbm}/bin/pnmtopng"
|
|
||||||
substituteInPlace tmac/www.tmac.in \
|
|
||||||
--replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \
|
|
||||||
--replace "pngtopnm" "${lib.getBin netpbm}/bin/pngtopnm" \
|
|
||||||
--replace "@PNMTOPS_NOSETPAGE@" "${lib.getBin netpbm}/bin/pnmtops -nosetpage"
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = [ ghostscript psutils netpbm perl ];
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkg-config texinfo ];
|
|
||||||
|
|
||||||
# Builds running without a chroot environment may detect the presence
|
|
||||||
# of /usr/X11 in the host system, leading to an impure build of the
|
|
||||||
# package. To avoid this issue, X11 support is explicitly disabled.
|
|
||||||
# Note: If we ever want to *enable* X11 support, then we'll probably
|
|
||||||
# have to pass "--with-appresdir", too.
|
|
||||||
configureFlags = [
|
|
||||||
"--without-x"
|
|
||||||
] ++ lib.optionals (ghostscript != null) [
|
|
||||||
"--with-gs=${ghostscript}/bin/gs"
|
|
||||||
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
||||||
"ac_cv_path_PERL=${buildPackages.perl}/bin/perl"
|
|
||||||
];
|
|
||||||
|
|
||||||
makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
||||||
# Trick to get the build system find the proper 'native' groff
|
|
||||||
# http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
|
|
||||||
"GROFF_BIN_PATH=${buildPackages.groff}/bin"
|
|
||||||
"GROFFBIN=${buildPackages.groff}/bin/groff"
|
|
||||||
];
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
for f in 'man.local' 'mdoc.local'; do
|
|
||||||
cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f"
|
|
||||||
done
|
|
||||||
|
|
||||||
moveToOutput bin/gropdf $out
|
|
||||||
moveToOutput bin/pdfmom $out
|
|
||||||
moveToOutput bin/roff2text $out
|
|
||||||
moveToOutput bin/roff2pdf $out
|
|
||||||
moveToOutput bin/roff2ps $out
|
|
||||||
moveToOutput bin/roff2dvi $out
|
|
||||||
moveToOutput bin/roff2ps $out
|
|
||||||
moveToOutput bin/roff2html $out
|
|
||||||
moveToOutput bin/glilypond $out
|
|
||||||
moveToOutput bin/mmroff $out
|
|
||||||
moveToOutput bin/roff2x $out
|
|
||||||
moveToOutput bin/afmtodit $out
|
|
||||||
moveToOutput bin/gperl $out
|
|
||||||
moveToOutput bin/chem $out
|
|
||||||
moveToOutput share/groff/${version}/font/devpdf $out
|
|
||||||
|
|
||||||
# idk if this is needed, but Fedora does it
|
|
||||||
moveToOutput share/groff/${version}/tmac/pdf.tmac $out
|
|
||||||
|
|
||||||
moveToOutput bin/gpinyin $out
|
|
||||||
moveToOutput lib/groff/gpinyin $out
|
|
||||||
substituteInPlace $out/bin/gpinyin \
|
|
||||||
--replace $out/lib/groff/gpinyin $out/lib/groff/gpinyin
|
|
||||||
|
|
||||||
moveToOutput bin/groffer $out
|
|
||||||
moveToOutput lib/groff/groffer $out
|
|
||||||
substituteInPlace $out/bin/groffer \
|
|
||||||
--replace $out/lib/groff/groffer $out/lib/groff/groffer
|
|
||||||
|
|
||||||
moveToOutput bin/grog $out
|
|
||||||
moveToOutput lib/groff/grog $out
|
|
||||||
substituteInPlace $out/bin/grog \
|
|
||||||
--replace $out/lib/groff/grog $out/lib/groff/grog
|
|
||||||
|
|
||||||
'' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
|
||||||
find $out/ -type f -print0 | xargs --null sed -i 's|${buildPackages.perl}|${perl}|'
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://www.gnu.org/software/groff/";
|
|
||||||
description = "GNU Troff, a typesetting package that reads plain text and produces formatted output";
|
|
||||||
license = licenses.gpl3Plus;
|
|
||||||
platforms = platforms.all;
|
|
||||||
maintainers = with maintainers; [ pSub ];
|
|
||||||
|
|
||||||
longDescription = ''
|
|
||||||
groff is the GNU implementation of troff, a document formatting
|
|
||||||
system. Included in this release are implementations of troff,
|
|
||||||
pic, eqn, tbl, grn, refer, -man, -mdoc, -mom, and -ms macros,
|
|
||||||
and drivers for PostScript, TeX dvi format, HP LaserJet 4
|
|
||||||
printers, Canon CAPSL printers, HTML and XHTML format (beta
|
|
||||||
status), and typewriter-like devices. Also included is a
|
|
||||||
modified version of the Berkeley -me macros, the enhanced
|
|
||||||
version gxditview of the X11 xditview previewer, and an
|
|
||||||
implementation of the -mm macros.
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
.
|
|
||||||
.if n \{\
|
|
||||||
. \" Character translations for non-keyboard
|
|
||||||
. \" characters - to make them searchable
|
|
||||||
. if '\*[.T]'utf8' \{\
|
|
||||||
. char \- \N'45'
|
|
||||||
. char - \N'45'
|
|
||||||
. char ' \N'39'
|
|
||||||
. char \' \N'39'
|
|
||||||
. \}
|
|
||||||
.
|
|
||||||
. \" Shut off SGR by default (groff colors)
|
|
||||||
. \" Require GROFF_SGR envvar defined to turn it on
|
|
||||||
. if '\V[GROFF_SGR]'' \
|
|
||||||
. output x X tty: sgr 0
|
|
||||||
.\}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
fetchurl,
|
|
||||||
cmake,
|
|
||||||
hwloc,
|
|
||||||
fftw,
|
|
||||||
perl,
|
|
||||||
blas,
|
|
||||||
lapack,
|
|
||||||
llvmPackages,
|
|
||||||
intelPackages ? null,
|
|
||||||
mpi,
|
|
||||||
cudaPackages,
|
|
||||||
plumed,
|
|
||||||
singlePrec ? true,
|
|
||||||
config,
|
|
||||||
enableSYCL ? false,
|
|
||||||
enableCuda ? config.cudaSupport,
|
|
||||||
enableMpi ? false,
|
|
||||||
enablePlumed ? false,
|
|
||||||
cpuAcceleration ? null,
|
|
||||||
}:
|
|
||||||
|
|
||||||
# CUDA is only implemented for single precission
|
|
||||||
assert enableCuda -> singlePrec;
|
|
||||||
|
|
||||||
assert !(enableSYCL && enableCuda);
|
|
||||||
|
|
||||||
assert enableSYCL -> intelPackages != null;
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (cudaPackages.flags) cmakeCudaArchitecturesString;
|
|
||||||
|
|
||||||
# Select reasonable defaults for all major platforms
|
|
||||||
# The possible values are defined in CMakeLists.txt:
|
|
||||||
# AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256
|
|
||||||
# AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD
|
|
||||||
SIMD =
|
|
||||||
x:
|
|
||||||
if (cpuAcceleration != null) then
|
|
||||||
x
|
|
||||||
else if stdenv.hostPlatform.system == "i686-linux" then
|
|
||||||
"SSE2"
|
|
||||||
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
||||||
"SSE4.1"
|
|
||||||
else if stdenv.hostPlatform.system == "x86_64-darwin" then
|
|
||||||
"SSE4.1"
|
|
||||||
else if stdenv.hostPlatform.system == "aarch64-linux" then
|
|
||||||
"ARM_NEON_ASIMD"
|
|
||||||
else
|
|
||||||
"None";
|
|
||||||
|
|
||||||
source =
|
|
||||||
if enablePlumed then
|
|
||||||
{
|
|
||||||
version = "2024.2";
|
|
||||||
hash = "sha256-gCp+M18uiVdw9XsVnk7DaOuw/yzm2sz3BsboAlw2hSs=";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
version = "2025.3";
|
|
||||||
hash = "sha256-i9/KAmjz8Qp8o8BuWbYvc+oCQgxnIRwP85EvMteDPGU=";
|
|
||||||
};
|
|
||||||
|
|
||||||
stdenv' =
|
|
||||||
if enableSYCL then intelPackages.stdenv else stdenv;
|
|
||||||
|
|
||||||
in
|
|
||||||
stdenv'.mkDerivation rec {
|
|
||||||
pname = "gromacs";
|
|
||||||
version = source.version;
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-${version}.tar.gz";
|
|
||||||
inherit (source) hash;
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [ (if enablePlumed then ./pkgconfig-2024.patch else ./pkgconfig-2025.patch) ];
|
|
||||||
|
|
||||||
postPatch = lib.optionalString enablePlumed ''
|
|
||||||
plumed patch -p -e gromacs-${source.version}
|
|
||||||
'';
|
|
||||||
|
|
||||||
outputs = [
|
|
||||||
"out"
|
|
||||||
"dev"
|
|
||||||
"man"
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cmake
|
|
||||||
]
|
|
||||||
++ lib.optional enablePlumed plumed
|
|
||||||
++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
|
|
||||||
|
|
||||||
env.MKLROOT = intelPackages.mkl;
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
fftw
|
|
||||||
perl
|
|
||||||
hwloc
|
|
||||||
blas
|
|
||||||
lapack
|
|
||||||
]
|
|
||||||
++ lib.optional enableMpi mpi
|
|
||||||
++ lib.optionals enableCuda [
|
|
||||||
cudaPackages.cuda_cccl
|
|
||||||
cudaPackages.cuda_cudart
|
|
||||||
cudaPackages.libcufft
|
|
||||||
cudaPackages.cuda_profiler_api
|
|
||||||
]
|
|
||||||
++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
|
|
||||||
|
|
||||||
propagatedBuildInputs = lib.optional enableMpi mpi;
|
|
||||||
propagatedUserEnvPkgs = lib.optional enableMpi mpi;
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
(lib.cmakeBool "GMX_HWLOC" true)
|
|
||||||
"-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
|
|
||||||
"-DGMX_OPENMP:BOOL=TRUE"
|
|
||||||
"-DBUILD_SHARED_LIBS=ON"
|
|
||||||
]
|
|
||||||
++ (
|
|
||||||
if singlePrec then
|
|
||||||
[
|
|
||||||
"-DGMX_DOUBLE=OFF"
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[
|
|
||||||
"-DGMX_DOUBLE=ON"
|
|
||||||
"-DGMX_DEFAULT_SUFFIX=OFF"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
++ (
|
|
||||||
if enableMpi then
|
|
||||||
[
|
|
||||||
"-DGMX_MPI:BOOL=TRUE"
|
|
||||||
"-DGMX_THREAD_MPI:BOOL=FALSE"
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[
|
|
||||||
"-DGMX_MPI:BOOL=FALSE"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
++ (lib.optionals enableSYCL [
|
|
||||||
"-DGMX_GPU=SYCL"
|
|
||||||
"-DGMX_OPENMP=OFF" # TODO: enable OpenMP with SYCL?
|
|
||||||
])
|
|
||||||
++ lib.optionals enableCuda [
|
|
||||||
"-DGMX_GPU=CUDA"
|
|
||||||
(lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cmakeCudaArchitecturesString)
|
|
||||||
|
|
||||||
# Gromacs seems to ignore and override the normal variables, so we add this ad hoc:
|
|
||||||
(lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" cmakeCudaArchitecturesString)
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
moveToOutput share/cmake $dev
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://www.gromacs.org";
|
|
||||||
license = licenses.lgpl21Plus;
|
|
||||||
description = "Molecular dynamics software package";
|
|
||||||
longDescription = ''
|
|
||||||
GROMACS is a versatile package to perform molecular dynamics,
|
|
||||||
i.e. simulate the Newtonian equations of motion for systems
|
|
||||||
with hundreds to millions of particles.
|
|
||||||
|
|
||||||
It is primarily designed for biochemical molecules like
|
|
||||||
proteins, lipids and nucleic acids that have a lot of
|
|
||||||
complicated bonded interactions, but since GROMACS is
|
|
||||||
extremely fast at calculating the nonbonded interactions (that
|
|
||||||
usually dominate simulations) many groups are also using it
|
|
||||||
for research on non-biological systems, e.g. polymers.
|
|
||||||
|
|
||||||
GROMACS supports all the usual algorithms you expect from a
|
|
||||||
modern molecular dynamics implementation, (check the online
|
|
||||||
reference or manual for details), but there are also quite a
|
|
||||||
few features that make it stand out from the competition.
|
|
||||||
|
|
||||||
See: https://www.gromacs.org/about.html for details.
|
|
||||||
'';
|
|
||||||
platforms = platforms.unix;
|
|
||||||
maintainers = with maintainers; [
|
|
||||||
sheepforce
|
|
||||||
markuskowa
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
diff --git a/src/external/muparser/muparser.pc.in b/src/external/muparser/muparser.pc.in
|
|
||||||
index 646787cb53..9b97ad57f7 100644
|
|
||||||
--- a/src/external/muparser/muparser.pc.in
|
|
||||||
+++ b/src/external/muparser/muparser.pc.in
|
|
||||||
@@ -1,7 +1,5 @@
|
|
||||||
-prefix=@CMAKE_INSTALL_PREFIX@
|
|
||||||
-exec_prefix=${prefix}
|
|
||||||
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
|
||||||
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
|
||||||
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
|
||||||
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
||||||
|
|
||||||
Name: @PACKAGE_NAME@
|
|
||||||
Description: Mathematical expressions parser library
|
|
||||||
diff --git a/src/gromacs/libgromacs.pc.cmakein b/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
index ec1ed6684e..ca1105474a 100644
|
|
||||||
--- a/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
+++ b/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
|
|
||||||
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
|
||||||
|
|
||||||
Name: libgromacs@GMX_LIBS_SUFFIX@
|
|
||||||
Description: Gromacs library
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
diff --git a/src/external/muparser/muparser.pc.in b/src/external/muparser/muparser.pc.in
|
|
||||||
index 646787cb53..d26e84de8f 100644
|
|
||||||
--- a/src/external/muparser/muparser.pc.in
|
|
||||||
+++ b/src/external/muparser/muparser.pc.in
|
|
||||||
@@ -1,11 +1,9 @@
|
|
||||||
-prefix=@CMAKE_INSTALL_PREFIX@
|
|
||||||
-exec_prefix=${prefix}
|
|
||||||
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
|
||||||
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
|
||||||
-
|
|
||||||
-Name: @PACKAGE_NAME@
|
|
||||||
-Description: Mathematical expressions parser library
|
|
||||||
-Version: @MUPARSER_VERSION@
|
|
||||||
-Requires:
|
|
||||||
-Libs: -L${libdir} -lmuparser
|
|
||||||
-Cflags: -I${includedir} @PKG_CONFIG_FLAGS@
|
|
||||||
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
|
||||||
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
||||||
+
|
|
||||||
+Name: @PACKAGE_NAME@
|
|
||||||
+Description: Mathematical expressions parser library
|
|
||||||
+Version: @MUPARSER_VERSION@
|
|
||||||
+Requires:
|
|
||||||
+Libs: -L${libdir} -lmuparser
|
|
||||||
+Cflags: -I${includedir} @PKG_CONFIG_FLAGS@
|
|
||||||
diff --git a/src/gromacs/libgromacs.pc.cmakein b/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
index af9b5a6dc0..5f58d549bf 100644
|
|
||||||
--- a/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
+++ b/src/gromacs/libgromacs.pc.cmakein
|
|
||||||
@@ -1,5 +1,4 @@
|
|
||||||
-prefix=@CMAKE_INSTALL_PREFIX@
|
|
||||||
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
|
|
||||||
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
|
||||||
|
|
||||||
Name: libgromacs@GMX_LIBS_SUFFIX@
|
|
||||||
Description: Gromacs library
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, pkg-config, expat, ncurses
|
|
||||||
, pciutils, numactl }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "hwloc-1.11.6";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "http://www.open-mpi.org/software/hwloc/v1.11/downloads/${name}.tar.bz2";
|
|
||||||
sha256 = "1yl7dm2qplwmnidd712zy12qfvxk28k8ccs694n42ybwdjwzg1bn";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
|
|
||||||
# Filter out `null' inputs. This allows users to `.override' the
|
|
||||||
# derivation and set optional dependencies to `null'.
|
|
||||||
buildInputs = filter (x: x != null)
|
|
||||||
([ expat ncurses ]
|
|
||||||
++ (optionals stdenv.isLinux [ numactl ]));
|
|
||||||
|
|
||||||
propagatedBuildInputs =
|
|
||||||
# Since `libpci' appears in `hwloc.pc', it must be propagated.
|
|
||||||
optional stdenv.isLinux pciutils;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
postInstall =
|
|
||||||
optionalString (stdenv.isLinux && numactl != null)
|
|
||||||
'' if [ -d "${numactl}/lib64" ]
|
|
||||||
then
|
|
||||||
numalibdir="${numactl}/lib64"
|
|
||||||
else
|
|
||||||
numalibdir="${numactl}/lib"
|
|
||||||
test -d "$numalibdir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i "$out/lib/libhwloc.la" \
|
|
||||||
-e "s|-lnuma|-L$numalibdir -lnuma|g"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Checks disabled because they're impure (hardware dependent) and
|
|
||||||
# fail on some build machines.
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Portable abstraction of hierarchical architectures for high-performance computing";
|
|
||||||
longDescription = ''
|
|
||||||
hwloc provides a portable abstraction (across OS,
|
|
||||||
versions, architectures, ...) of the hierarchical topology of
|
|
||||||
modern architectures, including NUMA memory nodes, sockets,
|
|
||||||
shared caches, cores and simultaneous multithreading. It also
|
|
||||||
gathers various attributes such as cache and memory
|
|
||||||
information. It primarily aims at helping high-performance
|
|
||||||
computing applications with gathering information about the
|
|
||||||
hardware so as to exploit it accordingly and efficiently.
|
|
||||||
|
|
||||||
hwloc may display the topology in multiple convenient
|
|
||||||
formats. It also offers a powerful programming interface to
|
|
||||||
gather information about the hardware, bind processes, and much
|
|
||||||
more.
|
|
||||||
'';
|
|
||||||
|
|
||||||
# http://www.open-mpi.org/projects/hwloc/license.php
|
|
||||||
license = licenses.bsd3;
|
|
||||||
homepage = http://www.open-mpi.org/projects/hwloc/;
|
|
||||||
maintainers = [ ];
|
|
||||||
platforms = platforms.all;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, gcc
|
|
||||||
, iccUnwrapped
|
|
||||||
, wrapCCWith
|
|
||||||
, intelLicense
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
targetConfig = stdenv.targetPlatform.config;
|
|
||||||
inherit gcc;
|
|
||||||
in wrapCCWith rec {
|
|
||||||
cc = iccUnwrapped;
|
|
||||||
extraBuildCommands = ''
|
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${iccUnwrapped}/include" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${iccUnwrapped}/include/intel64" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
|
|
||||||
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
|
||||||
|
|
||||||
cat "${iccUnwrapped}/nix-support/propagated-build-inputs" >> \
|
|
||||||
$out/nix-support/propagated-build-inputs
|
|
||||||
|
|
||||||
echo "export INTEL_LICENSE_FILE=${intelLicense}" \
|
|
||||||
>> $out/nix-support/setup-hook
|
|
||||||
|
|
||||||
# Create the wrappers for icc and icpc
|
|
||||||
if [ -e $ccPath/icc ]; then
|
|
||||||
wrap icc $wrapper $ccPath/icc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e $ccPath/icpc ]; then
|
|
||||||
wrap icpc $wrapper $ccPath/icpc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e $ccPath/ifort ]; then
|
|
||||||
wrap ifort $wrapper $ccPath/ifort
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, fetchurl
|
|
||||||
, rpmextract
|
|
||||||
, autoPatchelfHook
|
|
||||||
, gcc
|
|
||||||
, intel-mpi
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
version = "${year}.${v_a}.${v_b}";
|
|
||||||
name = "intel-compiler-${version}";
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
CC = "icc";
|
|
||||||
CXX = "icpc";
|
|
||||||
};
|
|
||||||
|
|
||||||
# From Arch Linux PKGBUILD
|
|
||||||
dir_nr="17114";
|
|
||||||
year="2020";
|
|
||||||
v_a="4";
|
|
||||||
v_b="304";
|
|
||||||
update="4";
|
|
||||||
composer_xe_dir="compilers_and_libraries_${year}.${v_a}.${v_b}";
|
|
||||||
tgz="parallel_studio_xe_2020_update${update}_professional_edition.tgz";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/${dir_nr}/${tgz}";
|
|
||||||
sha256 = "1rn9kk5bjj0jfv853b09dxrx7kzvv8dlyzw3hl9ijx9mqr09lrzr";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
rpmextract
|
|
||||||
autoPatchelfHook
|
|
||||||
gcc.cc.lib
|
|
||||||
gcc
|
|
||||||
intel-mpi
|
|
||||||
];
|
|
||||||
|
|
||||||
# The gcc package is required for building other programs
|
|
||||||
propagatedBuildInputs = [ gcc ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
pwd
|
|
||||||
ls -l rpm
|
|
||||||
rpmextract rpm/intel-icc-*.rpm
|
|
||||||
rpmextract rpm/intel-comp-*.rpm
|
|
||||||
rpmextract rpm/intel-c-comp-*.rpm
|
|
||||||
rpmextract rpm/intel-openmp*.rpm
|
|
||||||
rpmextract rpm/intel-ifort*.rpm
|
|
||||||
|
|
||||||
mkdir -p $out/{bin,lib,include}
|
|
||||||
|
|
||||||
pushd ./opt/intel/${composer_xe_dir}/linux/
|
|
||||||
cp -a bin/intel64/* $out/bin/
|
|
||||||
cp -a compiler/include/* $out/include/
|
|
||||||
cp -a compiler/lib/intel64_lin/* $out/lib/
|
|
||||||
ln -s lib $out/lib_lin
|
|
||||||
rm $out/lib/*.dbg
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://www.intel.com/content/www/us/en/developer/tools/overview.html";
|
|
||||||
description = "Intel compiler";
|
|
||||||
maintainers = with lib.maintainers.bsc; [ rarias ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
license = lib.licenses.unfree;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, fetchurl
|
|
||||||
, dpkg
|
|
||||||
, rsync
|
|
||||||
, libffi
|
|
||||||
, libelf
|
|
||||||
, libxml2
|
|
||||||
, hwloc
|
|
||||||
, autoPatchelfHook
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
getsrc = url: sha256: fetchurl { inherit url sha256; };
|
|
||||||
|
|
||||||
version = "2021.2.0";
|
|
||||||
_debpkgrel = "610";
|
|
||||||
tbbrel = "357";
|
|
||||||
|
|
||||||
# Shorhands
|
|
||||||
main = "intel-oneapi-dpcpp-cpp";
|
|
||||||
compiler = "intel-oneapi-compiler-dpcpp-cpp";
|
|
||||||
shared = "intel-oneapi-compiler-shared";
|
|
||||||
openmp = "intel-oneapi-openmp";
|
|
||||||
tbb = "intel-oneapi-tbb";
|
|
||||||
|
|
||||||
# From Arch Linux PKGBUILD:
|
|
||||||
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=intel-oneapi-compiler-dpcpp-cpp
|
|
||||||
debs = [
|
|
||||||
# From intel-oneapi-compiler-dpcpp-cpp
|
|
||||||
"${main}-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
"${compiler}-common-${version}-${version}-${_debpkgrel}_all.deb"
|
|
||||||
"${compiler}-runtime-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
|
|
||||||
# From intel-oneapi-compiler-shared
|
|
||||||
"${shared}-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
"${shared}-runtime-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
"${shared}-common-${version}-${version}-${_debpkgrel}_all.deb"
|
|
||||||
"${shared}-common-runtime-${version}-${version}-${_debpkgrel}_all.deb"
|
|
||||||
"${compiler}-classic-fortran-shared-runtime-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
|
|
||||||
# From intel-oneapi-openmp
|
|
||||||
"${openmp}-${version}-${version}-${_debpkgrel}_amd64.deb"
|
|
||||||
"${openmp}-common-${version}-${version}-${_debpkgrel}_all.deb"
|
|
||||||
|
|
||||||
# From intel-oneapi-tbb
|
|
||||||
"${tbb}-${version}-${version}-${tbbrel}_amd64.deb"
|
|
||||||
"${tbb}-devel-${version}-${version}-${tbbrel}_amd64.deb"
|
|
||||||
"${tbb}-common-${version}-${version}-${tbbrel}_all.deb"
|
|
||||||
"${tbb}-common-devel-${version}-${version}-${tbbrel}_all.deb"
|
|
||||||
];
|
|
||||||
|
|
||||||
apthost = "https://apt.repos.intel.com/oneapi/pool/main/";
|
|
||||||
urls = map (x: apthost + x) debs;
|
|
||||||
|
|
||||||
sums = [
|
|
||||||
# From intel-oneapi-compiler-dpcpp-cpp
|
|
||||||
"0pwsfzkazr9yf6v6lgwb3p2in6ch3rlcc9qcfarkyqn052p760kk"
|
|
||||||
"0vzsanldhs4ym4gsfn0zjqm03x53ma1zjkj24hpkhpsvlr2r069w"
|
|
||||||
"0nx62v6g0wl70lqdh7sh7gfgxbynhrrips9gpj9if60ngz6fm21m"
|
|
||||||
|
|
||||||
# From intel-oneapi-compiler-shared
|
|
||||||
"1al80pcy2r3q2r2pm04sva7rd3z6y287mkdv5jq4p5bfd8yi14d4"
|
|
||||||
"07rp0cjmbgj48wly9dm6ibxzbsanmgrsjjqr7mx688ms6qbhv314"
|
|
||||||
"1pf4xckyyhssjknhs6hwampjsz2qjlg81jw2fc441zaccwf25yf3"
|
|
||||||
"0hk0x4wq60g9wnn9j051v25zcmbasjdzp34xfvrihmcvyws0s69g"
|
|
||||||
"0dhbw8kshw4abqc9zf891z5ic0x13x3kvhk56nrqkqgcfwps9w8a"
|
|
||||||
|
|
||||||
# From intel-oneapi-openmp
|
|
||||||
"1wqy2sjwlqdh72zhfrxl9pm106hjzfdbbm98cxigbg20fb5lbv5a"
|
|
||||||
"19nbqypvqcf8c3mwriaqrmp5igjpwvwrb9mq2fxa5i40w7bhlxjl"
|
|
||||||
|
|
||||||
# From intel-oneapi-tbb
|
|
||||||
"1dpii3g861kimky0x7dqcj6hg7zb6i5kw1wgwrxdc5yxhi5slbm9"
|
|
||||||
"0bl1flm6w0w9nzrh34ig4p9qz2gbdgw9q14as2pwp8flicd8p899"
|
|
||||||
"0w3kip6q713v1xlfc10ai4v15cbwmbqrv8r1f5x6pfqdbb0bpmbv"
|
|
||||||
"0v95nmddyi0mjjdvm07w9fm3vq4a0wkx7zxlyzn2f4xg38qc5j73"
|
|
||||||
];
|
|
||||||
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
inherit version;
|
|
||||||
name = "intel-compiler-${version}";
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
CC = "icc";
|
|
||||||
CXX = "icpc";
|
|
||||||
};
|
|
||||||
|
|
||||||
srcs = zipListsWith getsrc urls sums;
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
dpkg
|
|
||||||
rsync
|
|
||||||
libffi
|
|
||||||
libelf
|
|
||||||
libxml2
|
|
||||||
hwloc
|
|
||||||
autoPatchelfHook
|
|
||||||
stdenv.cc.cc.lib
|
|
||||||
];
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
dontStrip = true;
|
|
||||||
|
|
||||||
# The gcc package is required for building other programs
|
|
||||||
#propagatedBuildInputs = [ gcc ];
|
|
||||||
|
|
||||||
unpackCmd = ''
|
|
||||||
dpkg -x $curSrc .
|
|
||||||
'';
|
|
||||||
|
|
||||||
# FIXME: Some dependencies are missing
|
|
||||||
autoPatchelfIgnoreMissingDeps = true;
|
|
||||||
#autoPatchelfIgnoreMissingDeps = [ "*" ];
|
|
||||||
|
|
||||||
# Compiler
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/{bin,lib,include}
|
|
||||||
|
|
||||||
pushd intel/oneapi/compiler/${version}/linux
|
|
||||||
# Binaries
|
|
||||||
rsync -a bin/ $out/bin/
|
|
||||||
rsync -a bin/intel64/ $out/bin/
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
rsync -a --exclude=oclfpga lib/ $out/lib/
|
|
||||||
rsync -a compiler/lib/intel64_lin/ $out/lib/
|
|
||||||
|
|
||||||
# Headers
|
|
||||||
rsync -a include/ $out/include/
|
|
||||||
rsync -a compiler/include/ $out/include/
|
|
||||||
popd
|
|
||||||
|
|
||||||
# TBB
|
|
||||||
pushd intel/oneapi/tbb/${version}
|
|
||||||
# Libraries
|
|
||||||
rsync -a lib/intel64/gcc4.8/ $out/lib/
|
|
||||||
|
|
||||||
# Headers
|
|
||||||
rsync -a include/ $out/include/
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://www.intel.com/content/www/us/en/developer/tools/overview.html";
|
|
||||||
description = "Intel compiler";
|
|
||||||
maintainers = with lib.maintainers.bsc; [ rarias ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
license = lib.licenses.unfree;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, requireFile
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "intel-compiler-license";
|
|
||||||
version = "2019.7.217";
|
|
||||||
|
|
||||||
src = requireFile {
|
|
||||||
name = "license.lic";
|
|
||||||
sha256 = "0rgmsqkhpqcfny8j7msa4sgz3prhh248ylh69gjh12dkra77prsj";
|
|
||||||
message = ''
|
|
||||||
The Intel Compiler requires a license. You can get one (free of charge) if
|
|
||||||
you meet the requeriments at the website:
|
|
||||||
|
|
||||||
https://software.intel.com/content/www/us/en/develop/articles/qualify-for-free-software.html#opensourcecontributor
|
|
||||||
|
|
||||||
Or you can use your own license. Add it to the store with:
|
|
||||||
|
|
||||||
$ nix-store --add-fixed sha256 license.lic
|
|
||||||
/nix/store/2p9v0nvsl3scshjx348z6j32rh7ac0db-license.lic
|
|
||||||
|
|
||||||
Notice that the name must match exactly "license.lic".
|
|
||||||
|
|
||||||
Then update the hash in the bsc/intel-compiler/license.nix file using the
|
|
||||||
nix-hash command with:
|
|
||||||
|
|
||||||
$ nix-hash --type sha256 --base32 --flat /nix/store/2p9v0nvsl3scshjx348z6j32rh7ac0db-license.lic
|
|
||||||
06g2xgm1lch6zqfkhb768wacdx46kf61mfvj5wfpyssw0anr0x9q
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
cp $src $out/
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, gcc
|
|
||||||
, iccUnwrapped
|
|
||||||
, wrapCCWith
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
targetConfig = stdenv.targetPlatform.config;
|
|
||||||
inherit gcc;
|
|
||||||
in wrapCCWith rec {
|
|
||||||
cc = iccUnwrapped;
|
|
||||||
extraBuildCommands = ''
|
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${iccUnwrapped}/include" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${iccUnwrapped}/include/icc" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${gcc.cc}/include/c++/${gcc.version}" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${gcc.cc}/include/c++/${gcc.version}/${targetConfig}" >> $out/nix-support/cc-cflags
|
|
||||||
|
|
||||||
echo "-L${iccUnwrapped}/lib" >> $out/nix-support/cc-ldflags
|
|
||||||
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
|
|
||||||
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
|
||||||
|
|
||||||
# Create the wrappers for icx*
|
|
||||||
wrap lld $wrapper $ccPath/lld
|
|
||||||
wrap icx $wrapper $ccPath/icx
|
|
||||||
wrap icpx $wrapper $ccPath/icpx
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, rpmextract
|
|
||||||
, gcc
|
|
||||||
, zlib
|
|
||||||
, ucx
|
|
||||||
, numactl
|
|
||||||
, rdma-core
|
|
||||||
, libpsm2
|
|
||||||
, patchelf
|
|
||||||
, autoPatchelfHook
|
|
||||||
, enableDebug ? false
|
|
||||||
# The _mt version seems to cause seg-faults and deadlocks with the libpsm2
|
|
||||||
# provider library with programs that call the MPI library without any locking
|
|
||||||
# mechanism. See https://pm.bsc.es/gitlab/rarias/bscpkgs/-/issues/28. By
|
|
||||||
# default, we use the non-mt variant, which provides a big lock. If you want to
|
|
||||||
# use it, take a look at the I_MPI_THREAD_SPLIT env-var as well.
|
|
||||||
, enableMt ? false
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
lib_variant = (if enableDebug then "debug" else "release");
|
|
||||||
|
|
||||||
# See https://software.intel.com/content/www/us/en/develop/documentation/mpi-developer-reference-linux/top/environment-variable-reference/other-environment-variables.html
|
|
||||||
lib_mt = (if enableMt then "_mt" else "");
|
|
||||||
lib_name = "${lib_variant}${lib_mt}";
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "intel-mpi-${version}";
|
|
||||||
version = "2019.10.317";
|
|
||||||
dir_nr = "17534";
|
|
||||||
|
|
||||||
src = builtins.fetchTarball {
|
|
||||||
url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/${dir_nr}/l_mpi_${version}.tgz";
|
|
||||||
sha256 = "00nimgqywr20dv1ns5kg4r8539gvharn0xfj48i7mhbg8kwf8s08";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
rpmextract
|
|
||||||
autoPatchelfHook
|
|
||||||
gcc.cc.lib
|
|
||||||
zlib
|
|
||||||
ucx
|
|
||||||
numactl
|
|
||||||
rdma-core
|
|
||||||
libpsm2
|
|
||||||
patchelf
|
|
||||||
];
|
|
||||||
|
|
||||||
postUnpack = ''
|
|
||||||
pushd $sourceRoot
|
|
||||||
rpmextract rpm/intel-mpi-*.rpm
|
|
||||||
# Predictable name
|
|
||||||
mv opt/intel/compilers_and_libraries_* opt/intel/compilers_and_libraries
|
|
||||||
popd
|
|
||||||
sourceRoot="$sourceRoot/opt/intel/compilers_and_libraries/linux/mpi/intel64"
|
|
||||||
'';
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./mpicc.patch
|
|
||||||
./mpicxx.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
for i in bin/mpi* ; do
|
|
||||||
echo "Fixing paths in $i"
|
|
||||||
sed -i "s:I_MPI_SUBSTITUTE_INSTALLDIR:$out:g" "$i"
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
mv etc $out
|
|
||||||
mv bin $out
|
|
||||||
mv include $out
|
|
||||||
mkdir $out/lib
|
|
||||||
cp -a lib/lib* $out/lib
|
|
||||||
cp -a lib/${lib_name}/lib* $out/lib
|
|
||||||
cp -a libfabric/lib/* $out/lib
|
|
||||||
cp -a libfabric/lib/prov/* $out/lib
|
|
||||||
cp -a libfabric/bin/* $out/bin
|
|
||||||
ln -s . $out/intel64
|
|
||||||
rm $out/lib/libmpi.dbg
|
|
||||||
|
|
||||||
# Fixup Intel PSM2 library missing (now located at PSMX2)
|
|
||||||
ln -s $out/lib/libpsmx2-fi.so $out/lib/libpsm2-fi.so
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontAutoPatchelf = true;
|
|
||||||
|
|
||||||
# The rpath of libfabric.so bundled with Intel MPI is patched to include the
|
|
||||||
# rdma-core lib path, as is required for dlopen to find the rdma components.
|
|
||||||
# TODO: Try the upstream libfabric library with rdma support, so we can avoid
|
|
||||||
# this hack.
|
|
||||||
postFixup = ''
|
|
||||||
autoPatchelf -- $out
|
|
||||||
patchelf --set-rpath "$out/lib:${rdma-core}/lib:${libpsm2}/lib" $out/lib/libfabric.so
|
|
||||||
echo "Patched RPATH in libfabric.so to: $(patchelf --print-rpath $out/lib/libfabric.so)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://www.intel.com/content/www/us/en/developer/tools/overview.html";
|
|
||||||
description = "Intel MPI";
|
|
||||||
maintainers = with lib.maintainers.bsc; [ rarias ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
license = lib.licenses.unfree;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
--- a/bin/mpicc 2021-02-04 18:15:11.233632360 +0100
|
|
||||||
+++ b/bin/mpicc 2021-02-05 09:33:49.493598479 +0100
|
|
||||||
@@ -50,7 +50,7 @@
|
|
||||||
if [ x"$opt_args" == x"" ]; then
|
|
||||||
case "${compiler_short_name}" in
|
|
||||||
icc|icx) "$dir"/mpiicc -cc=$compiler_name "$@" ;;
|
|
||||||
- cc|*gcc*|clang*) "$dir"/mpigcc -cc=$compiler_name "$@" ;;
|
|
||||||
+ cc|*gcc*|clang*|mcc|echo) "$dir"/mpigcc -cc=$compiler_name "$@" ;;
|
|
||||||
mpicc) "$dir"/mpigcc "$@" ;;
|
|
||||||
*)
|
|
||||||
echo "Error: unsupported compiler name '$compiler_name'."
|
|
||||||
@@ -60,7 +60,7 @@
|
|
||||||
else
|
|
||||||
case "${compiler_short_name}" in
|
|
||||||
icc|icx) "$dir"/mpiicc -cc=$compiler_name "$@" $opt_args ;;
|
|
||||||
- cc|*gcc*|clang*) "$dir"/mpigcc -cc=$compiler_name "$@" $opt_args ;;
|
|
||||||
+ cc|*gcc*|clang*|mcc|echo) "$dir"/mpigcc -cc=$compiler_name "$@" $opt_args ;;
|
|
||||||
mpicc) "$dir"/mpigcc "$@" $opt_args ;;
|
|
||||||
*)
|
|
||||||
echo "Error: unsupported compiler name '$compiler_name'."
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
--- a/bin/mpicxx 2021-02-04 18:15:11.233632360 +0100
|
|
||||||
+++ b/bin/mpicxx 2021-02-05 09:36:21.396922569 +0100
|
|
||||||
@@ -50,7 +50,7 @@
|
|
||||||
if [ x"$opt_args" == x"" ]; then
|
|
||||||
case "${compiler_short_name}" in
|
|
||||||
icc|icpc|dpcpp) "$dir"/mpiicpc -cxx=$compiler_name "$@" ;;
|
|
||||||
- *g++*) "$dir"/mpigxx -cxx=$compiler_name "$@" ;;
|
|
||||||
+ *g++*|clang*++|mcxx|echo) "$dir"/mpigxx -cxx=$compiler_name "$@" ;;
|
|
||||||
mpicxx) "$dir"/mpigxx "$@" ;;
|
|
||||||
*)
|
|
||||||
echo "Error: unsupported compiler name '$compiler_name'."
|
|
||||||
@@ -60,7 +60,7 @@
|
|
||||||
else
|
|
||||||
case "${compiler_short_name}" in
|
|
||||||
icc|icpc|dpcpp) "$dir"/mpiicpc -cxx=$compiler_name "$@" $opt_args ;;
|
|
||||||
- *g++*) "$dir"/mpigxx -cxx=$compiler_name "$@" $opt_args ;;
|
|
||||||
+ *g++*|clang*++|mcxx|echo) "$dir"/mpigxx -cxx=$compiler_name "$@" $opt_args ;;
|
|
||||||
mpicxx) "$dir"/mpigxx "$@" $opt_args ;;
|
|
||||||
*)
|
|
||||||
echo "Error: unsupported compiler name '$compiler_name'."
|
|
||||||
@@ -42,19 +42,45 @@ let
|
|||||||
mpi = "2021.9.0";
|
mpi = "2021.9.0";
|
||||||
};
|
};
|
||||||
|
|
||||||
findMatch = name:
|
aptPackageIndex = stdenv.mkDerivation {
|
||||||
let
|
name = "intel-oneapi-packages";
|
||||||
aptPackages = builtins.fromJSON (builtins.readFile ./packages.json);
|
srcs = [
|
||||||
matches = lib.filter (x: name == x.pname) aptPackages;
|
# Run update.sh to update the package lists
|
||||||
n = lib.length matches;
|
./amd64-packages ./all-packages
|
||||||
match = builtins.traceVerbose (name + " -- ${builtins.toString n}") (builtins.head matches);
|
];
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
awk -F': ' '\
|
||||||
|
BEGIN { print "[ {" } \
|
||||||
|
NR>1 && /^Package: / { print "} {"; } \
|
||||||
|
/: / { printf "%s = \"%s\";\n", $1, $2 } \
|
||||||
|
END { print "} ]" }' $srcs > $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
aptPackages = import aptPackageIndex;
|
||||||
|
|
||||||
apthost = "https://apt.repos.intel.com/oneapi/";
|
apthost = "https://apt.repos.intel.com/oneapi/";
|
||||||
|
|
||||||
|
getSum = pkgList: name:
|
||||||
|
let
|
||||||
|
matches = lib.filter (x: name == x.Package) pkgList;
|
||||||
|
#n = lib.length matches;
|
||||||
|
#match = builtins.trace (name + " -- ${builtins.toString n}") (lib.elemAt matches 0);
|
||||||
|
match = lib.elemAt matches 0;
|
||||||
in
|
in
|
||||||
{
|
match.SHA256;
|
||||||
url = apthost + match.filename;
|
|
||||||
sha256 = match.sha256;
|
getUrl = pkgList: name:
|
||||||
};
|
let
|
||||||
|
matches = lib.filter (x: name == x.Package) pkgList;
|
||||||
|
#match = assert lib.length matches == 1; lib.elemAt matches 0;
|
||||||
|
n = lib.length matches;
|
||||||
|
match =
|
||||||
|
#builtins.trace (name + " -- n=${builtins.toString n}")
|
||||||
|
(lib.elemAt matches 0);
|
||||||
|
in
|
||||||
|
apthost + match.Filename;
|
||||||
|
|
||||||
uncompressDebs = debs: name: stdenv.mkDerivation {
|
uncompressDebs = debs: name: stdenv.mkDerivation {
|
||||||
name = name;
|
name = name;
|
||||||
@@ -74,7 +100,10 @@ let
|
|||||||
|
|
||||||
joinDebs = name: names:
|
joinDebs = name: names:
|
||||||
let
|
let
|
||||||
debs = builtins.map (x: builtins.fetchurl (findMatch x)) names;
|
urls = builtins.map (x: getUrl aptPackages x) names;
|
||||||
|
sums = builtins.map (x: getSum aptPackages x) names;
|
||||||
|
getsrc = url: sha256: builtins.fetchurl { inherit url sha256; };
|
||||||
|
debs = lib.zipListsWith getsrc urls sums;
|
||||||
in
|
in
|
||||||
uncompressDebs debs "${name}-source";
|
uncompressDebs debs "${name}-source";
|
||||||
|
|
||||||
@@ -443,7 +472,7 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
ifort-wrapper = wrapIntel {
|
ifort-wrapper = wrapIntel rec {
|
||||||
cc = intel-compiler-fortran;
|
cc = intel-compiler-fortran;
|
||||||
mygcc = gcc;
|
mygcc = gcc;
|
||||||
extraBuild = ''
|
extraBuild = ''
|
||||||
|
|||||||
8769
pkgs/intel-oneapi/all-packages
Normal file
8769
pkgs/intel-oneapi/all-packages
Normal file
File diff suppressed because it is too large
Load Diff
34075
pkgs/intel-oneapi/amd64-packages
Normal file
34075
pkgs/intel-oneapi/amd64-packages
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,205 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, callPackage
|
|
||||||
, dpkg
|
|
||||||
, fetchurl
|
|
||||||
, recurseIntoAttrs
|
|
||||||
|
|
||||||
, sqlite
|
|
||||||
, elfutils
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (builtins)
|
|
||||||
elem attrNames attrValues concatMap filter fromJSON getAttr groupBy head isNull listToAttrs map mapAttrs readFile replaceStrings splitVersion ;
|
|
||||||
inherit (lib)
|
|
||||||
converge findFirst groupBy' hasPrefix optional pipe take toInt toList versionAtLeast versionOlder ;
|
|
||||||
|
|
||||||
aptData = fromJSON (readFile ./packages.json);
|
|
||||||
|
|
||||||
# Compare versions in debian control file syntax
|
|
||||||
# See: https://www.debian.org/doc/debian-policy/ch-relationships.html#syntax-of-relationship-fields
|
|
||||||
#
|
|
||||||
# NOTE: this is not a proper version comparison
|
|
||||||
#
|
|
||||||
# A proper version solver, should aggregate dependencies with the same name
|
|
||||||
# and compute the constraint (e.g. a (>= 2) a (<< 5) -> 2 <= a << 5)
|
|
||||||
#
|
|
||||||
# But in the intel repo, there are no such "duplicated" dependencies to specify
|
|
||||||
# upper limits, which leads to issues when intel-hpckit-2021 depends on things
|
|
||||||
# like intel-basekit >= 2021.1.0-2403 and we end up installing the newest
|
|
||||||
# basekit instead of the one from 2021.
|
|
||||||
#
|
|
||||||
# To mitigate this, >= is set to take the latest version with matching major
|
|
||||||
# and minor (only revision and patch are allowed to change)
|
|
||||||
compareVersions = got: kind: want:
|
|
||||||
let
|
|
||||||
g0 = take 2 (splitVersion got);
|
|
||||||
w0 = take 2 (splitVersion want);
|
|
||||||
in if isNull want then true
|
|
||||||
else if kind == "=" then got == want
|
|
||||||
else if kind == "<<" then versionOlder got want
|
|
||||||
else if kind == "<=" then versionAtLeast want got
|
|
||||||
else if kind == ">>" then versionOlder want got
|
|
||||||
else if kind == ">=" then (g0 == w0) && versionAtLeast got want # always match major version
|
|
||||||
else throw "unknown operation: ${kind}";
|
|
||||||
|
|
||||||
findMatching = { pname, kind, version }:
|
|
||||||
findFirst (x: pname == x.pname && compareVersions x.version kind version) null aptData;
|
|
||||||
|
|
||||||
isIntel = pkg: (hasPrefix "intel-" pkg.pname);
|
|
||||||
|
|
||||||
expandDeps = pkg: (map findMatching (filter isIntel pkg.dependencies)) ++ (optional (pkg.size != 0) pkg);
|
|
||||||
|
|
||||||
# get the oldest by major version. If they have the same major version, take
|
|
||||||
# the newest. This prevents most issues with resolutions
|
|
||||||
# versionOlder b a -> true if b is older than a (b `older` a)
|
|
||||||
getNewerInMajor = a: b: let
|
|
||||||
va = a.version;
|
|
||||||
vb = b.version;
|
|
||||||
va0 = head (splitVersion va);
|
|
||||||
vb0 = head (splitVersion vb);
|
|
||||||
in
|
|
||||||
if isNull a then b
|
|
||||||
else if va0 != vb0 then
|
|
||||||
if va0 > vb0 then b else a
|
|
||||||
else if versionOlder vb va then a else b;
|
|
||||||
removeDups = l: attrValues (groupBy' getNewerInMajor null (getAttr "provides") l);
|
|
||||||
|
|
||||||
_resolveDeps = converge (l: removeDups (concatMap expandDeps l));
|
|
||||||
resolveDeps = pkg: let deps = _resolveDeps (toList pkg);
|
|
||||||
namedDeps = (map (x: "${x.pname}-${x.version}") deps);
|
|
||||||
in builtins.traceVerbose (builtins.deepSeq namedDeps namedDeps) deps;
|
|
||||||
|
|
||||||
blacklist = [
|
|
||||||
"intel-basekit-env"
|
|
||||||
"intel-basekit-getting-started"
|
|
||||||
"intel-hpckit-env"
|
|
||||||
"intel-hpckit-getting-started"
|
|
||||||
"intel-oneapi-advisor"
|
|
||||||
"intel-oneapi-common-licensing"
|
|
||||||
"intel-oneapi-common-oneapi-vars"
|
|
||||||
"intel-oneapi-common-vars"
|
|
||||||
"intel-oneapi-compiler-cpp-eclipse-cfg"
|
|
||||||
"intel-oneapi-compiler-dpcpp-eclipse-cfg"
|
|
||||||
"intel-oneapi-condaindex"
|
|
||||||
"intel-oneapi-dev-utilities-eclipse-cfg"
|
|
||||||
"intel-oneapi-dpcpp-ct-eclipse-cfg"
|
|
||||||
"intel-oneapi-eclipse-ide"
|
|
||||||
"intel-oneapi-hpc-toolkit-getting-started"
|
|
||||||
"intel-oneapi-icc-eclipse-plugin-cpp"
|
|
||||||
"intel-oneapi-vtune"
|
|
||||||
"intel-oneapi-vtune-eclipse-plugin-vtune"
|
|
||||||
];
|
|
||||||
|
|
||||||
isInBlacklist = pkg: elem pkg.provides blacklist;
|
|
||||||
removeBlacklist = filter (e: !(isInBlacklist e));
|
|
||||||
|
|
||||||
dpkgExtractAll = pname: version: {srcs, deps}: stdenv.mkDerivation {
|
|
||||||
inherit pname version srcs;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ dpkg ];
|
|
||||||
phases = [ "installPhase" ];
|
|
||||||
|
|
||||||
passthru = { inherit deps; };
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out
|
|
||||||
for src in $srcs; do
|
|
||||||
echo "Unpacking $src"
|
|
||||||
dpkg -x $src $out
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
apthost = "https://apt.repos.intel.com/oneapi/";
|
|
||||||
fetchDeb = p: fetchurl { url = apthost + p.filename; inherit (p) sha256; };
|
|
||||||
|
|
||||||
buildIntel = pkg: pipe pkg [
|
|
||||||
resolveDeps
|
|
||||||
removeBlacklist
|
|
||||||
(l: {srcs = map fetchDeb l; deps = l; })
|
|
||||||
(dpkgExtractAll "${pkg.provides}-extracted" pkg.version)
|
|
||||||
];
|
|
||||||
|
|
||||||
findHpcKit = year: findMatching { pname = "intel-hpckit"; kind = "<<"; version = toString (year+1); };
|
|
||||||
years = map toInt (attrNames components);
|
|
||||||
|
|
||||||
patchIntel = callPackage ./patch_intel.nix { };
|
|
||||||
|
|
||||||
# Version information for each hpckit. This is used to normalize the paths
|
|
||||||
# so that files are in $out/{bin,lib,include...} instead of all over the place
|
|
||||||
# in $out/opt/intel/oneapi/*/*/{...}.
|
|
||||||
#
|
|
||||||
# The most important is the compiler component, which is used to build the
|
|
||||||
# stdenv for the hpckit.
|
|
||||||
#
|
|
||||||
# NOTE: this have to be manually specified, so we can avoid IFD. To add a
|
|
||||||
# new version, add a new field with an empty attrset, (e.g. "2026" = {}; ),
|
|
||||||
# build hpckit_2026.unpatched and use the values from
|
|
||||||
# result/opt/intel/oneapi/* to populate the attrset.
|
|
||||||
#
|
|
||||||
# WARN: if there are more than one version in the folders of the unpatched
|
|
||||||
# components, our dependency resolution hacks have probably failed and the
|
|
||||||
# package set may be broken.
|
|
||||||
components = {
|
|
||||||
"2025" = {
|
|
||||||
ishmem = "1.4";
|
|
||||||
pti = "0.13";
|
|
||||||
tcm = "1.4";
|
|
||||||
umf = "0.11";
|
|
||||||
|
|
||||||
ccl = "2021.16";
|
|
||||||
compiler = "2025.2";
|
|
||||||
dal = "2025.8";
|
|
||||||
debugger = "2025.2";
|
|
||||||
dev-utilities = "2025.2";
|
|
||||||
dnnl = "2025.2";
|
|
||||||
dpcpp-ct = "2025.2";
|
|
||||||
dpl = "2022.9";
|
|
||||||
ipp = "2022.2";
|
|
||||||
ippcp = "2025.2";
|
|
||||||
mkl = "2025.2";
|
|
||||||
mpi = "2021.16";
|
|
||||||
tbb = "2022.2";
|
|
||||||
};
|
|
||||||
"2024" = {
|
|
||||||
tcm = "1.1";
|
|
||||||
|
|
||||||
ccl = "2021.13";
|
|
||||||
compiler = "2024.2";
|
|
||||||
dal = "2024.6";
|
|
||||||
debugger = "2024.2";
|
|
||||||
dev-utilities = "2024.2";
|
|
||||||
diagnostics = "2024.2";
|
|
||||||
dnnl = "2024.2";
|
|
||||||
dpcpp-ct = "2024.2";
|
|
||||||
dpl = "2022.6";
|
|
||||||
ipp = "2021.12";
|
|
||||||
ippcp = "2021.12";
|
|
||||||
mkl = "2024.2";
|
|
||||||
mpi = "2021.13";
|
|
||||||
tbb = "2021.13";
|
|
||||||
|
|
||||||
extraPackages = [
|
|
||||||
sqlite
|
|
||||||
elfutils
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
replaceDots = replaceStrings ["."] ["_"];
|
|
||||||
|
|
||||||
in recurseIntoAttrs (listToAttrs (map (year: let
|
|
||||||
year_str = toString year;
|
|
||||||
in {
|
|
||||||
name = "hpckit_${year_str}";
|
|
||||||
value = patchIntel {unpatched = buildIntel (findHpcKit year); components = components.${year_str}; };
|
|
||||||
}) years)) // {
|
|
||||||
apt = pipe aptData [
|
|
||||||
(groupBy (p: replaceDots p.provides))
|
|
||||||
(mapAttrs (_: l: listToAttrs (map (pkg: { name = replaceDots ("v" + pkg.version); value = pkg; }) l)))
|
|
||||||
] ;
|
|
||||||
|
|
||||||
inherit resolveDeps patchIntel buildIntel;
|
|
||||||
}
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
{ stdenvNoCC
|
|
||||||
, lib
|
|
||||||
, symlinkJoin
|
|
||||||
, autoPatchelfHook
|
|
||||||
, wrapCCWith
|
|
||||||
, overrideCC
|
|
||||||
, gcc13
|
|
||||||
, gcc13Stdenv
|
|
||||||
, hwloc
|
|
||||||
, libelf
|
|
||||||
, libffi_3_3
|
|
||||||
, libpsm2
|
|
||||||
, libuuid
|
|
||||||
, libxml2
|
|
||||||
, numactl
|
|
||||||
, ocl-icd
|
|
||||||
, openssl
|
|
||||||
, python3
|
|
||||||
, rdma-core
|
|
||||||
, ucx
|
|
||||||
, zlib
|
|
||||||
, makeOverridable
|
|
||||||
, recurseIntoAttrs
|
|
||||||
}:
|
|
||||||
|
|
||||||
makeOverridable (
|
|
||||||
{
|
|
||||||
unpatched,
|
|
||||||
components ? { },
|
|
||||||
extraPackages ? components.extraPackages or []
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (builtins) attrValues filter mapAttrs removeAttrs;
|
|
||||||
|
|
||||||
gcc = gcc13;
|
|
||||||
stdenv = gcc13Stdenv;
|
|
||||||
|
|
||||||
__components = removeAttrs components ["extraPackages"];
|
|
||||||
_components = __components;
|
|
||||||
# _components = lib.traceSeqN 2 {
|
|
||||||
# inherit unpatched __components;
|
|
||||||
# deps = builtins.map (x: "${x.pname}-${x.version}") unpatched.deps;
|
|
||||||
# } __components;
|
|
||||||
|
|
||||||
wrapIntel = { cc, extraBuildCommands ? "", extraInstall ? "", ... }@args:
|
|
||||||
let
|
|
||||||
targetConfig = stdenv.targetPlatform.config;
|
|
||||||
in (wrapCCWith {
|
|
||||||
inherit cc;
|
|
||||||
extraBuildCommands = ''
|
|
||||||
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
|
|
||||||
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
|
||||||
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
|
|
||||||
|
|
||||||
# echo "--gcc-toolchain=${gcc.cc}" >> $out/nix-support/libcxx-cxxflags
|
|
||||||
echo "--gcc-toolchain=${gcc.cc}" >> $out/nix-support/cc-cflags
|
|
||||||
|
|
||||||
# For some reason, If we don't resolve the realpath things go wrong
|
|
||||||
for stddef in ${cc}/lib/clang/*/include/stddef.h ; do
|
|
||||||
dir=$(dirname $(realpath "$stddef"))
|
|
||||||
echo "-isystem $dir" >> $out/nix-support/cc-cflags
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
|
|
||||||
echo "-isystem ${cc}/include/intel64" >> $out/nix-support/cc-cflags
|
|
||||||
|
|
||||||
for dir in ${gcc.cc}/lib/gcc/${targetConfig}/*/include; do
|
|
||||||
echo "-isystem $dir" >> $out/nix-support/cc-cflags
|
|
||||||
done
|
|
||||||
|
|
||||||
for dir in ${gcc.cc}/include/c++/*; do
|
|
||||||
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
|
||||||
done
|
|
||||||
for dir in ${gcc.cc}/include/c++/*/${targetConfig}; do
|
|
||||||
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
|
|
||||||
done
|
|
||||||
|
|
||||||
# FIXME: We should find a better way to modify the PATH instead of using
|
|
||||||
# this ugly hack. See https://jungle.bsc.es/git/rarias/bscpkgs/issues/9
|
|
||||||
echo 'path_backup="${gcc.cc}/bin:$path_backup"' >> $out/nix-support/cc-wrapper-hook
|
|
||||||
|
|
||||||
# Disable hardening by default
|
|
||||||
echo "" > $out/nix-support/add-hardening.sh
|
|
||||||
'' + extraBuildCommands;
|
|
||||||
} // (removeAttrs args ["cc" "extraBuildCommands" "extraInstall"])
|
|
||||||
).overrideAttrs (old: {
|
|
||||||
installPhase = old.installPhase + extraInstall;
|
|
||||||
});
|
|
||||||
|
|
||||||
in
|
|
||||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
||||||
pname = lib.removeSuffix "-extracted" unpatched.pname;
|
|
||||||
inherit (unpatched) version;
|
|
||||||
src = unpatched;
|
|
||||||
|
|
||||||
phases = [ "installPhase" "fixupPhase" ];
|
|
||||||
buildInputs = [
|
|
||||||
libffi_3_3
|
|
||||||
libelf
|
|
||||||
libxml2
|
|
||||||
hwloc
|
|
||||||
numactl
|
|
||||||
libuuid
|
|
||||||
libpsm2
|
|
||||||
zlib
|
|
||||||
ocl-icd
|
|
||||||
rdma-core
|
|
||||||
ucx
|
|
||||||
openssl
|
|
||||||
python3
|
|
||||||
stdenv.cc.cc.lib
|
|
||||||
] ++ extraPackages;
|
|
||||||
|
|
||||||
autoPatchelfIgnoreMissingDeps = [ "libhwloc.so.5" "libcuda.so.1" "libze_loader.so.1" ];
|
|
||||||
|
|
||||||
# There are broken symlinks that go outside packages, ignore them
|
|
||||||
dontCheckForBrokenSymlinks = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ autoPatchelfHook ];
|
|
||||||
installPhase = ''
|
|
||||||
cp -r $src/opt/intel/oneapi/ $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = let
|
|
||||||
pkgs = mapAttrs
|
|
||||||
(folder: version: symlinkJoin {
|
|
||||||
pname = "intel-${folder}";
|
|
||||||
inherit version;
|
|
||||||
paths = ["${finalAttrs.finalPackage}/${folder}/${version}"];
|
|
||||||
})
|
|
||||||
_components;
|
|
||||||
in pkgs // {
|
|
||||||
inherit unpatched;
|
|
||||||
pkgs = recurseIntoAttrs pkgs;
|
|
||||||
components = _components;
|
|
||||||
|
|
||||||
# This contains all packages properly symlinked into toplevel directories
|
|
||||||
# in $out.
|
|
||||||
#
|
|
||||||
# NOTE: there are clashes with packages that have symlinks outside their
|
|
||||||
# scope (libtcm and env/vars.sh)
|
|
||||||
all = symlinkJoin {
|
|
||||||
pname = finalAttrs.finalPackage + "-symlinked";
|
|
||||||
inherit (finalAttrs.finalPackage) version;
|
|
||||||
paths = filter lib.isDerivation (attrValues finalAttrs.finalPackage.pkgs);
|
|
||||||
};
|
|
||||||
|
|
||||||
stdenv = overrideCC stdenv finalAttrs.finalPackage.cc;
|
|
||||||
|
|
||||||
cc = wrapIntel {
|
|
||||||
cc = finalAttrs.finalPackage.pkgs.compiler;
|
|
||||||
extraBuildCommands = ''
|
|
||||||
wrap icx $wrapper $ccPath/icx
|
|
||||||
wrap icpx $wrapper $ccPath/icpx
|
|
||||||
wrap ifx $wrapper $ccPath/ifx
|
|
||||||
|
|
||||||
ln -s $out/bin/icpx $out/bin/c++
|
|
||||||
ln -s $out/bin/icx $out/bin/cc
|
|
||||||
|
|
||||||
# Use this to detect when a compiler subprocess is called
|
|
||||||
# from icpx (--fsycl-host-compiler)
|
|
||||||
echo 'export "NIX_CC_WRAPPER_INTEL=1"' >> $out/nix-support/cc-wrapper-hook
|
|
||||||
|
|
||||||
sed -i 's/.*isCxx=0/isCxx=1/' $out/bin/icpx
|
|
||||||
|
|
||||||
# oneMath looks for sycl libraries in bin/../lib
|
|
||||||
ln -s ${finalAttrs.finalPackage.pkgs.compiler}/lib $out/lib
|
|
||||||
ln -s ${finalAttrs.finalPackage.pkgs.compiler}/include $out/include
|
|
||||||
'';
|
|
||||||
extraInstall = ''
|
|
||||||
export named_cc="icx"
|
|
||||||
export named_cxx="icpx"
|
|
||||||
export named_fc="ifx"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}))
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env -S jq -f
|
|
||||||
|
|
||||||
def extract_fields: {
|
|
||||||
pname : .Package,
|
|
||||||
version : .Version,
|
|
||||||
provides : .Package | sub("[0-9.-]*$"; ""),
|
|
||||||
filename : .Filename,
|
|
||||||
size : ."Installed-Size" | tonumber,
|
|
||||||
sha256 : .SHA256,
|
|
||||||
dependencies : .Depends,
|
|
||||||
} ;
|
|
||||||
|
|
||||||
# parses dependencies into a list of [{.pname, .kind, .version}]
|
|
||||||
# some dependencies do not have a version specified, in which case, kind = version = null
|
|
||||||
#
|
|
||||||
# example dependencies:
|
|
||||||
# intel-oneapi-common-vars (>= 2023.0.0-25325), intel-oneapi-common-licensing-2023.0.0
|
|
||||||
|
|
||||||
def split_dependencies : map(try(.dependencies |= split(",\\s?"; "")) // .dependencies |= []) ;
|
|
||||||
|
|
||||||
def match_version : capture("(?<pname>[a-zA-Z0-9_\\-.]*) *(\\((?<kind>[<>=]*) *(?<version>.*)\\))?"; "") ;
|
|
||||||
|
|
||||||
def parse_dependencies : map_values(.dependencies.[] |= match_version) ;
|
|
||||||
|
|
||||||
def sort_version_decreasing : sort_by(.version | split("[-.]"; "") | map(tonumber)) | reverse ;
|
|
||||||
|
|
||||||
map(extract_fields) | split_dependencies | parse_dependencies | sort_version_decreasing
|
|
||||||
|
|
||||||
# [.[] | select(.pname == "intel-hpckit") | .version]
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env -S awk -f
|
|
||||||
|
|
||||||
BEGIN {
|
|
||||||
FS=": "
|
|
||||||
|
|
||||||
prev_empty=1
|
|
||||||
t=" "
|
|
||||||
|
|
||||||
print "[ {"
|
|
||||||
}
|
|
||||||
|
|
||||||
!NF { # empty line, update separator so next non empty line closes the dict
|
|
||||||
prev_empty=1
|
|
||||||
t="},\n{ "
|
|
||||||
next # skip line (we won't match anything else)
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
printf t "\"%s\" : \"%s\"\n", $1, $2
|
|
||||||
|
|
||||||
if (prev_empty) {
|
|
||||||
# we were the first after a group of empty lines, following ones have to
|
|
||||||
# have a comma
|
|
||||||
prev_empty=0
|
|
||||||
t=", "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
END { print "} ]" }
|
|
||||||
@@ -1,11 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
out_64=$(mktemp intel-api.64.XXXXXX)
|
curl https://apt.repos.intel.com/oneapi/dists/all/main/binary-amd64/Packages -o amd64-packages
|
||||||
out_all=$(mktemp intel-api.all.XXXXXX)
|
curl https://apt.repos.intel.com/oneapi/dists/all/main/binary-all/Packages -o all-packages
|
||||||
trap 'rm -f "$out_64" "$out_all"' EXIT INT HUP
|
|
||||||
|
|
||||||
curl https://apt.repos.intel.com/oneapi/dists/all/main/binary-amd64/Packages -o "$out_64"
|
|
||||||
curl https://apt.repos.intel.com/oneapi/dists/all/main/binary-all/Packages -o "$out_all"
|
|
||||||
|
|
||||||
# NOTE: we use `jq -r tostring` to minify the json (3.2Mb -> 2.3Mb)
|
|
||||||
cat "$out_64" "$out_all" | ./toJson.awk | ./process.jq | jq -r tostring >packages.json
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
{ stdenv, lib, fetchFromGitHub, numactl, pkg-config }:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "11.2.185";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "libpsm2";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
preConfigure= ''
|
|
||||||
export UDEVDIR=$out/etc/udev
|
|
||||||
substituteInPlace ./Makefile --replace "udevrulesdir}" "prefix}/etc/udev";
|
|
||||||
'';
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
buildInputs = [ numactl pkg-config ];
|
|
||||||
|
|
||||||
installFlags = [
|
|
||||||
"DESTDIR=$(out)"
|
|
||||||
"UDEVDIR=/etc/udev"
|
|
||||||
"LIBPSM2_COMPAT_CONF_DIR=/etc"
|
|
||||||
];
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "intel";
|
|
||||||
repo = "opa-psm2";
|
|
||||||
rev = "PSM2_${version}";
|
|
||||||
sha256 = "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg";
|
|
||||||
};
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mv $out/usr/* $out
|
|
||||||
rmdir $out/usr
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://github.com/intel/opa-psm2";
|
|
||||||
description = "The PSM2 library supports a number of fabric media and stacks";
|
|
||||||
license = with licenses; [ gpl2 bsd3 ];
|
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
maintainers = [ maintainers.bzizou ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,7 @@
|
|||||||
stdenv
|
stdenv
|
||||||
, lib
|
, lib
|
||||||
, gcc
|
, gcc
|
||||||
, gcc13
|
|
||||||
, clangOmpss2Unwrapped
|
, clangOmpss2Unwrapped
|
||||||
, writeShellScript
|
|
||||||
, openmp ? null
|
, openmp ? null
|
||||||
, wrapCCWith
|
, wrapCCWith
|
||||||
, llvmPackages_latest
|
, llvmPackages_latest
|
||||||
@@ -39,7 +37,10 @@ let
|
|||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
||||||
|
in wrapCCWith {
|
||||||
|
inherit cc bintools;
|
||||||
|
# extraPackages adds packages to depsTargetTargetPropagated
|
||||||
|
extraPackages = optional (openmp != null) openmp;
|
||||||
extraBuildCommands = ''
|
extraBuildCommands = ''
|
||||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags
|
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags
|
||||||
@@ -56,9 +57,8 @@ let
|
|||||||
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
||||||
|
|
||||||
wrap clang++ $wrapper $ccPath/clang++
|
wrap clang++ $wrapper $ccPath/clang++
|
||||||
'';
|
|
||||||
|
|
||||||
envExports = lib.optionalString (openmp != null) ''
|
'' + optionalString (openmp != null) ''
|
||||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + optionalString (ompss2rt != null) ''
|
'' + optionalString (ompss2rt != null) ''
|
||||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
@@ -66,42 +66,5 @@ let
|
|||||||
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
||||||
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'';
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
extraPackages = optional (openmp != null) openmp;
|
|
||||||
|
|
||||||
wrappedCC = wrapCCWith {
|
|
||||||
# extraPackages adds packages to depsTargetTargetPropagated
|
|
||||||
inherit cc bintools extraPackages;
|
|
||||||
extraBuildCommands = extraBuildCommands + envExports;
|
|
||||||
};
|
|
||||||
|
|
||||||
resetIntelCCFlags = let tconf = builtins.replaceStrings ["-"] ["_"] targetConfig;
|
|
||||||
in writeShellScript "remove-intel.sh" ''
|
|
||||||
if [ "''${NIX_CC_WRAPPER_INTEL:-0}" = 1 ]; then
|
|
||||||
unset NIX_CFLAGS_COMPILE_${tconf}
|
|
||||||
unset NIX_CC_WRAPPER_FLAGS_SET_${tconf}
|
|
||||||
|
|
||||||
if (( "''${NIX_DEBUG:-0}" >= 1 )); then
|
|
||||||
echo "ompss2: cleaned NIX_CFLAGS_COMPILE_${tconf} (invokation from intel compiler detected)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
intelExtraBuildCommands = ''
|
|
||||||
sed -i 's|# Flirting.*|source ${resetIntelCCFlags}\n\n&|' $out/bin/clang
|
|
||||||
sed -i 's|# Flirting.*|source ${resetIntelCCFlags}\n\n&|' $out/bin/clang++
|
|
||||||
'';
|
|
||||||
|
|
||||||
wrappedCCIntel = wrapCCWith {
|
|
||||||
inherit bintools extraPackages;
|
|
||||||
cc = cc.override { gcc = gcc13; }; # Intel uses gcc13, so we have to match it
|
|
||||||
gccForLibs = gcc13;
|
|
||||||
# extraPackages adds packages to depsTargetTargetPropagated
|
|
||||||
extraBuildCommands = intelExtraBuildCommands + envExports;
|
|
||||||
};
|
|
||||||
|
|
||||||
in wrappedCC.overrideAttrs (oldAttrs: {
|
|
||||||
passthru = oldAttrs.passthru // {
|
|
||||||
forIcpx = wrappedCCIntel;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -1,219 +0,0 @@
|
|||||||
{ lib, fetchurl, fetchFromGitHub, callPackage
|
|
||||||
, storeDir ? "/nix/store"
|
|
||||||
, stateDir ? "/nix/var"
|
|
||||||
, confDir ? "/etc"
|
|
||||||
, boehmgc
|
|
||||||
, stdenv, llvmPackages_6
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
common =
|
|
||||||
{ lib, stdenv, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
|
|
||||||
, bash, coreutils, gzip, gnutar
|
|
||||||
, pkg-config, boehmgc, perlPackages, libsodium, brotli, boost, editline, nlohmann_json
|
|
||||||
, autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
|
|
||||||
, jq, libarchive, rustc, cargo
|
|
||||||
# Used by tests
|
|
||||||
, gmock
|
|
||||||
, busybox-sandbox-shell
|
|
||||||
, storeDir
|
|
||||||
, stateDir
|
|
||||||
, confDir
|
|
||||||
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
|
|
||||||
, withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
|
|
||||||
|
|
||||||
, name, suffix ? "", src, crates ? null
|
|
||||||
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
sh = busybox-sandbox-shell;
|
|
||||||
nix = stdenv.mkDerivation rec {
|
|
||||||
inherit name src;
|
|
||||||
version = lib.getVersion name;
|
|
||||||
|
|
||||||
is24 = lib.versionAtLeast version "2.4pre";
|
|
||||||
isExactly23 = lib.versionAtLeast version "2.3" && lib.versionOlder version "2.4";
|
|
||||||
|
|
||||||
VERSION_SUFFIX = suffix;
|
|
||||||
|
|
||||||
outputs = [ "out" "dev" "man" "doc" ];
|
|
||||||
|
|
||||||
nativeBuildInputs =
|
|
||||||
[ pkg-config ]
|
|
||||||
++ lib.optionals is24 [ autoreconfHook autoconf-archive bison flex libxml2 libxslt
|
|
||||||
docbook5 docbook_xsl_ns jq gmock ];
|
|
||||||
|
|
||||||
buildInputs =
|
|
||||||
[ curl openssl sqlite xz bzip2 nlohmann_json
|
|
||||||
brotli boost editline
|
|
||||||
]
|
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
|
||||||
++ lib.optionals is24 [ libarchive rustc cargo ]
|
|
||||||
++ lib.optional withLibseccomp libseccomp
|
|
||||||
++ lib.optional withAWS
|
|
||||||
((aws-sdk-cpp.override {
|
|
||||||
apis = ["s3" "transfer"];
|
|
||||||
customMemoryManagement = false;
|
|
||||||
}).overrideDerivation (args: {
|
|
||||||
patches = args.patches or [] ++ [(fetchpatch {
|
|
||||||
url = "https://github.com/edolstra/aws-sdk-cpp/commit/7d58e303159b2fb343af9a1ec4512238efa147c7.patch";
|
|
||||||
sha256 = "103phn6kyvs1yc7fibyin3lgxz699qakhw671kl207484im55id1";
|
|
||||||
})];
|
|
||||||
}));
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ boehmgc ];
|
|
||||||
|
|
||||||
# Seems to be required when using std::atomic with 64-bit types
|
|
||||||
NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux" || stdenv.hostPlatform.system == "armv6l-linux") "-latomic";
|
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
|
||||||
''
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
|
|
||||||
rm -f $out/lib/*.a
|
|
||||||
${lib.optionalString stdenv.isLinux ''
|
|
||||||
chmod u+w $out/lib/*.so.*
|
|
||||||
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
|
|
||||||
''}
|
|
||||||
'' +
|
|
||||||
# Unpack the Rust crates.
|
|
||||||
lib.optionalString is24 ''
|
|
||||||
tar xvf ${crates} -C nix-rust/
|
|
||||||
mv nix-rust/nix-vendored-crates* nix-rust/vendor
|
|
||||||
'' +
|
|
||||||
# For Nix-2.3, patch around an issue where the Nix configure step pulls in the
|
|
||||||
# build system's bash and other utilities when cross-compiling
|
|
||||||
lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) ''
|
|
||||||
mkdir tmp/
|
|
||||||
substitute corepkgs/config.nix.in tmp/config.nix.in \
|
|
||||||
--subst-var-by bash ${bash}/bin/bash \
|
|
||||||
--subst-var-by coreutils ${coreutils}/bin \
|
|
||||||
--subst-var-by bzip2 ${bzip2}/bin/bzip2 \
|
|
||||||
--subst-var-by gzip ${gzip}/bin/gzip \
|
|
||||||
--subst-var-by xz ${xz}/bin/xz \
|
|
||||||
--subst-var-by tar ${gnutar}/bin/tar \
|
|
||||||
--subst-var-by tr ${coreutils}/bin/tr
|
|
||||||
mv tmp/config.nix.in corepkgs/config.nix.in
|
|
||||||
'';
|
|
||||||
|
|
||||||
configureFlags =
|
|
||||||
[ "--with-store-dir=${storeDir}"
|
|
||||||
"--localstatedir=${stateDir}"
|
|
||||||
"--sysconfdir=${confDir}"
|
|
||||||
"--disable-init-state"
|
|
||||||
"--enable-gc"
|
|
||||||
]
|
|
||||||
++ lib.optionals stdenv.isLinux [
|
|
||||||
"--with-sandbox-shell=${sh}/bin/busybox"
|
|
||||||
]
|
|
||||||
++ lib.optional (
|
|
||||||
stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform ? nix && stdenv.hostPlatform.nix ? system
|
|
||||||
) ''--with-system=${stdenv.hostPlatform.nix.system}''
|
|
||||||
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
|
|
||||||
++ lib.optional (!withLibseccomp) "--disable-seccomp-sandboxing";
|
|
||||||
|
|
||||||
makeFlags = [ "profiledir=$(out)/etc/profile.d" ];
|
|
||||||
|
|
||||||
installFlags = [ "sysconfdir=$(out)/etc" ];
|
|
||||||
|
|
||||||
doInstallCheck = false;
|
|
||||||
|
|
||||||
# socket path becomes too long otherwise
|
|
||||||
#preInstallCheck = lib.optional stdenv.isDarwin ''
|
|
||||||
# export TMPDIR=$NIX_BUILD_TOP
|
|
||||||
#'';
|
|
||||||
|
|
||||||
separateDebugInfo = stdenv.isLinux;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Powerful package manager that makes package management reliable and reproducible";
|
|
||||||
longDescription = ''
|
|
||||||
Nix is a powerful package manager for Linux and other Unix systems that
|
|
||||||
makes package management reliable and reproducible. It provides atomic
|
|
||||||
upgrades and rollbacks, side-by-side installation of multiple versions of
|
|
||||||
a package, multi-user package management and easy setup of build
|
|
||||||
environments.
|
|
||||||
'';
|
|
||||||
homepage = "https://nixos.org/";
|
|
||||||
license = lib.licenses.lgpl2Plus;
|
|
||||||
maintainers = [ lib.maintainers.eelco ];
|
|
||||||
platforms = lib.platforms.unix;
|
|
||||||
outputsToInstall = [ "out" "man" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
perl-bindings = stdenv.mkDerivation {
|
|
||||||
pname = "nix-perl";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
postUnpack = "sourceRoot=$sourceRoot/perl";
|
|
||||||
|
|
||||||
# This is not cross-compile safe, don't have time to fix right now
|
|
||||||
# but noting for future travellers.
|
|
||||||
nativeBuildInputs =
|
|
||||||
[ perl pkg-config curl nix libsodium boost autoreconfHook autoconf-archive ];
|
|
||||||
|
|
||||||
configureFlags =
|
|
||||||
[ "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
|
|
||||||
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = "export NIX_STATE_DIR=$TMPDIR";
|
|
||||||
|
|
||||||
preBuild = "unset NIX_INDENT_MAKE";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in nix;
|
|
||||||
|
|
||||||
in rec {
|
|
||||||
|
|
||||||
nix = nixUnstable;
|
|
||||||
|
|
||||||
nixUnstable = lib.lowPrio (callPackage common rec {
|
|
||||||
name = "nix-2.4${suffix}";
|
|
||||||
suffix = "pre7534_b92f58f6";
|
|
||||||
|
|
||||||
#src = /home/Computational/rarias/nix/nix-rodarima;
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "rodarima";
|
|
||||||
repo = "nix";
|
|
||||||
rev = "3a642187c33ed46d952d3a50a83b2576b704fab7";
|
|
||||||
sha256 = "0s8is2czpkcj1x1kcjqgbnsbbl03w3fwjjiclsd44zh1ij3wb90s";
|
|
||||||
};
|
|
||||||
|
|
||||||
crates = fetchurl {
|
|
||||||
url = "https://hydra.nixos.org/build/118797694/download/1/nix-vendored-crates-2.4pre7534_b92f58f6.tar.xz";
|
|
||||||
sha256 = "a4c2612bbd81732bbb899bc0c230e07b16f6b6150ffbb19c4907dedbbc2bf9fc";
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit storeDir stateDir confDir boehmgc;
|
|
||||||
});
|
|
||||||
|
|
||||||
nixFlakes = lib.lowPrio (callPackage common rec {
|
|
||||||
name = "nix-2.4${suffix}";
|
|
||||||
suffix = "pre20200521_00b562c";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nix";
|
|
||||||
rev = "00b562c87ec4c3bbe514f5dc1f4d1c41f66f66bf";
|
|
||||||
sha256 = "0s8is2czpkcj1x1kcjqgbnsbbl03w3fwjjiclsd44zh1ij3wb90s";
|
|
||||||
};
|
|
||||||
|
|
||||||
crates = fetchurl {
|
|
||||||
url = "https://hydra.nixos.org/build/118093786/download/1/nix-vendored-crates-2.4pre20200501_941f952.tar.xz";
|
|
||||||
sha256 = "060f4n5srdbb8vsj0m14aqch7im79a4h5g3nrs41p1xc602vhcdl";
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit storeDir stateDir confDir boehmgc;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
{ lib, fetchurl, fetchFromGitHub, callPackage
|
|
||||||
, storeDir ? "/nix/store"
|
|
||||||
, stateDir ? "/nix/var"
|
|
||||||
, confDir ? "/etc"
|
|
||||||
, boehmgc
|
|
||||||
, stdenv, llvmPackages_6
|
|
||||||
, sandbox-shell ? "/bin/sh"
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
enableStatic = true;
|
|
||||||
|
|
||||||
common =
|
|
||||||
{ lib, stdenv, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
|
|
||||||
, bash, coreutils, gzip, gnutar
|
|
||||||
, pkg-config, boehmgc, perlPackages, libsodium, brotli, boost, editline, nlohmann_json
|
|
||||||
, autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
|
|
||||||
, jq, libarchive
|
|
||||||
# Used by tests
|
|
||||||
, gmock
|
|
||||||
, storeDir
|
|
||||||
, stateDir
|
|
||||||
, confDir
|
|
||||||
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
|
|
||||||
, withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp
|
|
||||||
, enableStatic ? true
|
|
||||||
, name, suffix ? "", src
|
|
||||||
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
nix = stdenv.mkDerivation rec {
|
|
||||||
inherit name src;
|
|
||||||
version = lib.getVersion name;
|
|
||||||
|
|
||||||
is24 = lib.versionAtLeast version "2.4pre";
|
|
||||||
isExactly23 = lib.versionAtLeast version "2.3" && lib.versionOlder version "2.4";
|
|
||||||
|
|
||||||
VERSION_SUFFIX = suffix;
|
|
||||||
|
|
||||||
outputs = [ "out" "dev" "man" "doc" ];
|
|
||||||
|
|
||||||
nativeBuildInputs =
|
|
||||||
[ pkg-config ]
|
|
||||||
++ lib.optionals is24 [ autoreconfHook autoconf-archive bison flex libxml2 libxslt
|
|
||||||
docbook5 docbook_xsl_ns jq ];
|
|
||||||
|
|
||||||
buildInputs =
|
|
||||||
[ curl openssl sqlite xz bzip2 nlohmann_json
|
|
||||||
brotli boost editline boehmgc
|
|
||||||
]
|
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
|
||||||
++ lib.optionals is24 [ libarchive gmock ]
|
|
||||||
++ lib.optional withLibseccomp libseccomp
|
|
||||||
++ lib.optional withAWS
|
|
||||||
((aws-sdk-cpp.override {
|
|
||||||
apis = ["s3" "transfer"];
|
|
||||||
customMemoryManagement = false;
|
|
||||||
}).overrideDerivation (args: {
|
|
||||||
patches = args.patches or [] ++ [(fetchpatch {
|
|
||||||
url = "https://github.com/edolstra/aws-sdk-cpp/commit/7d58e303159b2fb343af9a1ec4512238efa147c7.patch";
|
|
||||||
sha256 = "103phn6kyvs1yc7fibyin3lgxz699qakhw671kl207484im55id1";
|
|
||||||
})];
|
|
||||||
}));
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ boehmgc ];
|
|
||||||
|
|
||||||
# Seems to be required when using std::atomic with 64-bit types
|
|
||||||
NIX_LDFLAGS =
|
|
||||||
# need to list libraries individually until
|
|
||||||
# https://github.com/NixOS/nix/commit/3e85c57a6cbf46d5f0fe8a89b368a43abd26daba
|
|
||||||
# is in a release
|
|
||||||
lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto"
|
|
||||||
|
|
||||||
# need to detect it here until
|
|
||||||
# https://github.com/NixOS/nix/commits/74b4737d8f0e1922ef5314a158271acf81cd79f8
|
|
||||||
# is in a release
|
|
||||||
+ lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux" || stdenv.hostPlatform.system == "armv6l-linux") "-latomic";
|
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
|
||||||
lib.optionalString (!enableStatic) ''
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
|
|
||||||
rm -f $out/lib/*.a
|
|
||||||
${lib.optionalString stdenv.isLinux ''
|
|
||||||
chmod u+w $out/lib/*.so.*
|
|
||||||
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
|
|
||||||
''}
|
|
||||||
'' +
|
|
||||||
# For Nix-2.3, patch around an issue where the Nix configure step pulls in the
|
|
||||||
# build system's bash and other utilities when cross-compiling
|
|
||||||
lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) ''
|
|
||||||
mkdir tmp/
|
|
||||||
substitute corepkgs/config.nix.in tmp/config.nix.in \
|
|
||||||
--subst-var-by bash ${bash}/bin/bash \
|
|
||||||
--subst-var-by coreutils ${coreutils}/bin \
|
|
||||||
--subst-var-by bzip2 ${bzip2}/bin/bzip2 \
|
|
||||||
--subst-var-by gzip ${gzip}/bin/gzip \
|
|
||||||
--subst-var-by xz ${xz}/bin/xz \
|
|
||||||
--subst-var-by tar ${gnutar}/bin/tar \
|
|
||||||
--subst-var-by tr ${coreutils}/bin/tr
|
|
||||||
mv tmp/config.nix.in corepkgs/config.nix.in
|
|
||||||
'';
|
|
||||||
|
|
||||||
configureFlags =
|
|
||||||
[ "--with-store-dir=${storeDir}"
|
|
||||||
"--localstatedir=${stateDir}"
|
|
||||||
"--sysconfdir=${confDir}"
|
|
||||||
"--disable-init-state"
|
|
||||||
"--enable-gc"
|
|
||||||
]
|
|
||||||
++ lib.optionals stdenv.isLinux [
|
|
||||||
"--with-sandbox-shell=${sandbox-shell}"
|
|
||||||
]
|
|
||||||
++ lib.optional (
|
|
||||||
stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform ? nix && stdenv.hostPlatform.nix ? system
|
|
||||||
) ''--with-system=${stdenv.hostPlatform.nix.system}''
|
|
||||||
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
|
|
||||||
++ lib.optional (!withLibseccomp) "--disable-seccomp-sandboxing";
|
|
||||||
|
|
||||||
makeFlags = [ "profiledir=$(out)/etc/profile.d" ]
|
|
||||||
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0";
|
|
||||||
|
|
||||||
installFlags = [ "sysconfdir=$(out)/etc" ];
|
|
||||||
|
|
||||||
doInstallCheck = true; # not cross
|
|
||||||
|
|
||||||
# socket path becomes too long otherwise
|
|
||||||
preInstallCheck = lib.optional stdenv.isDarwin ''
|
|
||||||
export TMPDIR=$NIX_BUILD_TOP
|
|
||||||
'';
|
|
||||||
|
|
||||||
separateDebugInfo = stdenv.isLinux;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Powerful package manager that makes package management reliable and reproducible";
|
|
||||||
longDescription = ''
|
|
||||||
Nix is a powerful package manager for Linux and other Unix systems that
|
|
||||||
makes package management reliable and reproducible. It provides atomic
|
|
||||||
upgrades and rollbacks, side-by-side installation of multiple versions of
|
|
||||||
a package, multi-user package management and easy setup of build
|
|
||||||
environments.
|
|
||||||
'';
|
|
||||||
homepage = "https://nixos.org/";
|
|
||||||
license = lib.licenses.lgpl2Plus;
|
|
||||||
maintainers = [ lib.maintainers.eelco ];
|
|
||||||
platforms = lib.platforms.unix;
|
|
||||||
outputsToInstall = [ "out" "man" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
perl-bindings = stdenv.mkDerivation {
|
|
||||||
pname = "nix-perl";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
inherit src;
|
|
||||||
|
|
||||||
postUnpack = "sourceRoot=$sourceRoot/perl";
|
|
||||||
|
|
||||||
# This is not cross-compile safe, don't have time to fix right now
|
|
||||||
# but noting for future travellers.
|
|
||||||
nativeBuildInputs =
|
|
||||||
[ perl pkg-config curl nix libsodium boost autoreconfHook autoconf-archive ];
|
|
||||||
|
|
||||||
configureFlags =
|
|
||||||
[ "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
|
|
||||||
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = "export NIX_STATE_DIR=$TMPDIR";
|
|
||||||
|
|
||||||
preBuild = "unset NIX_INDENT_MAKE";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in nix;
|
|
||||||
|
|
||||||
in rec {
|
|
||||||
|
|
||||||
nix = nixStable;
|
|
||||||
|
|
||||||
nixStable = callPackage common (rec {
|
|
||||||
name = "nix-2.3.7";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://nixos.org/releases/nix/${name}/${name}.tar.xz";
|
|
||||||
sha256 = "dd8f52849414e5a878afe7e797aa4e22bab77c875d9da5a38d5f1bada704e596";
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit storeDir stateDir confDir boehmgc;
|
|
||||||
} // lib.optionalAttrs stdenv.cc.isClang {
|
|
||||||
stdenv = llvmPackages_6.stdenv;
|
|
||||||
});
|
|
||||||
|
|
||||||
nixUnstable = lib.lowPrio (callPackage common rec {
|
|
||||||
name = "nix-2.4${suffix}";
|
|
||||||
suffix = "pre20200721_ff314f1";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nix";
|
|
||||||
rev = "ff314f186e3f91d87af6ad96c0ae3b472494b940";
|
|
||||||
hash = "sha256-QibpLo4/gf2xYGoeQcgjZzH/qy5TBRVH+QCHgqOwur0=";
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit storeDir stateDir confDir boehmgc;
|
|
||||||
});
|
|
||||||
|
|
||||||
nixFlakes = nixUnstable;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This post build hook sends the closure of the just built derivation to the
|
|
||||||
# target machine. In our case this is the MareNostrum4 cluster.
|
|
||||||
|
|
||||||
# set -e fails as the profile runs some erroring programs
|
|
||||||
# We need the profile to load nix in the $PATH
|
|
||||||
. /etc/profile
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
set -f # disable globbing
|
|
||||||
export IFS=' '
|
|
||||||
nixroot=/gpfs/projects/bsc15/nix
|
|
||||||
store=$nixroot/nix/store
|
|
||||||
target=ssh://mn
|
|
||||||
|
|
||||||
nix copy --to $target $OUT_PATHS
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, perl
|
||||||
, numactl
|
, numactl
|
||||||
, hwloc
|
, hwloc
|
||||||
, boost
|
, boost
|
||||||
@@ -10,7 +11,6 @@
|
|||||||
, ovni
|
, ovni
|
||||||
, nosv
|
, nosv
|
||||||
, clangOmpss2
|
, clangOmpss2
|
||||||
, which
|
|
||||||
, useGit ? false
|
, useGit ? false
|
||||||
, gitUrl ? "ssh://git@gitlab-internal.bsc.es/nos-v/nodes.git"
|
, gitUrl ? "ssh://git@gitlab-internal.bsc.es/nos-v/nodes.git"
|
||||||
, gitBranch ? "master"
|
, gitBranch ? "master"
|
||||||
@@ -59,7 +59,6 @@ in
|
|||||||
doCheck = false;
|
doCheck = false;
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [
|
||||||
clangOmpss2
|
clangOmpss2
|
||||||
which
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# The "bindnow" flags are incompatible with ifunc resolution mechanism. We
|
# The "bindnow" flags are incompatible with ifunc resolution mechanism. We
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, fetchFromGitHub
|
|
||||||
, cmake
|
|
||||||
, withCFlags
|
|
||||||
, intelPackages
|
|
||||||
|
|
||||||
, mklSupport ? true
|
|
||||||
|
|
||||||
, config
|
|
||||||
|
|
||||||
, cudaSupport ? config.cudaSupport
|
|
||||||
, cudaPackages ? { }
|
|
||||||
|
|
||||||
, rocmSupport ? config.rocmSupport
|
|
||||||
, hipTargets ? null # only one target at a time supported
|
|
||||||
, rocmPackages ? { }
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
# rocmSupport is not enough, we need a specific target
|
|
||||||
enableHip = rocmSupport && hipTargets != null;
|
|
||||||
|
|
||||||
stdenv = withCFlags (lib.optionals cudaSupport [ "--cuda-path=${cudaPackages.cudatoolkit}" ]) intelPackages.stdenv;
|
|
||||||
in
|
|
||||||
|
|
||||||
# at least one backend has to be enabled
|
|
||||||
assert mklSupport || cudaSupport || enableHip;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "oneMath";
|
|
||||||
version = "0.8";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "uxlfoundation";
|
|
||||||
repo = "oneMath";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "sha256-xK8lKI3oqKlx3xtvdScpMq+HXAuoYCP0BZdkEqnJP5o=";
|
|
||||||
};
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
(lib.cmakeBool "ENABLE_MKLCPU_BACKEND" mklSupport)
|
|
||||||
(lib.cmakeBool "ENABLE_MKLGPU_BACKEND" mklSupport)
|
|
||||||
|
|
||||||
(lib.cmakeBool "ENABLE_CUBLAS_BACKEND" cudaSupport)
|
|
||||||
(lib.cmakeBool "ENABLE_CUFFT_BACKEND" cudaSupport)
|
|
||||||
(lib.cmakeBool "ENABLE_CURAND_BACKEND" cudaSupport)
|
|
||||||
(lib.cmakeBool "ENABLE_CUSOLVER_BACKEND" cudaSupport)
|
|
||||||
(lib.cmakeBool "ENABLE_CUSPARSE_BACKEND" cudaSupport)
|
|
||||||
|
|
||||||
(lib.cmakeBool "ENABLE_ROCBLAS_BACKEND" enableHip)
|
|
||||||
(lib.cmakeBool "ENABLE_ROCFFT_BACKEND" enableHip)
|
|
||||||
(lib.cmakeBool "ENABLE_ROCSOLVER_BACKEND" enableHip)
|
|
||||||
(lib.cmakeBool "ENABLE_ROCRAND_BACKEND" enableHip)
|
|
||||||
(lib.cmakeBool "ENABLE_ROCSPARSE_BACKEND" enableHip)
|
|
||||||
|
|
||||||
(lib.cmakeBool "BUILD_FUNCTIONAL_TESTS" false)
|
|
||||||
(lib.cmakeBool "BUILD_EXAMPLES" false)
|
|
||||||
] ++ lib.optionals enableHip [
|
|
||||||
(lib.cmakeFeature "HIP_TARGETS" hipTargets)
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
|
||||||
buildInputs = lib.optionals (mklSupport) [
|
|
||||||
intelPackages.mkl
|
|
||||||
intelPackages.tbb
|
|
||||||
] ++ lib.optionals (enableHip) [
|
|
||||||
rocmPackages.rocmPath
|
|
||||||
rocmPackages.rocblas
|
|
||||||
rocmPackages.rocfft
|
|
||||||
rocmPackages.rocsolver
|
|
||||||
rocmPackages.rocrand
|
|
||||||
rocmPackages.rocsparse
|
|
||||||
] ++ lib.optionals (cudaSupport) [
|
|
||||||
(lib.getDev cudaPackages.cuda_cudart)
|
|
||||||
cudaPackages.cudatoolkit
|
|
||||||
|
|
||||||
cudaPackages.libcublas
|
|
||||||
cudaPackages.libcurand
|
|
||||||
cudaPackages.libcufft
|
|
||||||
cudaPackages.libcusparse
|
|
||||||
cudaPackages.libcusolver
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, fetchpatch, gfortran, perl, libnl
|
|
||||||
, rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
|
|
||||||
, libpsm2, libfabric, pmix, pmi2, ucx
|
|
||||||
|
|
||||||
# Enable CUDA support
|
|
||||||
, cudaSupport ? false, cudatoolkit ? null
|
|
||||||
|
|
||||||
# Enable the Sun Grid Engine bindings
|
|
||||||
, enableSGE ? false
|
|
||||||
|
|
||||||
# Pass PATH/LD_LIBRARY_PATH to point to current mpirun by default
|
|
||||||
, enablePrefix ? false
|
|
||||||
|
|
||||||
# Enable libfabric support (necessary for Omnipath networks) on x86_64 linux
|
|
||||||
, fabricSupport ? stdenv.isLinux && stdenv.isx86_64
|
|
||||||
|
|
||||||
# Enable mpi_cxx.so
|
|
||||||
, enableCxx ? false
|
|
||||||
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert !cudaSupport || cudatoolkit != null;
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "4.0.4";
|
|
||||||
|
|
||||||
cudatoolkit_joined = symlinkJoin {
|
|
||||||
name = "${cudatoolkit.name}-unsplit";
|
|
||||||
paths = [ cudatoolkit.out cudatoolkit.lib ];
|
|
||||||
};
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "openmpi";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = with lib.versions; fetchurl {
|
|
||||||
url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
|
|
||||||
sha256 = "1i0slg2dxjdgw513aml1n9dsbdxn2fimi2b5712d5r9z4ar4xqj7";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./
|
|
||||||
|
|
||||||
# Ensure build is reproducible
|
|
||||||
ts=`date -d @$SOURCE_DATE_EPOCH`
|
|
||||||
sed -i 's/OPAL_CONFIGURE_USER=.*/OPAL_CONFIGURE_USER="nixbld"/' configure
|
|
||||||
sed -i 's/OPAL_CONFIGURE_HOST=.*/OPAL_CONFIGURE_HOST="localhost"/' configure
|
|
||||||
sed -i "s/OPAL_CONFIGURE_DATE=.*/OPAL_CONFIGURE_DATE=\"$ts\"/" configure
|
|
||||||
find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \;
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = with stdenv; [ gfortran zlib ]
|
|
||||||
++ lib.optionals isLinux [ libnl numactl pmix ucx ]
|
|
||||||
++ lib.optionals cudaSupport [ cudatoolkit ]
|
|
||||||
++ [ libevent hwloc ]
|
|
||||||
++ lib.optional (isLinux || isFreeBSD) rdma-core
|
|
||||||
++ lib.optional fabricSupport [ libpsm2 libfabric ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ perl ];
|
|
||||||
|
|
||||||
configureFlags = with stdenv; lib.optional (!cudaSupport) "--disable-mca-dso"
|
|
||||||
++ lib.optionals isLinux [
|
|
||||||
"--with-libnl=${libnl.dev}"
|
|
||||||
"--with-pmix=${pmix}"
|
|
||||||
"--with-pmix-libdir=${pmix}/lib"
|
|
||||||
"--with-pmi=${pmi2}"
|
|
||||||
"--with-pmi-libdir=${pmi2}/lib"
|
|
||||||
] ++ lib.optional enableSGE "--with-sge"
|
|
||||||
++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default"
|
|
||||||
# TODO: add UCX support, which is recommended to use with cuda for the most robust OpenMPI build
|
|
||||||
# https://github.com/openucx/ucx
|
|
||||||
# https://www.open-mpi.org/faq/?category=buildcuda
|
|
||||||
++ lib.optionals cudaSupport [ "--with-cuda=${cudatoolkit_joined}" "--enable-dlopen" ]
|
|
||||||
++ lib.optionals fabricSupport [ "--with-psm2=${libpsm2}" "--with-libfabric=${libfabric}" ]
|
|
||||||
++ lib.optional enableCxx "--enable-mpi-cxx"
|
|
||||||
;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
rm -f $out/lib/*.la
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
# default compilers should be indentical to the
|
|
||||||
# compilers at build time
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
|
|
||||||
$out/share/openmpi/mpicc-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
|
|
||||||
$out/share/openmpi/ortecc-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \
|
|
||||||
$out/share/openmpi/mpic++-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \
|
|
||||||
$out/share/openmpi/mpifort-wrapper-data.txt
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit cudaSupport cudatoolkit;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://www.open-mpi.org/";
|
|
||||||
description = "Open source MPI-3 implementation";
|
|
||||||
longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
|
|
||||||
maintainers = with maintainers; [ markuskowa ];
|
|
||||||
license = licenses.bsd3;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
# In order to use OpenMPI with Extrae we need to keep the Extrae libraries
|
|
||||||
# rather than the ones from OpenMPI. This happens with libompitrace.so, so
|
|
||||||
# we set to a lower priority (higher value) the OpenMPI package.
|
|
||||||
priority = 10;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
{ stdenv, lib, fetchurl, fetchpatch, gfortran, perl, libnl
|
|
||||||
, rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
|
|
||||||
, libpsm2, libfabric
|
|
||||||
|
|
||||||
# Enable CUDA support
|
|
||||||
, cudaSupport ? false, cudatoolkit ? null
|
|
||||||
|
|
||||||
# Enable the Sun Grid Engine bindings
|
|
||||||
, enableSGE ? false
|
|
||||||
|
|
||||||
# Pass PATH/LD_LIBRARY_PATH to point to current mpirun by default
|
|
||||||
, enablePrefix ? false
|
|
||||||
|
|
||||||
# Enable libfabric support (necessary for Omnipath networks) on x86_64 linux
|
|
||||||
, fabricSupport ? stdenv.isLinux && stdenv.isx86_64
|
|
||||||
|
|
||||||
# Enable mpi_cxx.so
|
|
||||||
, enableCxx ? false
|
|
||||||
|
|
||||||
, slurm
|
|
||||||
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert !cudaSupport || cudatoolkit != null;
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "4.0.3";
|
|
||||||
|
|
||||||
cudatoolkit_joined = symlinkJoin {
|
|
||||||
name = "${cudatoolkit.name}-unsplit";
|
|
||||||
paths = [ cudatoolkit.out cudatoolkit.lib ];
|
|
||||||
};
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "openmpi";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = with lib.versions; fetchurl {
|
|
||||||
url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
|
|
||||||
sha256 = "00zxcw99gr5n693cmcmn4f6a47vx1ywna895p0x7p163v37gw0hl";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./
|
|
||||||
|
|
||||||
# Ensure build is reproducible
|
|
||||||
ts=`date -d @$SOURCE_DATE_EPOCH`
|
|
||||||
sed -i 's/OPAL_CONFIGURE_USER=.*/OPAL_CONFIGURE_USER="nixbld"/' configure
|
|
||||||
sed -i 's/OPAL_CONFIGURE_HOST=.*/OPAL_CONFIGURE_HOST="localhost"/' configure
|
|
||||||
sed -i "s/OPAL_CONFIGURE_DATE=.*/OPAL_CONFIGURE_DATE=\"$ts\"/" configure
|
|
||||||
find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \;
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = with stdenv; [ gfortran zlib ]
|
|
||||||
++ lib.optionals isLinux [ libnl numactl ]
|
|
||||||
++ lib.optionals cudaSupport [ cudatoolkit ]
|
|
||||||
++ [ libevent hwloc ]
|
|
||||||
++ lib.optional (isLinux || isFreeBSD) rdma-core
|
|
||||||
++ lib.optional fabricSupport [ libpsm2 libfabric ]
|
|
||||||
++ [ slurm ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ perl ];
|
|
||||||
|
|
||||||
configureFlags = with stdenv; lib.optional (!cudaSupport) "--disable-mca-dso"
|
|
||||||
++ lib.optional isLinux "--with-libnl=${libnl.dev}"
|
|
||||||
++ lib.optional enableSGE "--with-sge"
|
|
||||||
++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default"
|
|
||||||
# TODO: add UCX support, which is recommended to use with cuda for the most robust OpenMPI build
|
|
||||||
# https://github.com/openucx/ucx
|
|
||||||
# https://www.open-mpi.org/faq/?category=buildcuda
|
|
||||||
++ lib.optionals cudaSupport [ "--with-cuda=${cudatoolkit_joined}" "--enable-dlopen" ]
|
|
||||||
++ lib.optionals fabricSupport [ "--with-psm2=${libpsm2}" "--with-libfabric=${libfabric}" ]
|
|
||||||
++ lib.optional enableCxx "--enable-mpi-cxx"
|
|
||||||
++ [ "--with-slurm=${slurm}" "--with-pmi" "--enable-static" "--disable-dlopen" ]
|
|
||||||
;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
rm -f $out/lib/*.la
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
# default compilers should be indentical to the
|
|
||||||
# compilers at build time
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
|
|
||||||
$out/share/openmpi/mpicc-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
|
|
||||||
$out/share/openmpi/ortecc-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \
|
|
||||||
$out/share/openmpi/mpic++-wrapper-data.txt
|
|
||||||
|
|
||||||
sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \
|
|
||||||
$out/share/openmpi/mpifort-wrapper-data.txt
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit cudaSupport cudatoolkit;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://www.open-mpi.org/";
|
|
||||||
description = "Open source MPI-3 implementation";
|
|
||||||
longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
|
|
||||||
maintainers = with maintainers; [ markuskowa ];
|
|
||||||
license = licenses.bsd3;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
# In order to use OpenMPI with Extrae we need to keep the Extrae libraries
|
|
||||||
# rather than the ones from OpenMPI. This happens with libompitrace.so, so
|
|
||||||
# we set to a lower priority (higher value) the OpenMPI package.
|
|
||||||
priority = 10;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
#, mkDerivation
|
|
||||||
, fetchurl
|
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
version = "1.2.18";
|
|
||||||
pname = "otf";
|
|
||||||
src = fetchurl {
|
|
||||||
url =
|
|
||||||
"http://paratools01.rrp.net/wp-content/uploads/2016/06/OTF-SRC-${version}.tar.gz";
|
|
||||||
sha256 = "10k1hyyn6w4lf5kbn1krfacaspvn1xg3qgn4027xal3hjf3kkxap";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [ ./printf.patch ];
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- a/tools/otfconfig/otfconfig.c 2020-11-21 13:55:23.195530435 +0100
|
|
||||||
+++ b/tools/otfconfig/otfconfig.c 2020-11-21 13:55:53.112402154 +0100
|
|
||||||
@@ -75,7 +75,7 @@ int main( int argc, char** argv ) {
|
|
||||||
|
|
||||||
strcat( tmp, "\n" );
|
|
||||||
|
|
||||||
- printf( tmp );
|
|
||||||
+ printf("%s", tmp );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
{ lib, stdenv, kernel, elfutils, python2, python3, perl, newt, slang, asciidoc, xmlto, makeWrapper
|
|
||||||
, docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkg-config, libunwind, binutils
|
|
||||||
, libiberty, audit, libbfd, libopcodes, openssl, systemtap, numactl
|
|
||||||
, zlib, withGtk ? false, gtk2 ? null
|
|
||||||
, babeltrace
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
assert withGtk -> gtk2 != null;
|
|
||||||
assert versionAtLeast kernel.version "3.12";
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "perf-linux-${kernel.version}";
|
|
||||||
|
|
||||||
inherit (kernel) src;
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
cd tools/perf
|
|
||||||
|
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace /usr/include/elfutils $elfutils/include/elfutils
|
|
||||||
|
|
||||||
for x in util/build-id.c util/dso.c; do
|
|
||||||
substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -f bash_completion ]; then
|
|
||||||
sed -i 's,^have perf,_have perf,' bash_completion
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
makeFlags = [
|
|
||||||
"prefix=$(out)"
|
|
||||||
"WERROR=0"
|
|
||||||
"LIBBABELTRACE=1"
|
|
||||||
"LIBBABELTRACE_DIR=${babeltrace}"
|
|
||||||
] ++ kernel.makeFlags;
|
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
|
||||||
|
|
||||||
# perf refers both to newt and slang
|
|
||||||
nativeBuildInputs = [
|
|
||||||
asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
|
|
||||||
flex bison libiberty audit makeWrapper pkg-config python3
|
|
||||||
];
|
|
||||||
buildInputs = [
|
|
||||||
elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
|
|
||||||
libopcodes python3 perl babeltrace
|
|
||||||
] ++ lib.optional withGtk gtk2
|
|
||||||
++ (if (versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ]);
|
|
||||||
|
|
||||||
# Note: we don't add elfutils to buildInputs, since it provides a
|
|
||||||
# bad `ld' and other stuff.
|
|
||||||
NIX_CFLAGS_COMPILE = toString [
|
|
||||||
"-Wno-error=cpp"
|
|
||||||
"-Wno-error=bool-compare"
|
|
||||||
"-Wno-error=deprecated-declarations"
|
|
||||||
"-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
|
|
||||||
"-Wno-error=stringop-truncation"
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs scripts/bpf_helpers_doc.py
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = false; # requires "sparse"
|
|
||||||
doInstallCheck = false; # same
|
|
||||||
|
|
||||||
separateDebugInfo = true;
|
|
||||||
installFlags = [ "install" "install-man" "ASCIIDOC8=1" "prefix=$(out)" ];
|
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
wrapProgram $out/bin/perf \
|
|
||||||
--prefix PATH : "${binutils}/bin"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://perf.wiki.kernel.org/";
|
|
||||||
description = "Linux tools to profile with performance counters";
|
|
||||||
maintainers = with lib.maintainers; [viric];
|
|
||||||
platforms = with lib.platforms; linux;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{ stdenv, lib, fetchFromGitHub, perl, autoconf, automake
|
|
||||||
, libtool, flex, libevent, hwloc, munge, zlib
|
|
||||||
} :
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "2.2.4";
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
pname = "pmix";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
repo = "openpmix";
|
|
||||||
owner = "openpmix";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "1wc4sbnbg20lp6l6pk1sawrf5wrdajcijd1cmrpp1d6h9nv23ggv";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs ./autogen.pl
|
|
||||||
patchShebangs ./config
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ perl autoconf automake libtool flex ];
|
|
||||||
|
|
||||||
buildInputs = [ libevent hwloc munge zlib ];
|
|
||||||
|
|
||||||
configureFlags = [
|
|
||||||
"--with-libevent=${libevent.dev}"
|
|
||||||
"--with-munge=${munge}"
|
|
||||||
"--with-hwloc=${hwloc.dev}"
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
./autogen.pl
|
|
||||||
'';
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Process Management Interface for HPC environments";
|
|
||||||
homepage = "https://openpmix.github.io/";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
maintainers = [ maintainers.markuskowa ];
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, docutils
|
|
||||||
, pandoc, ethtool, iproute, libnl, udev, python, perl
|
|
||||||
, makeWrapper
|
|
||||||
} :
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "31.1";
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
pname = "rdma-core";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "linux-rdma";
|
|
||||||
repo = "rdma-core";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "1xkmdix6mgv6kjjj6wi844bfddhl0ybalrp5g8pf5izasc43brg7";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkg-config pandoc docutils makeWrapper ];
|
|
||||||
buildInputs = [ libnl ethtool iproute udev python perl ];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DCMAKE_INSTALL_RUNDIR=/run"
|
|
||||||
"-DCMAKE_INSTALL_SHAREDSTATEDIR=/var/lib"
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace srp_daemon/srp_daemon.sh.in \
|
|
||||||
--replace /bin/rm rm
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
# cmake script is buggy, move file manually
|
|
||||||
mkdir -p $out/${perl.libPrefix}
|
|
||||||
mv $out/share/perl5/* $out/${perl.libPrefix}
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
for pls in $out/bin/{ibfindnodesusing.pl,ibidsverify.pl}; do
|
|
||||||
echo "wrapping $pls"
|
|
||||||
chmod +x "$pls"
|
|
||||||
wrapProgram $pls --prefix PERL5LIB : "$out/${perl.libPrefix}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove the binaries as they pull systemd
|
|
||||||
rm -rf $out/bin
|
|
||||||
rm -rf $out/sbin
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "RDMA Core Userspace Libraries and Daemons";
|
|
||||||
homepage = "https://github.com/linux-rdma/rdma-core";
|
|
||||||
license = licenses.gpl2;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = with maintainers; [ markuskowa ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
autoconf,
|
|
||||||
automake,
|
|
||||||
autoreconfHook,
|
|
||||||
boost,
|
|
||||||
fetchFromGitHub,
|
|
||||||
gnumake,
|
|
||||||
libtool,
|
|
||||||
withCFlags,
|
|
||||||
|
|
||||||
useIntel ? true,
|
|
||||||
adaptivecpp ? null,
|
|
||||||
intelPackages ? null,
|
|
||||||
|
|
||||||
useGit ? false,
|
|
||||||
gitUrl ? "git@gitlab-internal.bsc.es:task-awareness/tasycl/tasycl.git",
|
|
||||||
gitBranch ? "main",
|
|
||||||
gitCommit ? "78f98dcf60a66e0eaa3b4ebcf55be076bec64825",
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert !useIntel -> adaptivecpp != null;
|
|
||||||
assert useIntel -> intelPackages != null;
|
|
||||||
|
|
||||||
let
|
|
||||||
variant = if useIntel then "intel" else "acpp";
|
|
||||||
|
|
||||||
syclStdenv = withCFlags [ "-O3" ] (if useIntel then intelPackages.stdenv else stdenv);
|
|
||||||
|
|
||||||
release = rec {
|
|
||||||
version = "2.1.0";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "bsc-pm";
|
|
||||||
repo = "tasycl";
|
|
||||||
rev = version;
|
|
||||||
hash = "sha256-0kXnb0lHeQNHR27GTLbJ8xbiICLU8k2+FqEnnFSrzzo=";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
git = rec {
|
|
||||||
version = src.shortRev;
|
|
||||||
src = builtins.fetchGit {
|
|
||||||
url = gitUrl;
|
|
||||||
ref = gitBranch;
|
|
||||||
rev = gitCommit;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
source = if (useGit) then git else release;
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
syclStdenv.mkDerivation {
|
|
||||||
pname = "tasycl-${variant}";
|
|
||||||
inherit (source) src version;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
separateDebugInfo = true;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
autoreconfHook
|
|
||||||
automake
|
|
||||||
autoconf
|
|
||||||
libtool
|
|
||||||
gnumake
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
boost
|
|
||||||
];
|
|
||||||
|
|
||||||
configureFlags = lib.optionals (!useIntel) [
|
|
||||||
"CXX=${lib.getExe adaptivecpp}"
|
|
||||||
];
|
|
||||||
|
|
||||||
# add symlinks so we can explicitly link with tasycl-intel / tasycl-acpp
|
|
||||||
postInstall = ''
|
|
||||||
pushd $out/lib
|
|
||||||
for i in libtasycl* ; do
|
|
||||||
ln -s "$i" "''\${i/tasycl/tasycl-${variant}}"
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
hardeningDisable = [ "all" ];
|
|
||||||
}
|
|
||||||
@@ -1,263 +0,0 @@
|
|||||||
--- a/src/CMakeLists.txt 2020-11-21 14:05:24.912896596 +0100
|
|
||||||
+++ b/src/CMakeLists.txt 2020-11-21 14:19:30.978284644 +0100
|
|
||||||
@@ -130,8 +130,7 @@ SET(VITE_HDRS
|
|
||||||
# Plugin header
|
|
||||||
plugin/Command_window.hpp
|
|
||||||
plugin/Plugin_window.hpp
|
|
||||||
- plugin/Plugin.hpp
|
|
||||||
- )
|
|
||||||
+ plugin/Plugin.hpp)
|
|
||||||
|
|
||||||
SET(VITE_UIS
|
|
||||||
interface/info_window.ui
|
|
||||||
@@ -142,8 +141,7 @@ SET(VITE_UIS
|
|
||||||
interface/list_of_counter_to_export.ui
|
|
||||||
interface/node_select.ui
|
|
||||||
interface/interval_select.ui
|
|
||||||
- interface/statistics.ui
|
|
||||||
- )
|
|
||||||
+ interface/statistics.ui)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
# Messages & Errors
|
|
||||||
@@ -220,29 +218,23 @@ SET(VITE_SRCS
|
|
||||||
core/Core.cpp
|
|
||||||
core/getopt.c
|
|
||||||
# Main
|
|
||||||
- main.cpp
|
|
||||||
- )
|
|
||||||
+ main.cpp)
|
|
||||||
|
|
||||||
-SET(VITE_RCCS
|
|
||||||
- interface/vite.qrc
|
|
||||||
- )
|
|
||||||
+SET(VITE_RCCS interface/vite.qrc)
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
# QtColorPicker
|
|
||||||
#############################################
|
|
||||||
set(QTCOLORPICKERDIR
|
|
||||||
- ${CMAKE_SOURCE_DIR}/externals/qtcolorpicker/src
|
|
||||||
- )
|
|
||||||
+ ${CMAKE_SOURCE_DIR}/externals/qtcolorpicker/src)
|
|
||||||
|
|
||||||
set(VITE_HDRS
|
|
||||||
${VITE_HDRS}
|
|
||||||
- ${QTCOLORPICKERDIR}/qtcolorpicker.h
|
|
||||||
- )
|
|
||||||
+ ${QTCOLORPICKERDIR}/qtcolorpicker.h)
|
|
||||||
|
|
||||||
set(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
- ${QTCOLORPICKERDIR}/qtcolorpicker.cpp
|
|
||||||
- )
|
|
||||||
+ ${QTCOLORPICKERDIR}/qtcolorpicker.cpp)
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
# VBO
|
|
||||||
@@ -252,15 +244,13 @@ IF(VITE_ENABLE_VBO)
|
|
||||||
${VITE_HDRS}
|
|
||||||
render/vbo.hpp
|
|
||||||
render/Shader.hpp
|
|
||||||
- render/Render_alternate.hpp
|
|
||||||
- )
|
|
||||||
+ render/Render_alternate.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
render/vbo.cpp
|
|
||||||
render/Shader.cpp
|
|
||||||
- render/Render_alternate.cpp
|
|
||||||
- )
|
|
||||||
+ render/Render_alternate.cpp)
|
|
||||||
ENDIF(VITE_ENABLE_VBO)
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
@@ -271,29 +261,25 @@ IF(VITE_ENABLE_OTF)
|
|
||||||
${VITE_HDRS}
|
|
||||||
parser/OTFParser/ParserDefinitionOTF.hpp
|
|
||||||
parser/OTFParser/ParserEventOTF.hpp
|
|
||||||
- parser/OTFParser/ParserOTF.hpp
|
|
||||||
- )
|
|
||||||
+ parser/OTFParser/ParserOTF.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
parser/OTFParser/ParserDefinitionOTF.cpp
|
|
||||||
parser/OTFParser/ParserEventOTF.cpp
|
|
||||||
- parser/OTFParser/ParserOTF.cpp
|
|
||||||
- )
|
|
||||||
+ parser/OTFParser/ParserOTF.cpp)
|
|
||||||
|
|
||||||
IF(VITE_ENABLE_MT_PARSERS)
|
|
||||||
SET(VITE_HDRS
|
|
||||||
${VITE_HDRS}
|
|
||||||
parser/OTFParser/mt_ParserEventOTF.hpp
|
|
||||||
parser/OTFParser/mt_ParserOTF.hpp
|
|
||||||
- parser/OTFParser/OTFTraceBuilderThread.hpp
|
|
||||||
- )
|
|
||||||
+ parser/OTFParser/OTFTraceBuilderThread.hpp)
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
parser/OTFParser/mt_ParserEventOTF.cpp
|
|
||||||
parser/OTFParser/mt_ParserOTF.cpp
|
|
||||||
- parser/OTFParser/OTFTraceBuilderThread.cpp
|
|
||||||
- )
|
|
||||||
+ parser/OTFParser/OTFTraceBuilderThread.cpp)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(BEFORE ${OTF_INCLUDE_DIR})
|
|
||||||
@@ -310,15 +296,13 @@ IF(VITE_ENABLE_OTF2)
|
|
||||||
${VITE_HDRS}
|
|
||||||
parser/OTF2Parser/ParserDefinitionOTF2.hpp
|
|
||||||
parser/OTF2Parser/ParserEventOTF2.hpp
|
|
||||||
- parser/OTF2Parser/ParserOTF2.hpp
|
|
||||||
- )
|
|
||||||
+ parser/OTF2Parser/ParserOTF2.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
parser/OTF2Parser/ParserDefinitionOTF2.cpp
|
|
||||||
parser/OTF2Parser/ParserEventOTF2.cpp
|
|
||||||
- parser/OTF2Parser/ParserOTF2.cpp
|
|
||||||
- )
|
|
||||||
+ parser/OTF2Parser/ParserOTF2.cpp)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${OTF2_INCLUDE_DIR})
|
|
||||||
|
|
||||||
@@ -332,13 +316,11 @@ IF(VITE_ENABLE_TAU)
|
|
||||||
SET(VITE_HDRS
|
|
||||||
${VITE_HDRS}
|
|
||||||
parser/TauParser/ParserTau.hpp
|
|
||||||
- parser/TauParser/TauStructs.hpp
|
|
||||||
- )
|
|
||||||
+ parser/TauParser/TauStructs.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
- parser/TauParser/ParserTau.cpp
|
|
||||||
- )
|
|
||||||
+ parser/TauParser/ParserTau.cpp)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${TAU_INCLUDE_DIR})
|
|
||||||
|
|
||||||
@@ -357,8 +339,7 @@ IF(VITE_ENABLE_MT_PARSERS)
|
|
||||||
parser/PajeParser/mt_ParserPaje.hpp
|
|
||||||
parser/PajeParser/mt_PajeFileManager.hpp
|
|
||||||
parser/PajeParser/BuilderThread.hpp
|
|
||||||
- trace/TraceBuilderThread.hpp
|
|
||||||
- )
|
|
||||||
+ trace/TraceBuilderThread.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
@@ -367,8 +348,7 @@ IF(VITE_ENABLE_MT_PARSERS)
|
|
||||||
parser/PajeParser/mt_ParserPaje.cpp
|
|
||||||
parser/PajeParser/mt_PajeFileManager.cpp
|
|
||||||
parser/PajeParser/BuilderThread.cpp
|
|
||||||
- trace/TraceBuilderThread.cpp
|
|
||||||
- )
|
|
||||||
+ trace/TraceBuilderThread.cpp)
|
|
||||||
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
@@ -385,16 +365,14 @@ IF(VITE_ENABLE_SERIALIZATION)
|
|
||||||
parser/ParserSplitted.hpp
|
|
||||||
trace/IntervalOfContainer.hpp
|
|
||||||
trace/SerializerWriter.hpp
|
|
||||||
- trace/SerializerDispatcher.hpp
|
|
||||||
- )
|
|
||||||
+ trace/SerializerDispatcher.hpp)
|
|
||||||
|
|
||||||
SET(VITE_SRCS
|
|
||||||
${VITE_SRCS}
|
|
||||||
parser/ParserSplitted.cpp
|
|
||||||
trace/IntervalOfContainer.cpp
|
|
||||||
trace/SerializerWriter.cpp
|
|
||||||
- trace/SerializerDispatcher.cpp
|
|
||||||
- )
|
|
||||||
+ trace/SerializerDispatcher.cpp)
|
|
||||||
|
|
||||||
ENDIF(VITE_ENABLE_SERIALIZATION)
|
|
||||||
|
|
||||||
@@ -421,24 +399,22 @@ INCLUDE_DIRECTORIES(
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/common
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
- ${QTCOLORPICKERDIR}
|
|
||||||
- )
|
|
||||||
+ ${QTCOLORPICKERDIR})
|
|
||||||
#ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
|
|
||||||
|
|
||||||
-IF( VITE_ENABLE_OTF )
|
|
||||||
- LINK_DIRECTORIES( ${OTF_LIBRARY_DIR} )
|
|
||||||
-ENDIF( VITE_ENABLE_OTF )
|
|
||||||
+IF(VITE_ENABLE_OTF)
|
|
||||||
+ LINK_DIRECTORIES(${OTF_LIBRARY_DIR})
|
|
||||||
+ENDIF(VITE_ENABLE_OTF)
|
|
||||||
|
|
||||||
IF(VITE_ENABLE_OTF2)
|
|
||||||
- LINK_DIRECTORIES(${OTF2_LIBRARY_DIR} )
|
|
||||||
+ LINK_DIRECTORIES(${OTF2_LIBRARY_DIR})
|
|
||||||
ENDIF(VITE_ENABLE_OTF2)
|
|
||||||
|
|
||||||
#resource
|
|
||||||
IF(WIN32)
|
|
||||||
set(VITE_RES
|
|
||||||
"${PROJECT_SOURCE_DIR}/src/interface/icon/logo.ico"
|
|
||||||
- "${PROJECT_SOURCE_DIR}/src/interface/windows_icon.rc"
|
|
||||||
- )
|
|
||||||
+ "${PROJECT_SOURCE_DIR}/src/interface/windows_icon.rc")
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
if( APPLE )
|
|
||||||
@@ -456,7 +432,11 @@ if( APPLE )
|
|
||||||
MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012"
|
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in)
|
|
||||||
else( APPLE )
|
|
||||||
- ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${VITE_RES})
|
|
||||||
+ message("VITE_SRCS" ${VITE_SRCS} "END")
|
|
||||||
+ message("VITE_MOC" ${VITE_MOC} "END")
|
|
||||||
+ message("VITE_RCC_SRCS" ${VITE_RCC_SRCS} "END")
|
|
||||||
+ message("VITE_RES" ${VITE_RES} "END")
|
|
||||||
+ ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
|
|
||||||
endif( APPLE )
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
@@ -470,31 +450,22 @@ TARGET_LINK_LIBRARIES(vite
|
|
||||||
${QT_LIBRARIES}
|
|
||||||
${OPENGL_gl_LIBRARY}
|
|
||||||
${OPENGL_glu_LIBRARY}
|
|
||||||
- ${Boost_LIBRARIES}
|
|
||||||
- )
|
|
||||||
+ ${Boost_LIBRARIES})
|
|
||||||
|
|
||||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
||||||
- TARGET_LINK_LIBRARIES(vite
|
|
||||||
- rt
|
|
||||||
- )
|
|
||||||
+ TARGET_LINK_LIBRARIES(vite rt)
|
|
||||||
#ADD_DEFINITIONS("-DBOOST_GZIP")
|
|
||||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
||||||
|
|
||||||
IF(VITE_ENABLE_VBO)
|
|
||||||
- TARGET_LINK_LIBRARIES(vite
|
|
||||||
- ${GLEW_LIBRARY}
|
|
||||||
- )
|
|
||||||
+ TARGET_LINK_LIBRARIES(vite ${GLEW_LIBRARY})
|
|
||||||
ENDIF(VITE_ENABLE_VBO)
|
|
||||||
|
|
||||||
IF(VITE_ENABLE_OTF)
|
|
||||||
- TARGET_LINK_LIBRARIES(vite
|
|
||||||
- ${OTF_LIBRARY}
|
|
||||||
- )
|
|
||||||
+ TARGET_LINK_LIBRARIES(vite ${OTF_LIBRARY})
|
|
||||||
# if OTF is compiled with zlib support we need to add it
|
|
||||||
IF(WIN32)
|
|
||||||
- TARGET_LINK_LIBRARIES(vite
|
|
||||||
- ${ZLIB_LIBRARY}
|
|
||||||
- )
|
|
||||||
+ TARGET_LINK_LIBRARIES(vite ${ZLIB_LIBRARY})
|
|
||||||
ENDIF(WIN32)
|
|
||||||
ENDIF(VITE_ENABLE_OTF)
|
|
||||||
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
fetchgit
|
|
||||||
, stdenv
|
|
||||||
, cmake
|
|
||||||
, qtbase
|
|
||||||
, qttools
|
|
||||||
, qtcharts
|
|
||||||
, libGLU
|
|
||||||
, libGL
|
|
||||||
, glm
|
|
||||||
, glew
|
|
||||||
, wrapQtAppsHook
|
|
||||||
, otf ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
# ViTE 1.1 has several bugs, so use the SVN version.
|
|
||||||
let
|
|
||||||
#rev = "1543";
|
|
||||||
#externals = fetchsvn {
|
|
||||||
# url = "svn://scm.gforge.inria.fr/svn/vite/externals";
|
|
||||||
# sha256 = "1a422n3dp72v4visq5b1i21cf8sj12903sgg5v2hah3sgk02dnyz";
|
|
||||||
# inherit rev;
|
|
||||||
#};
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
version = "c6c0ce7";
|
|
||||||
pname = "vite";
|
|
||||||
|
|
||||||
#dontStrip = true;
|
|
||||||
#enableDebugging = true;
|
|
||||||
preferLocalBuild = true;
|
|
||||||
|
|
||||||
#src = ./../../vite-c6c0ce7;
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://gitlab.inria.fr/solverstack/vite.git";
|
|
||||||
sha256 = "17h57jjcdynnjd6s19hs6zdgvr9j7hj1rf6a62d9qky8wzb78y37";
|
|
||||||
#rev = "373d4a8ebe86aa9ed07c9a8eb5e5e7f1602baef9";
|
|
||||||
rev = "c6c0ce7a75324f03b24243397dfaa0d3bcd5bd1b";
|
|
||||||
};
|
|
||||||
|
|
||||||
#patches = [ ./cmake.patch ];
|
|
||||||
|
|
||||||
#preConfigure = ''
|
|
||||||
# rm -rv externals
|
|
||||||
# ln -sv "${externals}" externals
|
|
||||||
#'';
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
cmake qtbase qttools qtcharts
|
|
||||||
libGLU libGL glm glew wrapQtAppsHook
|
|
||||||
] ++ optional (otf != null) otf;
|
|
||||||
|
|
||||||
#NIX_LDFLAGS = "-lGLU";
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
# "-DCMAKE_BUILD_TYPE=Debug"
|
|
||||||
#"-DVITE_ENABLE_OTF2=True"
|
|
||||||
#"-DVITE_ENABLE_TAU=True"
|
|
||||||
]
|
|
||||||
++ optionals (otf != null)
|
|
||||||
[
|
|
||||||
"-DVITE_ENABLE_OTF=True"
|
|
||||||
"-DOTF_LIBRARY_DIR=${otf}/lib"
|
|
||||||
"-DOTF_INCLUDE_DIR=${otf}/include"
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Visual Trace Explorer (ViTE), a tool to visualize execution traces";
|
|
||||||
|
|
||||||
longDescription = ''
|
|
||||||
ViTE is a trace explorer. It is a tool to visualize execution
|
|
||||||
traces in Pajé or OTF format for debugging and profiling
|
|
||||||
parallel or distributed applications.
|
|
||||||
'';
|
|
||||||
|
|
||||||
homepage = "http://vite.gforge.inria.fr/";
|
|
||||||
license = lib.licenses.cecill20;
|
|
||||||
maintainers = with lib.maintainers; [ ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
{
|
|
||||||
stdenv
|
|
||||||
, lib
|
|
||||||
, fetchurl
|
|
||||||
, cmake
|
|
||||||
, libGLU
|
|
||||||
, libGL
|
|
||||||
, libX11
|
|
||||||
, xorgproto
|
|
||||||
, libXt
|
|
||||||
, libtiff
|
|
||||||
, qtLib ? null
|
|
||||||
, enablePython ? false, python ? null
|
|
||||||
, mpi ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
os = lib.optionalString;
|
|
||||||
majorVersion = "8.2";
|
|
||||||
minorVersion = "0";
|
|
||||||
version = "${majorVersion}.${minorVersion}";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "vtk-${os (qtLib != null) "qvtk-"}${version}";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "${meta.homepage}files/release/${majorVersion}/VTK-${version}.tar.gz";
|
|
||||||
sha256 = "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
|
||||||
|
|
||||||
buildInputs = [ libtiff ]
|
|
||||||
++ optionals (qtLib != null) (with qtLib; [ qtbase qtx11extras qttools ])
|
|
||||||
++ optional (qtLib != null) (with qtLib; [ qtbase qtx11extras qttools ])
|
|
||||||
++ optionals stdenv.isLinux [ libGLU libGL libX11 xorgproto libXt ]
|
|
||||||
++ optional enablePython [ python ]
|
|
||||||
++ optional (mpi != null) [ mpi ];
|
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
export LD_LIBRARY_PATH="$(pwd)/lib";
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Shared libraries don't work, because of rpath troubles with the current
|
|
||||||
# nixpkgs cmake approach. It wants to call a binary at build time, just
|
|
||||||
# built and requiring one of the shared objects.
|
|
||||||
# At least, we use -fPIC for other packages to be able to use this in shared
|
|
||||||
# objects.
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DCMAKE_C_FLAGS=-fPIC"
|
|
||||||
"-DCMAKE_CXX_FLAGS=-fPIC"
|
|
||||||
"-DVTK_USE_SYSTEM_TIFF=1"
|
|
||||||
"-DVTK_Group_MPI=ON"
|
|
||||||
"-DBUILD_SHARED_LIBS=ON"
|
|
||||||
"-DOPENGL_INCLUDE_DIR=${libGL}/include"
|
|
||||||
]
|
|
||||||
++ optional (mpi != null) [
|
|
||||||
"-DVTK_Group_MPI=ON" ]
|
|
||||||
++ optional (qtLib != null) [
|
|
||||||
"-DVTK_Group_Qt:BOOL=ON" ]
|
|
||||||
++ optional stdenv.isDarwin [
|
|
||||||
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ]
|
|
||||||
++ optional enablePython [
|
|
||||||
"-DVTK_WRAP_PYTHON:BOOL=ON" ];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Open source libraries for 3D computer graphics, image processing and visualization";
|
|
||||||
homepage = "https://www.vtk.org/";
|
|
||||||
license = lib.licenses.bsd3;
|
|
||||||
maintainers = with lib.maintainers; [ knedlsepp ];
|
|
||||||
platforms = with lib.platforms; unix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{ intelPackages, writeText, strace }:
|
|
||||||
|
|
||||||
let
|
|
||||||
stdenv = intelPackages.stdenv;
|
|
||||||
hello_sycl = writeText "hello.cpp" ''
|
|
||||||
#include <sycl/sycl.hpp>
|
|
||||||
|
|
||||||
class hello_world;
|
|
||||||
|
|
||||||
int main(int argc, char** argv) try {
|
|
||||||
auto device_selector = sycl::default_selector_v;
|
|
||||||
|
|
||||||
sycl::queue queue(device_selector);
|
|
||||||
|
|
||||||
std::cout << "Running on: "
|
|
||||||
<< queue.get_device().get_info<sycl::info::device::name>()
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
queue.submit([&] (sycl::handler& cgh) {
|
|
||||||
auto os = sycl::stream{128, 128, cgh};
|
|
||||||
cgh.single_task<hello_world>([=]() {
|
|
||||||
os << "Hello World! (on device)\n";
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} catch (sycl::exception &e) {
|
|
||||||
std::cout << "SYCL exception: " << e.what() << std::endl;
|
|
||||||
return 0; // we excpect to fail since no devices should be available;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
version = "0.0.1";
|
|
||||||
name = "hello-sycl";
|
|
||||||
buildInputs = [ stdenv strace ];
|
|
||||||
src = hello_sycl;
|
|
||||||
dontUnpack = true;
|
|
||||||
dontConfigure = true;
|
|
||||||
NIX_DEBUG = 0;
|
|
||||||
buildPhase = ''
|
|
||||||
cp $src hello.cpp
|
|
||||||
set -x
|
|
||||||
echo CXX=$CXX
|
|
||||||
command -v $CXX
|
|
||||||
$CXX -fsycl hello.cpp -o hello
|
|
||||||
./hello
|
|
||||||
set +x
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
{ writeText, intelPackages, nodes, nosv, clangOmpss2Nodes, strace }:
|
|
||||||
|
|
||||||
let
|
|
||||||
hello_cpp = writeText "hello.cpp" ''
|
|
||||||
#include <cstdio>
|
|
||||||
#include <sycl/sycl.hpp>
|
|
||||||
|
|
||||||
int main(int argc, char** argv) try {
|
|
||||||
sycl::queue queue;
|
|
||||||
|
|
||||||
std::cout << "Running on: "
|
|
||||||
<< queue.get_device().get_info<sycl::info::device::name>()
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
#pragma oss task
|
|
||||||
queue.submit([&] (sycl::handler& cgh) {
|
|
||||||
auto os = sycl::stream{128, 128, cgh};
|
|
||||||
cgh.single_task<class hello_world>([=]() {
|
|
||||||
os << "Hello World! (on device)\n";
|
|
||||||
});
|
|
||||||
}).wait();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} catch (sycl::exception &e) {
|
|
||||||
std::cout << "SYCL exception: " << e.what() << std::endl;
|
|
||||||
return 0; // we expect to fail since no devices should be available;
|
|
||||||
}
|
|
||||||
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
|
|
||||||
intelPackages.stdenv.mkDerivation {
|
|
||||||
version = "0.0.1";
|
|
||||||
name = "hello-syclompss";
|
|
||||||
|
|
||||||
src = hello_cpp;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
strace
|
|
||||||
nodes
|
|
||||||
nosv
|
|
||||||
];
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
dontConfigure = true;
|
|
||||||
|
|
||||||
# NODES requires access to /sys/devices to request NUMA information
|
|
||||||
requiredSystemFeatures = [ "sys-devices" ];
|
|
||||||
|
|
||||||
env.NODES_HOME = nodes;
|
|
||||||
|
|
||||||
NIX_DEBUG = 1;
|
|
||||||
buildPhase = ''
|
|
||||||
cp $src hello.cpp
|
|
||||||
set -x
|
|
||||||
echo CXX=$CXX
|
|
||||||
echo NODES_HOME=$NODES_HOME
|
|
||||||
command -v $CXX
|
|
||||||
|
|
||||||
icpx -Wno-deprecated-declarations -fsycl \
|
|
||||||
-fsycl-host-compiler=${clangOmpss2Nodes.forIcpx}/bin/clang++ \
|
|
||||||
-fsycl-host-compiler-options='-Wno-deprecated-declarations -fompss-2=libnodes' \
|
|
||||||
-lnodes -lnosv \
|
|
||||||
$NODES_HOME/lib/nodes-main-wrapper.o \
|
|
||||||
hello.cpp -o hello
|
|
||||||
|
|
||||||
./hello
|
|
||||||
set +x
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user