mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
-DHAVE_CONFIG_H
This commit is contained in:
parent
e2ee986032
commit
66d606ff1e
@ -51,7 +51,7 @@ $(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) $(srcdir)/src/Make
|
|||||||
cp $(srcdir)/munit/munit.h munit/munit.c $(distdir)/munit/
|
cp $(srcdir)/munit/munit.h munit/munit.c $(distdir)/munit/
|
||||||
cp $(srcdir)/src/*.c src/*.h src/*.f90 $(distdir)/src/
|
cp $(srcdir)/src/*.c src/*.h src/*.f90 $(distdir)/src/
|
||||||
cp $(srcdir)/src/Makefile.generated.in $(distdir)/src/Makefile.in
|
cp $(srcdir)/src/Makefile.generated.in $(distdir)/src/Makefile.in
|
||||||
cp $(srcdir)/config.h.in $(distdir)/config.h.in
|
cp $(srcdir)/include/config.h.in $(distdir)/include/config.h.in
|
||||||
cp $(qmckl_h) $(distdir)/include
|
cp $(qmckl_h) $(distdir)/include
|
||||||
cp $(srcdir)/Makefile.in $(distdir)/
|
cp $(srcdir)/Makefile.in $(distdir)/
|
||||||
cp $(srcdir)/share/doc/qmckl/html/*.html $(distdir)/share/doc/qmckl/html/
|
cp $(srcdir)/share/doc/qmckl/html/*.html $(distdir)/share/doc/qmckl/html/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
autoreconf --install
|
autoreconf --install
|
||||||
automake --add-missing --copy > /dev/null 2>&1
|
automake --add-missing --copy &> /dev/null
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
26
configure.ac
26
configure.ac
@ -10,7 +10,7 @@ AC_INIT([QMCkl],[0.1.1],
|
|||||||
[https://trex-coe.github.io/qmckl/index.html])
|
[https://trex-coe.github.io/qmckl/index.html])
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR([src/README.org])
|
AC_CONFIG_SRCDIR([src/README.org])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([include/config.h])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
#AM_MAINTAINER_MODE
|
#AM_MAINTAINER_MODE
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ AC_PROG_INSTALL
|
|||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_CC_C99
|
AC_PROG_CC_C99
|
||||||
AC_CHECK_PROGS([EMACS],[emacs26 emacs],[no])
|
AC_CHECK_PROGS([EMACS],[emacs26 emacs],[no])
|
||||||
|
AC_CHECK_PROGS([HAS_CPPCHECK],[cppcheck],[no])
|
||||||
PKG_PROG_PKG_CONFIG()
|
PKG_PROG_PKG_CONFIG()
|
||||||
PKG_LIBS=""
|
PKG_LIBS=""
|
||||||
PKG_CFLAGS=""
|
PKG_CFLAGS=""
|
||||||
@ -52,6 +53,13 @@ if test x${EMACS} == xno ; then
|
|||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x${HAS_CPPCHECK} == xno ; then
|
||||||
|
HAS_CPPCHECK=0
|
||||||
|
else
|
||||||
|
HAS_CPPCHECK=1
|
||||||
|
fi
|
||||||
|
AC_SUBST([HAS_CPPCHECK])
|
||||||
|
|
||||||
# fPIC option
|
# fPIC option
|
||||||
AC_MSG_CHECKING(whether fPIC compiler option is accepted in C)
|
AC_MSG_CHECKING(whether fPIC compiler option is accepted in C)
|
||||||
SAVED_CFLAGS="${CFLAGS}"
|
SAVED_CFLAGS="${CFLAGS}"
|
||||||
@ -120,22 +128,26 @@ if test "$ok" = "yes"; then
|
|||||||
-traceback -check all -debug all -fpe-all=0 -implicitnone"
|
-traceback -check all -debug all -fpe-all=0 -implicitnone"
|
||||||
fi
|
fi
|
||||||
AC_DEFINE(DEBUG,1,[Define to turn on debugging checks])
|
AC_DEFINE(DEBUG,1,[Define to turn on debugging checks])
|
||||||
|
ARGS="${ARGS} debug"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(debug-malloc, [AC_HELP_STRING([--enable-debug-malloc],[use debug malloc/free])], ok=$enableval, ok=no)
|
AC_ARG_ENABLE(malloc-trace, [AC_HELP_STRING([--enable-malloc-trace],[use debug malloc/free])], ok=$enableval, ok=no)
|
||||||
if test "$ok" = "yes"; then
|
if test "$ok" = "yes"; then
|
||||||
AC_DEFINE(DEBUG_MALLOC,1,[Define to use debugging malloc/free])
|
AC_DEFINE(MALLOC_TRACE,"malloc_trace.dat",[Define to use debugging malloc/free])
|
||||||
|
ARGS="${ARGS} malloc-trace"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(prof, [AC_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no)
|
AC_ARG_ENABLE(prof, [AC_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no)
|
||||||
if test "$ok" = "yes"; then
|
if test "$ok" = "yes"; then
|
||||||
CFLAGS="${CFLAGS} -pg"
|
CFLAGS="${CFLAGS} -pg"
|
||||||
AC_DEFINE(ENABLE_PROF,1,[Define when using the profiler tool])
|
AC_DEFINE(ENABLE_PROF,1,[Define when using the profiler tool])
|
||||||
|
ARGS="${ARGS} prof"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(efence, [AC_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no)
|
AC_ARG_WITH(efence, [AC_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no)
|
||||||
if test "$ok" = "yes"; then
|
if test "$ok" = "yes"; then
|
||||||
AC_CHECK_LIB(efence, malloc)
|
AC_CHECK_LIB(efence, malloc)
|
||||||
|
ARGS="${ARGS} efence"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(munit, [AC_HELP_STRING([--without-munit],[use munit for testing])], ok=yes, ok=no)
|
AC_ARG_WITH(munit, [AC_HELP_STRING([--without-munit],[use munit for testing])], ok=yes, ok=no)
|
||||||
@ -147,9 +159,9 @@ AC_CHECK_FILE([munit/munit.h], [],
|
|||||||
$ git submodule update --init
|
$ git submodule update --init
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
]) )
|
]) )
|
||||||
|
else
|
||||||
AC_DEFINE(ENABLE_MUNIT,1,[Define when using munit])
|
ARGS="${ARGS} munit"
|
||||||
HAVE_MUNIT=1
|
AC_DEFINE(HAVE_MUNIT,1,[Define when using munit])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -223,7 +235,7 @@ LDFLAGS: ${LDFLAGS}
|
|||||||
LIBS: ${LIBS}
|
LIBS: ${LIBS}
|
||||||
|
|
||||||
Package features:
|
Package features:
|
||||||
Compilation with HDF5: ${hdf5}
|
${ARGS}
|
||||||
|
|
||||||
Now type 'make @<:@<target>@:>@'
|
Now type 'make @<:@<target>@:>@'
|
||||||
where the optional <target> is:
|
where the optional <target> is:
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* include/config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
/* Define to turn on debugging checks */
|
/* Define to turn on debugging checks */
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
/* Define to use debugging malloc/free */
|
|
||||||
#undef DEBUG_MALLOC
|
|
||||||
|
|
||||||
/* Define when using munit */
|
|
||||||
#undef ENABLE_MUNIT
|
|
||||||
|
|
||||||
/* Define when using the profiler tool */
|
/* Define when using the profiler tool */
|
||||||
#undef ENABLE_PROF
|
#undef ENABLE_PROF
|
||||||
|
|
||||||
@ -80,6 +74,9 @@
|
|||||||
/* Define to 1 if you have the `memset' function. */
|
/* Define to 1 if you have the `memset' function. */
|
||||||
#undef HAVE_MEMSET
|
#undef HAVE_MEMSET
|
||||||
|
|
||||||
|
/* Define when using munit */
|
||||||
|
#undef HAVE_MUNIT
|
||||||
|
|
||||||
/* Define to 1 if you have the `nl_langinfo' function. */
|
/* Define to 1 if you have the `nl_langinfo' function. */
|
||||||
#undef HAVE_NL_LANGINFO
|
#undef HAVE_NL_LANGINFO
|
||||||
|
|
||||||
@ -150,6 +147,9 @@
|
|||||||
/* Define to 1 if the system has the type `_Bool'. */
|
/* Define to 1 if the system has the type `_Bool'. */
|
||||||
#undef HAVE__BOOL
|
#undef HAVE__BOOL
|
||||||
|
|
||||||
|
/* Define to use debugging malloc/free */
|
||||||
|
#undef MALLOC_TRACE
|
||||||
|
|
||||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||||
#undef NO_MINUS_C_MINUS_O
|
#undef NO_MINUS_C_MINUS_O
|
||||||
|
|
@ -6,8 +6,11 @@ version = @PACKAGE_VERSION@
|
|||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS= @CFLAGS@ -I../munit/ -I../include
|
DEFS = @DEFS@
|
||||||
|
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I$(srcdir)
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
|
||||||
FC = @FC@
|
FC = @FC@
|
||||||
FCFLAGS= @FCFLAGS@
|
FCFLAGS= @FCFLAGS@
|
||||||
@ -20,7 +23,7 @@ TESTS_F = test_qmckl_ao_f.o test_qmckl_distance_f.o
|
|||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
FCLIBS = @FCLIBS@
|
FCLIBS = @FCLIBS@
|
||||||
|
|
||||||
QMCKL_ROOT=$(shell dirname $(CURDIR))
|
QMCKL_ROOT=..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
||||||
@ -55,12 +58,13 @@ qmckl_f.o: $(qmckl_f)
|
|||||||
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
||||||
|
|
||||||
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(munit) $(TESTS) $(TESTS_F) $(static_lib) $(LIBS) \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(munit) $(TESTS) $(TESTS_F) \
|
||||||
$(FCLIBS) test_qmckl.c -o $@
|
$(static_lib) $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) -Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
||||||
$(munit) $(TESTS) $(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
|
||||||
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
./test_qmckl
|
./test_qmckl
|
||||||
@ -95,7 +99,7 @@ uninstall:
|
|||||||
.SUFFIXES: .c .f90 .o
|
.SUFFIXES: .c .f90 .o
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) -c $*.c -o $*.o
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $*.c -o $*.o
|
||||||
|
|
||||||
.f90.o: qmckl_f.o
|
.f90.o: qmckl_f.o
|
||||||
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
||||||
|
@ -18,20 +18,24 @@ FC = @FC@
|
|||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
FCFLAGS = @FCFLAGS@
|
FCFLAGS = @FCFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
|
|
||||||
|
|
||||||
HAS_CPPCHECK = @HAS_CPPCHECK@
|
HAS_CPPCHECK = @HAS_CPPCHECK@
|
||||||
|
|
||||||
QMCKL_ROOT=$(shell dirname $(CURDIR))
|
# VPATH-related substitution variables
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
|
QMCKL_ROOT=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
||||||
|
|
||||||
export CC CFLAGS FC FCFLAGS LIBS QMCKL_ROOT
|
export CC CFLAGS DEFS FC FCFLAGS LIBS QMCKL_ROOT
|
||||||
|
|
||||||
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
|
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
|
||||||
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
||||||
|
@ -36,24 +36,33 @@ gradients and Laplacian of the atomic basis functions.
|
|||||||
* Headers :noexport:
|
* Headers :noexport:
|
||||||
#+begin_src elisp :noexport :results none
|
#+begin_src elisp :noexport :results none
|
||||||
(org-babel-lob-ingest "../tools/lib.org")
|
(org-babel-lob-ingest "../tools/lib.org")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
#+begin_src c :tangle (eval h_private_type)
|
#+begin_src c :tangle (eval h_private_type)
|
||||||
#ifndef QMCKL_AO_HPT
|
#ifndef QMCKL_AO_HPT
|
||||||
#define QMCKL_AO_HPT
|
#define QMCKL_AO_HPT
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -911,7 +920,7 @@ munit_assert(qmckl_ao_basis_provided(context));
|
|||||||
const double* X,
|
const double* X,
|
||||||
const int32_t* LMAX,
|
const int32_t* LMAX,
|
||||||
double* const P,
|
double* const P,
|
||||||
const int64_t ldp );
|
const int64_t ldp );
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Source
|
*** Source
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -25,6 +28,9 @@ MunitResult test_<<filename()>>() {
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -12,6 +12,9 @@ Functions for the computation of distances between particles.
|
|||||||
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
|
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
|
@ -21,12 +21,18 @@ up-spin and down-spin electrons, and the electron coordinates.
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -27,6 +30,9 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@ optimized libraries to fine-tune the memory allocation.
|
|||||||
* Headers :noexport:
|
* Headers :noexport:
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -28,6 +31,9 @@ optimized libraries to fine-tune the memory allocation.
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include "qmckl_context_private_type.h"
|
#include "qmckl_context_private_type.h"
|
||||||
#include "qmckl_memory_private_func.h"
|
#include "qmckl_memory_private_func.h"
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -18,6 +21,9 @@ MunitResult test_<<filename()>>() {
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -82,6 +82,9 @@ echo "#+end_src"
|
|||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#include "mcheck.h"
|
#include "mcheck.h"
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
<<headers>>
|
<<headers>>
|
||||||
|
|
||||||
int main(int argc, char* argv[MUNIT_ARRAY_PARAM(argc + 1)]) {
|
int main(int argc, char* argv[MUNIT_ARRAY_PARAM(argc + 1)]) {
|
||||||
|
@ -91,6 +91,7 @@ FC = @FC@
|
|||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
FCFLAGS = @FCFLAGS@
|
FCFLAGS = @FCFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
|||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
||||||
|
|
||||||
export CC CFLAGS FC FCFLAGS LIBS QMCKL_ROOT
|
export CC CFLAGS DEFS FC FCFLAGS LIBS QMCKL_ROOT
|
||||||
|
|
||||||
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
|
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
|
||||||
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
||||||
@ -243,8 +244,11 @@ version = @PACKAGE_VERSION@
|
|||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS= @CFLAGS@ -I../munit/ -I../include
|
DEFS = @DEFS@
|
||||||
|
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
|
||||||
FC = @FC@
|
FC = @FC@
|
||||||
FCFLAGS= @FCFLAGS@
|
FCFLAGS= @FCFLAGS@
|
||||||
@ -268,7 +272,7 @@ and the rules:
|
|||||||
|
|
||||||
#+NAME: rules
|
#+NAME: rules
|
||||||
#+begin_src makefile :tangle no
|
#+begin_src makefile :tangle no
|
||||||
QMCKL_ROOT=$(shell dirname $(CURDIR))
|
QMCKL_ROOT=..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
||||||
@ -303,12 +307,13 @@ qmckl_f.o: $(qmckl_f)
|
|||||||
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
||||||
|
|
||||||
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(munit) $(TESTS) $(TESTS_F) $(static_lib) $(LIBS) \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(munit) $(TESTS) $(TESTS_F) \
|
||||||
$(FCLIBS) test_qmckl.c -o $@
|
$(static_lib) $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) -Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
||||||
$(munit) $(TESTS) $(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
|
||||||
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
./test_qmckl
|
./test_qmckl
|
||||||
@ -343,7 +348,7 @@ uninstall:
|
|||||||
.SUFFIXES: .c .f90 .o
|
.SUFFIXES: .c .f90 .o
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) -c $*.c -o $*.o
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $*.c -o $*.o
|
||||||
|
|
||||||
.f90.o: qmckl_f.o
|
.f90.o: qmckl_f.o
|
||||||
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
||||||
|
@ -71,8 +71,11 @@ version = @PACKAGE_VERSION@
|
|||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS= @CFLAGS@ -I../munit/ -I../include
|
DEFS = @DEFS@
|
||||||
|
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
|
||||||
FC = @FC@
|
FC = @FC@
|
||||||
FCFLAGS= @FCFLAGS@
|
FCFLAGS= @FCFLAGS@
|
||||||
@ -87,7 +90,7 @@ FCLIBS = @FCLIBS@
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
QMCKL_ROOT=$(shell dirname $(CURDIR))
|
QMCKL_ROOT=..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
||||||
@ -122,12 +125,13 @@ qmckl_f.o: $(qmckl_f)
|
|||||||
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
$(FC) $(FCFLAGS) -c $(qmckl_f) -o $@
|
||||||
|
|
||||||
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(munit) $(TESTS) $(TESTS_F) $(static_lib) $(LIBS) \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(munit) $(TESTS) $(TESTS_F) \
|
||||||
$(FCLIBS) test_qmckl.c -o $@
|
$(static_lib) $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) -Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib \
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
||||||
$(munit) $(TESTS) $(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
|
||||||
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
./test_qmckl
|
./test_qmckl
|
||||||
@ -162,7 +166,7 @@ uninstall:
|
|||||||
.SUFFIXES: .c .f90 .o
|
.SUFFIXES: .c .f90 .o
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) -c $*.c -o $*.o
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $*.c -o $*.o
|
||||||
|
|
||||||
.f90.o: qmckl_f.o
|
.f90.o: qmckl_f.o
|
||||||
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
$(FC) $(FCFLAGS) -c $*.f90 -o $*.o
|
||||||
|
Loading…
Reference in New Issue
Block a user