Now compiling
This commit is contained in:
parent
a7868b49c1
commit
c6eb805078
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,7 +1,13 @@
|
||||
etc/autotools/
|
||||
Makefile.in
|
||||
build
|
||||
.emacs
|
||||
*.rst
|
||||
doxygen
|
||||
sphinx
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
configure
|
||||
|
||||
include/dbg.h
|
||||
doc/doxygen/
|
||||
|
||||
113
Makefile
113
Makefile
@ -1,113 +0,0 @@
|
||||
include atrip.mk
|
||||
CONFIG ?= gcc
|
||||
PREFIX ?= /usr
|
||||
SOURCES_FILE := Sources.mk
|
||||
|
||||
-include config.mk
|
||||
include $(SOURCES_FILE)
|
||||
include ./etc/make/emacs.mk
|
||||
include ./etc/config/$(CONFIG).mk
|
||||
include ./bench/config.mk
|
||||
|
||||
$(info ==ATRIP== using configuration CONFIG=$(CONFIG))
|
||||
|
||||
ORG_MAIN = atrip.org
|
||||
OBJ_FILES = $(patsubst %.cxx,%.o,$(filter-out %.hpp,$(ATRIP_SOURCES)))
|
||||
DEP_FILES = $(patsubst %.o,%.d,$(OBJ_FILES))
|
||||
ATRIP_SHARED_LIBRARY = lib/$(CONFIG)/libatrip.so
|
||||
ATRIP_STATIC_LIBRARY = lib/$(CONFIG)/libatrip.a
|
||||
|
||||
|
||||
extern: $(EXTERNAL_DEPENDENCIES)
|
||||
clean-extern: CLEANING=yes
|
||||
clean-extern:
|
||||
rm -vrf extern
|
||||
#$(DEP_FILES): extern
|
||||
.PHONY: extern
|
||||
|
||||
lib: extern
|
||||
lib: $(DEP_FILES)
|
||||
lib: $(ATRIP_SHARED_LIBRARY) $(ATRIP_STATIC_LIBRARY)
|
||||
static: $(ATRIP_STATIC_LIBRARY)
|
||||
shared: $(ATRIP_SHARED_LIBRARY)
|
||||
.PHONY: lib static shared
|
||||
|
||||
ifeq ($(MAKECMD),lib)
|
||||
include $(DEP_FILES)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
$(ATRIP_SHARED_LIBRARY): $(OBJ_FILES)
|
||||
mkdir -p $(@D)
|
||||
$(CXX) -shared $< $(CXXFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
$(ATRIP_STATIC_LIBRARY): $(OBJ_FILES)
|
||||
mkdir -p $(@D)
|
||||
$(AR) rcs $@ $<
|
||||
|
||||
$(SOURCES_FILE): config.el
|
||||
echo -n "ATRIP_SOURCES = " > $@
|
||||
$(EMACS) -f atrip-print-sources >> $@
|
||||
|
||||
print:
|
||||
$(info $(filter-out %.hpp,$(ATRIP_SOURCES)))
|
||||
|
||||
$(ATRIP_SOURCES): $(ORG_MAIN)
|
||||
$(call tangle,$<)
|
||||
|
||||
tangle: $(ATRIP_SOURCES)
|
||||
|
||||
clean-emacs: CLEANING=yes
|
||||
clean-emacs:
|
||||
-rm -v $(ATRIP_SOURCES)
|
||||
|
||||
clean: CLEANING=yes
|
||||
clean:
|
||||
-rm -v \
|
||||
$(OBJ_FILES) \
|
||||
$(DEP_FILES) \
|
||||
$(ATRIP_SHARED_LIBRARY) \
|
||||
$(ATRIP_STATIC_LIBRARY)
|
||||
|
||||
clean-all: CLEANING=yes
|
||||
clean-all: bench-clean clean-emacs clean clean-extern
|
||||
|
||||
bench: $(BENCH_TARGETS)
|
||||
$(BENCH_TARGETS): $(ATRIP_STATIC_LIBRARY)
|
||||
|
||||
.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
|
||||
install:
|
||||
mkdir -p $(PREFIX)/include
|
||||
cp -r include/* $(PREFIX)/include/
|
||||
mkdir -p $(PREFIX)/lib
|
||||
cp $(wildcard $(ATRIP_SHARED_LIBRARY) $(ATRIP_STATIC_LIBRARY)) $(PREFIX)/lib/
|
||||
|
||||
.PHONY: html
|
||||
EMACS_HTML = $(EMACS) --load ./etc/emacs/html.el
|
||||
HTML_MAIN = $(patsubst %.org,%.html,$(ORG_MAIN))
|
||||
html: $(HTML_MAIN)
|
||||
%.html: %.org
|
||||
$(EMACS_HTML) $< -f org-html-export-to-html
|
||||
|
||||
%.rst: %.org
|
||||
$(EMACS_HTML) $< -f org-rst-export-to-rst
|
||||
|
||||
.PHONY: dbg
|
||||
dbg: include/dbg.h
|
||||
include/dbg.h:
|
||||
wget -O $@ "https://raw.githubusercontent.com/sharkdp/dbg-macro/master/dbg.h"
|
||||
32
Makefile.am
Normal file
32
Makefile.am
Normal file
@ -0,0 +1,32 @@
|
||||
include ./etc/make/emacs.mk
|
||||
|
||||
SUBDIRS = src bench
|
||||
|
||||
_ATRIPSRCS = Sources.mk
|
||||
## include $(_ATRIPSRCS)
|
||||
|
||||
ORG_MAIN = atrip.org
|
||||
ATRIP_SHARED_LIBRARY = lib/$(CONFIG)/libatrip.so
|
||||
ATRIP_STATIC_LIBRARY = lib/$(CONFIG)/libatrip.a
|
||||
|
||||
tangle: $(ORG_MAIN)
|
||||
$(call tangle,$<)
|
||||
|
||||
clean-emacs: CLEANING=yes
|
||||
clean-emacs:
|
||||
-rm -v $(_ATRIPSRCS)
|
||||
|
||||
.PHONY: tangle
|
||||
|
||||
EMACS_HTML = $(EMACS) --load ./etc/emacs/html.el
|
||||
|
||||
%.html: %.org
|
||||
$(EMACS_HTML) $< -f org-html-export-to-html
|
||||
|
||||
%.rst: %.org
|
||||
$(EMACS_HTML) $< -f org-rst-export-to-rst
|
||||
|
||||
.PHONY: dbg
|
||||
dbg: include/dbg.h
|
||||
include/dbg.h:
|
||||
wget -O $@ "https://raw.githubusercontent.com/sharkdp/dbg-macro/master/dbg.h"
|
||||
@ -1 +1 @@
|
||||
ATRIP_SOURCES = include/atrip.hpp src/atrip/Atrip.cxx include/atrip/Atrip.hpp include/atrip/Debug.hpp include/atrip/Equations.hpp include/atrip/Tuples.hpp include/atrip/Unions.hpp include/atrip/RankMap.hpp include/atrip/Blas.hpp include/atrip/Utils.hpp include/atrip/SliceUnion.hpp include/atrip/Slice.hpp
|
||||
_ATRIPSRCS = include/atrip.hpp src/atrip/Atrip.cxx include/atrip/Atrip.hpp include/atrip/Debug.hpp include/atrip/Equations.hpp include/atrip/Tuples.hpp include/atrip/Unions.hpp include/atrip/RankMap.hpp include/atrip/Blas.hpp include/atrip/Utils.hpp include/atrip/SliceUnion.hpp include/atrip/Slice.hpp
|
||||
|
||||
@ -1645,6 +1645,7 @@ getNodeInfos(std::vector<string> const& nodeNames) {
|
||||
nodeId,
|
||||
globalRank++,
|
||||
localRanks[nodeId]++,
|
||||
(size_t)
|
||||
std::count(nodeNames.begin(),
|
||||
nodeNames.end(),
|
||||
name)
|
||||
@ -3117,7 +3118,6 @@ Atrip::Output Atrip::run(Atrip::Input<F> const& in) {
|
||||
|
||||
|
||||
using Database = typename Slice<F>::Database;
|
||||
using LocalDatabase = typename Slice<F>::LocalDatabase;
|
||||
auto communicateDatabase
|
||||
= [ &unions
|
||||
, np
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
AM_LDFLAGS = -fopenmp
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include/
|
||||
|
||||
bin_PROGRAMS = test_main
|
||||
test_main_SOURCES = test_main.cxx
|
||||
@ -7,6 +8,5 @@ test_main_LDADD = \
|
||||
-lopenblas \
|
||||
-lscalapack \
|
||||
@LIBCTF_LD_LIBRARY_PATH@/libctf.a \
|
||||
@abs_top_builddir@/src/libatrip.a
|
||||
$(top_builddir)/src/libatrip.a
|
||||
|
||||
#LDFLAGS += @ATRIP_LDFLAGS@
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include <iostream>
|
||||
#include <atrip.hpp>
|
||||
#include <atrip/Debug.hpp>
|
||||
#include <bench/CLI11.hpp>
|
||||
#include <CLI11.hpp>
|
||||
|
||||
#define _print_size(what, size) \
|
||||
if (rank == 0) { \
|
||||
|
||||
60
configure.ac
60
configure.ac
@ -9,30 +9,32 @@ AC_CONFIG_SRCDIR([.])
|
||||
AC_PREREQ(2.69)
|
||||
AC_LANG([C++])
|
||||
AC_CONFIG_MACRO_DIR([./etc/m4])
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AC_CONFIG_AUX_DIR([./etc/autotools])
|
||||
AM_INIT_AUTOMAKE([foreign -Wall])
|
||||
|
||||
|
||||
dnl -----------------------------------------------------------------------
|
||||
dnl Configure switches
|
||||
|
||||
AC_ARG_ENABLE(shared,
|
||||
AS_HELP_STRING( [--enable-shared],
|
||||
[enable loading compiled files (default=YES)]),
|
||||
[], [enable_shared=yes])
|
||||
AS_HELP_STRING([--enable-shared],
|
||||
[enable loading compiled
|
||||
files (default=YES)]),
|
||||
[], [enable_shared=yes])
|
||||
|
||||
dnl LIBGC library options
|
||||
AC_ARG_WITH(libctf-prefix,
|
||||
AS_HELP_STRING( [--with-libctf-prefix=path],
|
||||
[prefix for system LIBGC includes and libraries] ),
|
||||
[LIBCTF_CPATH="$withval/include";
|
||||
LIBCTF_LD_LIBRARY_PATH="$withval/lib";
|
||||
BUILD_CTF=NO],
|
||||
[BUILD_CTF=YES])
|
||||
AS_HELP_STRING([--with-libctf-prefix=path],
|
||||
[prefix for CTF includes and libraries] ),
|
||||
[LIBCTF_CPATH="`readlink -f $withval`/include";
|
||||
LIBCTF_LD_LIBRARY_PATH="`readlink -f $withval`/lib";
|
||||
BUILD_CTF=NO],
|
||||
[BUILD_CTF=YES])
|
||||
|
||||
AC_ARG_WITH(dgemm,
|
||||
AS_HELP_STRING( [--without-dgemm],
|
||||
[Disable dgemm]),
|
||||
[with_dgemm=NO], [with_dgemm=YES])
|
||||
AS_HELP_STRING([--without-dgemm], [Disable dgemm]),
|
||||
[with_dgemm=NO],
|
||||
[with_dgemm=YES])
|
||||
|
||||
|
||||
|
||||
@ -52,6 +54,7 @@ AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_PROG_CXX dnl sets variable CXX
|
||||
AM_PROG_AR
|
||||
AC_PROG_CPP dnl sets variable CPP
|
||||
AC_PROG_RANLIB dnl sets variable RANLIB
|
||||
AC_PROG_INSTALL dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
|
||||
@ -64,21 +67,31 @@ AC_TYPE_SIZE_T
|
||||
AC_FUNC_MALLOC
|
||||
|
||||
AX_CXX_COMPILE_STDCXX([11])
|
||||
|
||||
AX_CXX_STATIC_CAST
|
||||
AX_CXX_TEMPLATES
|
||||
AX_CXX_TYPENAME
|
||||
AX_MPI([],
|
||||
[AC_MSG_ERROR([You don not have an MPI Implementation!])])
|
||||
AX_PROG_CXX_MPI
|
||||
CXX=${MPICXX}
|
||||
|
||||
CXXFLAGS="$CXXFLAGS -I$PWD/include"
|
||||
CXXFLAGS="$CXXFLAGS -I${LIBCTF_CPATH}"
|
||||
LDFLAGS="$LDFLAGS -L${LIBCTF_LD_LIBRARY_PATH} -lctf"
|
||||
dnl ---------- CHECK CTF
|
||||
if test xYES = x${BUILD_CTF}; then
|
||||
AC_MSG_ERROR([Sorry, building CTF not supported yet provide a build path
|
||||
with --with-libctf-prefix=path])
|
||||
else
|
||||
CPPFLAGS="$CPPFLAGS -I${LIBCTF_CPATH}"
|
||||
LDFLAGS="$LDFLAGS -L${LIBCTF_LD_LIBRARY_PATH} -lctf"
|
||||
AC_CHECK_HEADER([ctf.hpp],
|
||||
[],
|
||||
[AC_MSG_ERROR([no ctf.hpp])])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
src/Makefile
|
||||
bench/Makefile
|
||||
etc/config/auto.mk
|
||||
])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
bench/Makefile
|
||||
])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_MSG_RESULT([
|
||||
@ -86,11 +99,8 @@ AC_MSG_RESULT([
|
||||
-----------------------
|
||||
CXX = $CXX
|
||||
CXXFLAGS = $CXXFLAGS
|
||||
DEFAULT_INCLUDES = $DEFAULT_INCLUDES
|
||||
LDFLAGS = $LDFLAGS
|
||||
ATRIP_LDFLAGS = $ATRIP_LDFLAGS
|
||||
bindir = $bindir
|
||||
libdir = $libdir
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@ -125,6 +125,7 @@ getNodeInfos(std::vector<string> const& nodeNames) {
|
||||
nodeId,
|
||||
globalRank++,
|
||||
localRanks[nodeId]++,
|
||||
(size_t)
|
||||
std::count(nodeNames.begin(),
|
||||
nodeNames.end(),
|
||||
name)
|
||||
|
||||
@ -1,2 +1,8 @@
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
AM_CXXFLAGS = -Wall --pedantic
|
||||
|
||||
lib_LIBRARIES = libatrip.a
|
||||
libatrip_a_SOURCES = atrip/Atrip.cxx
|
||||
|
||||
libatrip_a_CPPFLAGS = -I$(top_srcdir)/include/
|
||||
libatrip_a_SOURCES = ./atrip/Atrip.cxx
|
||||
|
||||
@ -157,7 +157,6 @@ Atrip::Output Atrip::run(Atrip::Input<F> const& in) {
|
||||
|
||||
|
||||
using Database = typename Slice<F>::Database;
|
||||
using LocalDatabase = typename Slice<F>::LocalDatabase;
|
||||
auto communicateDatabase
|
||||
= [ &unions
|
||||
, np
|
||||
|
||||
Loading…
Reference in New Issue
Block a user