Update build

This commit is contained in:
Alejandro Gallo 2021-09-03 15:53:17 +02:00
parent f36b9a2022
commit 087bb57c85
5 changed files with 35 additions and 0 deletions

View File

@ -29,3 +29,9 @@ jobs:
- name: Tangle - name: Tangle
run: nix-shell --run 'make tangle' run: nix-shell --run 'make tangle'
- name: Build lib
run: nix-shell --run 'make lib'
- name: Build bench
run: nix-shell --run 'make lib'

View File

@ -8,11 +8,29 @@ include ./etc/config/$(CONFIG).mk
include ./bench/config.mk include ./bench/config.mk
MAIN = README.org MAIN = README.org
OBJ_FILES = $(patsubst %.cxx,%.o,$(filter-out %.hpp,$(SOURCES)))
DEP_FILES = $(patsubst %.o,%.d,$(OBJ_FILES))
SHARED_LIBRARY = lib/libatrip.so
STATIC_LIBRARY = lib/libatrip.a
lib: ctf
lib: $(SHARED_LIBRARY) $(STATIC_LIBRARY)
$(SHARED_LIBRARY): $(OBJ_FILES)
mkdir -p $(@D)
$(CXX) -shared $< $(CXXFLAGS) $(LDFLAGS) -o $@
$(STATIC_LIBRARY): $(OBJ_FILES)
mkdir -p $(@D)
$(AR) rcs $@ $<
$(SOURCES_FILE): $(MAIN) config.el $(SOURCES_FILE): $(MAIN) config.el
echo -n "SOURCES = " > $@ echo -n "SOURCES = " > $@
$(EMACS) --eval '(atrip-print-sources)' >> $@ $(EMACS) --eval '(atrip-print-sources)' >> $@
print:
$(info $(filter-out %.hpp,$(SOURCES)))
$(SOURCES): $(MAIN) $(SOURCES): $(MAIN)
$(call tangle,$<) $(call tangle,$<)
@ -33,3 +51,5 @@ bench: $(BENCH_TARGETS)
%.o: %.cxx %.o: %.cxx
$(CXX) -c $< $(CXXFLAGS) -o $@ $(CXX) -c $< $(CXXFLAGS) -o $@
%.d: %.cxx
$(CXX) -M $< $(CXXFLAGS) -o $@

View File

@ -3,5 +3,7 @@ BENCH_TARGETS = $(patsubst %.cxx,%,$(BENCH_SOURCES))
$(BENCH_TARGETS): CXXFLAGS += -I. $(BENCH_TARGETS): CXXFLAGS += -I.
$(BENCH_TARGETS): CXXFLAGS += -fopenmp $(BENCH_TARGETS): CXXFLAGS += -fopenmp
$(BENCH_TARGETS): lib
bench-clean: bench-clean:
-rm -v $(BENCH_TARGETS) -rm -v $(BENCH_TARGETS)

View File

@ -29,6 +29,7 @@
(atrip-def-hdr atrip-unions-h "Unions.hpp") (atrip-def-hdr atrip-unions-h "Unions.hpp")
(atrip-def-hdr atrip-tuples-h "Tuples.hpp") (atrip-def-hdr atrip-tuples-h "Tuples.hpp")
(atrip-def-hdr atrip-equations-h "Equations.hpp") (atrip-def-hdr atrip-equations-h "Equations.hpp")
(atrip-def-hdr atrip-debug-h "Debug.hpp")
(atrip-def-hdr atrip-atrip-h "Atrip.hpp") (atrip-def-hdr atrip-atrip-h "Atrip.hpp")
(atrip-def-src atrip-atrip-cxx "Atrip.cxx") (atrip-def-src atrip-atrip-cxx "Atrip.cxx")

View File

@ -10,10 +10,15 @@ pkgs.mkShell rec {
gcc gcc
blas blas
openmpi openmpi
mpi
emacs emacs
]; ];
openblas = pkgs.openblas.override {
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;
@ -29,6 +34,7 @@ pkgs.mkShell rec {
shellHook = '' shellHook = ''
export LAPACK_PATH=${pkgs.lapack} export LAPACK_PATH=${pkgs.lapack}
export BLAS_PATH=${pkgs.blas} export BLAS_PATH=${pkgs.blas}
export OPENBLAS_PATH=${openblas}
export SCALAPACK_PATH=${scalapack} export SCALAPACK_PATH=${scalapack}
export LD_LIBRARY_PATH=${scalapack}/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=${scalapack}/lib:$LD_LIBRARY_PATH
''; '';