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 .PHONY: clean tangle bench
%: %.o %: %.o
$(info [bin] $@)
$(CXX) $< $(CXXFLAGS) $(LDFLAGS) -o $@ $(CXX) $< $(CXXFLAGS) $(LDFLAGS) -o $@
%.o: %.cxx %.o: %.cxx
$(info [obj] $@)
$(CXX) -c $< $(CXXFLAGS) -o $@ $(CXX) -c $< $(CXXFLAGS) -o $@
%.d: %.cxx %.d: %.cxx
$(info [dep] $@)
$(CXX) -M $< $(CXXFLAGS) -o $@ $(CXX) -M $< $(CXXFLAGS) -o $@
.PHONY: install .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; [ buildInputs = with pkgs; [
clang
llvmPackages.openmp
coreutils coreutils
git git
gcc
blas blas
openmpi openmpi
mpi
gnumake
binutils
emacs emacs
];
/* ] ++ compiler-configuration;
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;
};
*/
shellHook = '' shellHook = ''
export LAPACK_PATH=${pkgs.lapack} export LAPACK_PATH=${pkgs.lapack}