Skip to content

Commit

Permalink
Update Nix build to use LLVM 13 (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter authored May 28, 2024
1 parent 4d32a10 commit b985e13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
nixpkgs: ['unstable', '23.05']
nixpkgs: ['unstable', '24.05']
cuda: ['false', 'true']
steps:
- uses: actions/[email protected]
Expand Down
12 changes: 8 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ pkgs ? import <nixpkgs> { }, lib ? pkgs.lib
, fetchFromGitHub ? pkgs.fetchFromGitHub, ncurses ? pkgs.ncurses
, cmake ? pkgs.cmake, libxml2 ? pkgs.libxml2, symlinkJoin ? pkgs.symlinkJoin
, cudaPackages ? pkgs.cudaPackages, enableCUDA ? false }:
, cudaPackages ? pkgs.cudaPackages, enableCUDA ? false
, libpfm ? pkgs.libpfm }:

let

llvmPackages = pkgs.llvmPackages_11;
llvmPackages = pkgs.llvmPackages_13;
stdenv = llvmPackages.stdenv;
cuda = if cudaPackages ? cudatoolkit_11 then [
cudaPackages.cudatoolkit_11
Expand Down Expand Up @@ -48,7 +49,9 @@ in stdenv.mkDerivation rec {
src = ./.;

nativeBuildInputs = [ cmake ];
buildInputs = [ llvmMerged ncurses libxml2 ] ++ lib.optionals enableCUDA cuda;
buildInputs = [ llvmMerged ncurses libxml2 ]
++ lib.optionals enableCUDA cuda
++ lib.optional (!stdenv.isDarwin) libpfm;

cmakeFlags = [
"-DHAS_TERRA_VERSION=0"
Expand Down Expand Up @@ -89,7 +92,8 @@ in stdenv.mkDerivation rec {
meta = with lib; {
description = "A low-level counterpart to Lua";
homepage = "http://terralang.org/";
platforms = platforms.x86_64 ++ platforms.aarch64;
# Note: Nix has removed LLVM 11, required for Linux AArch64
platforms = platforms.x86_64 ++ platforms.darwin; # ++ platforms.aarch64;
maintainers = with maintainers; [ jb55 thoughtpolice ];
license = licenses.mit;
};
Expand Down

0 comments on commit b985e13

Please sign in to comment.