Fix gcc compilation due to nix problem
This commit is contained in:
parent
517c90704a
commit
93638c4488
3
Makefile
3
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
|
||||
|
||||
9
etc/nix/clang.nix
Normal file
9
etc/nix/clang.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ pkgs, ...}:
|
||||
|
||||
{
|
||||
buildInputs = with pkgs; [
|
||||
clang
|
||||
llvmPackages.openmp
|
||||
];
|
||||
}
|
||||
|
||||
38
shell.nix
38
shell.nix
@ -1,40 +1,28 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
{ pkgs ? import <nixpkgs> {} , 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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user