Add vendor infrastructure

This commit is contained in:
Alejandro Gallo 2022-10-03 17:11:08 +02:00
parent b11b53aca1
commit 50896e3cd0
6 changed files with 39 additions and 7 deletions

View File

@ -1,20 +1,23 @@
AUTOMAKE_OPTIONS = subdir-objects
include $(top_srcdir)/atrip.mk
AM_CPPFLAGS = -I$(top_srcdir)/include/ $(CTF_CPPFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir) $(CTF_CPPFLAGS)
AM_LDFLAGS = @LAPACK_LIBS@ @BLAS_LIBS@
bin_PROGRAMS = test_main
bin_PROGRAMS = test_main tuples-distribution
test_main_SOURCES = test_main.cxx
tuples_distribution_SOURCES = tuples-distribution.cxx
test_main_LDADD = \
$(top_builddir)/src/libatrip.a
test_main_LDADD = $(top_builddir)/src/libatrip.a
tuples_distribution_LDADD = $(top_builddir)/src/libatrip.a
if WITH_BUILD_CTF
test_main_LDADD += $(CTF_BUILD_PATH)/lib/libctf.a
tuples_distribution_LDADD += $(CTF_BUILD_PATH)/lib/libctf.a
else
test_main_LDADD += @LIBCTF_LD_LIBRARY_PATH@/libctf.a
tuples_distribution_LDADD += @LIBCTF_LD_LIBRARY_PATH@/libctf.a
endif
if WITH_CUDA

View File

@ -16,7 +16,7 @@ $(CTF_SRC_PATH)/configure:
# Here make sure that ctf does not builld with CUDA support
# since it is broken anyways
#
#
# Also we patch the file kernel.h because it mostl
# doesn't work when we try to include ctf in a CUDACC
# compiler code.

View File

@ -20,6 +20,8 @@ in
{
pkg = myopenblas;
buildInputs = with pkgs; [
myopenblas
scalapack

27
etc/nix/vendor-shell.nix Normal file
View File

@ -0,0 +1,27 @@
rec {
directory = "vendor";
src = ''
_add_vendor_cpath () {
export CPATH=$CPATH:$1
mkdir -p ${directory}/include
ln -frs $1/* ${directory}/include/
}
_add_vendor_lib () {
mkdir -p ${directory}/lib
ln -frs $1/* ${directory}/lib/
}
'';
cpath = path: ''
_add_vendor_cpath ${path}
'';
lib = path: ''
_add_vendor_lib ${path}
'';
}

View File

@ -76,7 +76,7 @@
// [[file:~/cuda/atrip/atrip.org::*Macros][Macros:2]]
#ifndef LOG
#define LOG(level, name) if (Atrip::rank == 0) std::cout << name << ": "
#define LOG(level, name) if (atrip::Atrip::rank == 0) std::cout << name << ": "
#endif
// Macros:2 ends here

View File

@ -1,5 +1,5 @@
{ compiler ? "gcc"
, pkgs ? import <nixpkgs> {}
, pkgs ? import <nixpkgs> {}
, mkl ? false
, cuda ? false
, docs ? true