Add clang support

This commit is contained in:
Alejandro Gallo 2021-09-06 18:54:17 +02:00
parent 7cddf4735f
commit 0216bed053
6 changed files with 16 additions and 9 deletions

View File

@ -7,7 +7,7 @@ include ./etc/make/emacs.mk
include ./etc/config/$(CONFIG).mk include ./etc/config/$(CONFIG).mk
include ./bench/config.mk include ./bench/config.mk
$(info using configuration CONFIG=$(CONFIG)) $(info ==ATRIP== using configuration CONFIG=$(CONFIG))
MAIN = README.org MAIN = README.org
OBJ_FILES = $(patsubst %.cxx,%.o,$(filter-out %.hpp,$(SOURCES))) OBJ_FILES = $(patsubst %.cxx,%.o,$(filter-out %.hpp,$(SOURCES)))

View File

@ -1283,7 +1283,7 @@ namespace atrip {
const int rank = Atrip::rank const int rank = Atrip::rank
, Nv = sliceLength[0] , Nv = sliceLength[0]
, No = sliceLength[1] , No = sliceLength[1]
, a = rankMap.find({rank, it}); , a = rankMap.find({static_cast<size_t>(rank), it});
; ;
@ -1321,7 +1321,7 @@ namespace atrip {
const int rank = Atrip::rank const int rank = Atrip::rank
, No = sliceLength[0] , No = sliceLength[0]
, a = rankMap.find({rank, it}) , a = rankMap.find({static_cast<size_t>(rank), it})
; ;
sliceIntoVector( sources[it] sliceIntoVector( sources[it]
@ -1358,7 +1358,7 @@ namespace atrip {
const int Nv = sliceLength[0] const int Nv = sliceLength[0]
, No = sliceLength[1] , No = sliceLength[1]
, rank = Atrip::rank , rank = Atrip::rank
, el = rankMap.find({rank, it}) , el = rankMap.find({static_cast<size_t>(rank), it})
, a = el % Nv , a = el % Nv
, b = el / Nv , b = el / Nv
; ;
@ -1397,7 +1397,7 @@ namespace atrip {
const int Nv = from.lens[0] const int Nv = from.lens[0]
, No = sliceLength[1] , No = sliceLength[1]
, rank = Atrip::rank , rank = Atrip::rank
, el = rankMap.find({rank, it}) , el = rankMap.find({static_cast<size_t>(rank), it})
, a = el % Nv , a = el % Nv
, b = el / Nv , b = el / Nv
; ;
@ -1438,7 +1438,7 @@ namespace atrip {
const int Nv = from.lens[0] const int Nv = from.lens[0]
, No = sliceLength[1] , No = sliceLength[1]
, rank = Atrip::rank , rank = Atrip::rank
, el = rankMap.find({rank, it}) , el = rankMap.find({static_cast<size_t>(rank), it})
, a = el % Nv , a = el % Nv
, b = el / Nv , b = el / Nv
; ;

4
etc/config/clang.mk Normal file
View File

@ -0,0 +1,4 @@
include ./etc/config/gcc.mk
export OMPI_CC=clang
export OMPI_CXX=clang++

View File

@ -8,6 +8,8 @@ CXXFLAGS += -I$(ATRIP_ROOT)/include
CXXFLAGS += -I$(CTF_INCLUDE_PATH) CXXFLAGS += -I$(CTF_INCLUDE_PATH)
CXXFLAGS += -fPIC CXXFLAGS += -fPIC
CXXFLAGS += -std=c++11
CXXFLAGS += -pedantic -Wall
LDFLAGS += -fopenmp LDFLAGS += -fopenmp
LDFLAGS += -Wl,-Bstatic LDFLAGS += -Wl,-Bstatic

View File

@ -2,7 +2,7 @@ CTF_REPOSITORY = https://github.com/cyclops-community/ctf
CTF_COMMIT ?= v1.5.0 CTF_COMMIT ?= v1.5.0
CTF_SRC_PATH = $(ATRIP_ROOT)/extern/src/ctf/$(CTF_COMMIT) CTF_SRC_PATH = $(ATRIP_ROOT)/extern/src/ctf/$(CTF_COMMIT)
CTF_BUILD_PATH = $(ATRIP_ROOT)/extern/build/ctf/$(CTF_COMMIT) CTF_BUILD_PATH = $(ATRIP_ROOT)/extern/build/$(CONFIG)/ctf/$(CTF_COMMIT)
CTF_CONFIG_FLAGS = CTF_CONFIG_FLAGS =

View File

@ -4,6 +4,9 @@ pkgs.mkShell rec {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
clang
llvmPackages.openmp
coreutils coreutils
git git
@ -19,9 +22,7 @@ pkgs.mkShell rec {
openblas = pkgs.openblas.override { openblas = pkgs.openblas.override {
enableStatic = true; enableStatic = true;
}; };
*/
/*
scalapack = import ./etc/nix/scalapack.nix { scalapack = import ./etc/nix/scalapack.nix {
lib = pkgs.lib; lib = pkgs.lib;
stdenv = pkgs.stdenv; stdenv = pkgs.stdenv;