diff --git a/Makefile b/Makefile index 1d66502..488771f 100644 --- a/Makefile +++ b/Makefile @@ -73,12 +73,15 @@ bench: $(BENCH_TARGETS) .PHONY: clean tangle bench %: %.o + $(info [bin] $@) $(CXX) $< $(CXXFLAGS) $(LDFLAGS) -o $@ %.o: %.cxx + $(info [obj] $@) $(CXX) -c $< $(CXXFLAGS) -o $@ %.d: %.cxx + $(info [dep] $@) $(CXX) -M $< $(CXXFLAGS) -o $@ .PHONY: install diff --git a/etc/nix/clang.nix b/etc/nix/clang.nix new file mode 100644 index 0000000..6cc6156 --- /dev/null +++ b/etc/nix/clang.nix @@ -0,0 +1,9 @@ +{ pkgs, ...}: + +{ + buildInputs = with pkgs; [ + clang + llvmPackages.openmp + ]; +} + diff --git a/shell.nix b/shell.nix index 39b6723..a949b61 100644 --- a/shell.nix +++ b/shell.nix @@ -1,40 +1,28 @@ -{ pkgs ? import {} }: +{ pkgs ? import {} , with-clang ? false }: -pkgs.mkShell rec { +let + compiler-configuration + = if with-clang + then (import ./etc/nix/clang.nix { inherit pkgs; }).buildInputs + else [ pkgs.gcc ]; + +in + +pkgs.mkShell { buildInputs = with pkgs; [ - clang - llvmPackages.openmp - coreutils git - gcc blas openmpi - mpi + gnumake + binutils emacs - ]; - /* - openblas = pkgs.openblas.override { - enableStatic = true; - }; - - scalapack = import ./etc/nix/scalapack.nix { - lib = pkgs.lib; - stdenv = pkgs.stdenv; - fetchFromGitHub = pkgs.fetchFromGitHub; - cmake = pkgs.cmake; - openssh = pkgs.openssh; - gfortran = pkgs.gfortran; - mpi = pkgs.mpi; - blas = pkgs.blas; - lapack = pkgs.lapack; - }; - */ + ] ++ compiler-configuration; shellHook = '' export LAPACK_PATH=${pkgs.lapack}