Fix gcc compilation due to nix problem

This commit is contained in:
Alejandro Gallo 2021-10-12 18:51:24 +02:00
parent 517c90704a
commit 93638c4488
3 changed files with 25 additions and 25 deletions

View File

@ -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
View File

@ -0,0 +1,9 @@
{ pkgs, ...}:
{
buildInputs = with pkgs; [
clang
llvmPackages.openmp
];
}

View File

@ -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}