mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Removed need for munit
This commit is contained in:
parent
d4711206f0
commit
ee9e3c5b55
9
.gitignore
vendored
9
.gitignore
vendored
@ -5,12 +5,12 @@ generated.mk
|
|||||||
stamp-h1
|
stamp-h1
|
||||||
libtool
|
libtool
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
|
missing
|
||||||
m4/libtool.m4
|
m4/libtool.m4
|
||||||
m4/ltoptions.m4
|
m4/ltoptions.m4
|
||||||
m4/ltsugar.m4
|
m4/ltsugar.m4
|
||||||
m4/ltversion.m4
|
m4/ltversion.m4
|
||||||
m4/lt~obsolete.m4
|
m4/lt~obsolete.m4
|
||||||
missing
|
|
||||||
Makefile
|
Makefile
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache/
|
autom4te.cache/
|
||||||
@ -21,4 +21,9 @@ config.sub
|
|||||||
configure
|
configure
|
||||||
install-sh
|
install-sh
|
||||||
qmckl.pc
|
qmckl.pc
|
||||||
|
Makefile.in
|
||||||
|
test-driver
|
||||||
|
.libs
|
||||||
|
.dirstamp
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "munit"]
|
|
||||||
path = munit
|
|
||||||
url = https://github.com/nemequ/munit/
|
|
55
Makefile.am
55
Makefile.am
@ -47,59 +47,38 @@ qmckl_h = $(srcdir)/include/qmckl.h
|
|||||||
include_HEADERS = $(qmckl_h)
|
include_HEADERS = $(qmckl_h)
|
||||||
|
|
||||||
qmckl_f = $(srcdir)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f = $(srcdir)/share/qmckl/fortran/qmckl_f.f90
|
||||||
|
qmckl_fo = $(srcdir)/share/qmckl/fortran/qmckl_f.$(OBJEXT)
|
||||||
|
test_qmckl_f = $(srcdir)/tests/qmckl_f.f90
|
||||||
|
src_qmckl_f = $(srcdir)/src/qmckl_f.f90
|
||||||
|
|
||||||
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
|
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
|
||||||
fortran_DATA = $(qmckl_f)
|
fortran_DATA = $(qmckl_f)
|
||||||
|
|
||||||
lib_LTLIBRARIES = src/libqmckl.la
|
AM_CPPFLAGS = -I$(srcdir)/src -I$(srcdir)/include
|
||||||
src_libqmckl_la_CPPFLAGS = -I$(srcdir)/src -I$(srcdir)/include
|
|
||||||
src_libqmckl_la_SOURCES = $(qmckl_h) $(qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
|
|
||||||
|
|
||||||
|
lib_LTLIBRARIES = src/libqmckl.la
|
||||||
|
src_libqmckl_la_SOURCES = $(qmckl_h) $(src_qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
|
||||||
|
|
||||||
export srcdir qmckl_f qmckl_h
|
export srcdir qmckl_f qmckl_h
|
||||||
|
|
||||||
|
CLEANFILES+=$(test_qmckl_f)
|
||||||
|
|
||||||
if QMCKL_DEVEL
|
|
||||||
# <-----
|
|
||||||
dist_src_DATA = $(ORG_FILES)
|
|
||||||
|
|
||||||
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
|
|
||||||
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES)
|
|
||||||
|
|
||||||
# ----->
|
|
||||||
endif
|
|
||||||
|
|
||||||
## Silent
|
|
||||||
|
|
||||||
tangle_verbose = $(tangle_verbose_@AM_V@)
|
|
||||||
tangle_verbose_ = $(tangle_verbose_@AM_DEFAULT_V@)
|
|
||||||
tangle_verbose_0 = @echo " TANGLE $<";
|
|
||||||
|
|
||||||
cat_h_verbose = $(cat_h_verbose_@AM_V@)
|
|
||||||
cat_h_verbose_ = $(cat_h_verbose_@AM_DEFAULT_V@)
|
|
||||||
cat_h_verbose_0 = @echo " HEADER $@";
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
include $(srcdir)/generated.mk
|
include $(srcdir)/generated.mk
|
||||||
|
|
||||||
SUFFIXES = .f90 .h .org .c _f.f90 _func.h _type.h _private_func.h _private_type.h
|
if QMCKL_DEVEL
|
||||||
|
include Makefile.dev.mk
|
||||||
|
else
|
||||||
|
include Makefile.dist.mk
|
||||||
|
endif
|
||||||
|
|
||||||
$(srcdir)/generated.mk: $(ORG_FILES)
|
$(srcdir)/generated.mk: $(ORG_FILES)
|
||||||
$(srcdir)/tools/build_makefile.sh
|
$(srcdir)/tools/build_makefile.sh
|
||||||
|
|
||||||
$(qmckl_h): $(H_FUNC_FILES) $(H_TYPE_FILES)
|
$(test_qmckl_f): $(qmckl_f)
|
||||||
$(cat_h_verbose)$(srcdir)/tools/build_qmckl_h.sh
|
cp $(qmckl_f) $(test_qmckl_f)
|
||||||
|
|
||||||
$(qmckl_f): $(FH_FUNC_FILES) $(FH_TYPE_FILES)
|
$(src_qmckl_f): $(qmckl_f)
|
||||||
$(cat_h_verbose)$(srcdir)/tools/build_qmckl_f.sh
|
cp $(qmckl_f) $(src_qmckl_f)
|
||||||
|
|
||||||
$(srcdir)/src/qmckl_f.f90: $(qmckl_f)
|
|
||||||
cp $(qmckl_f) $(srcdir)/src/qmckl_f.f90
|
|
||||||
|
|
||||||
#lib_LTLIBRARIES = $(top_srcdir)/src/libqmckl.la
|
|
||||||
#
|
|
||||||
#$(top_srcdir)/src/libqmckl.la;
|
|
||||||
# $(MAKE) -C src libqmckl.la
|
|
||||||
#
|
|
||||||
|
|
||||||
rpms srcrpm:
|
rpms srcrpm:
|
||||||
for dir in $(SUBDIRS); do \
|
for dir in $(SUBDIRS); do \
|
||||||
|
63
Makefile.dev.mk
Normal file
63
Makefile.dev.mk
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# QMCkl - Quantum Monte Carlo kernel library
|
||||||
|
#
|
||||||
|
# BSD 3-Clause License
|
||||||
|
#
|
||||||
|
# Copyright (c) 2020, TREX Center of Excellence
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
# list of conditions and the following disclaimer.
|
||||||
|
#
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer in the documentation
|
||||||
|
# and/or other materials provided with the distribution.
|
||||||
|
#
|
||||||
|
# 3. Neither the name of the copyright holder nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived from
|
||||||
|
# this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
dist_src_DATA = $(ORG_FILES)
|
||||||
|
|
||||||
|
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(qmckl_f) $(qmckl_h)
|
||||||
|
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h)
|
||||||
|
|
||||||
|
|
||||||
|
## Silent
|
||||||
|
## ======
|
||||||
|
|
||||||
|
tangle_verbose = $(tangle_verbose_@AM_V@)
|
||||||
|
tangle_verbose_ = $(tangle_verbose_@AM_DEFAULT_V@)
|
||||||
|
tangle_verbose_0 = @echo " TANGLE $<";
|
||||||
|
|
||||||
|
cat_h_verbose = $(cat_h_verbose_@AM_V@)
|
||||||
|
cat_h_verbose_ = $(cat_h_verbose_@AM_DEFAULT_V@)
|
||||||
|
cat_h_verbose_0 = @echo " HEADER $@";
|
||||||
|
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
## =====
|
||||||
|
|
||||||
|
SUFFIXES = .f90 .h .org .c _f.f90 _func.h _type.h _private_func.h _private_type.h
|
||||||
|
|
||||||
|
$(qmckl_h): $(H_FUNC_FILES) $(H_TYPE_FILES)
|
||||||
|
$(cat_h_verbose)$(srcdir)/tools/build_qmckl_h.sh
|
||||||
|
|
||||||
|
$(qmckl_f): $(FH_FUNC_FILES) $(FH_TYPE_FILES)
|
||||||
|
$(cat_h_verbose)$(srcdir)/tools/build_qmckl_f.sh
|
||||||
|
|
||||||
|
# vim: syntax=automake noet
|
||||||
|
|
34
Makefile.dist.mk
Normal file
34
Makefile.dist.mk
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# QMCkl - Quantum Monte Carlo kernel library
|
||||||
|
#
|
||||||
|
# BSD 3-Clause License
|
||||||
|
#
|
||||||
|
# Copyright (c) 2020, TREX Center of Excellence
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
# list of conditions and the following disclaimer.
|
||||||
|
#
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer in the documentation
|
||||||
|
# and/or other materials provided with the distribution.
|
||||||
|
#
|
||||||
|
# 3. Neither the name of the copyright holder nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived from
|
||||||
|
# this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
# vim: syntax=automake noet
|
||||||
|
|
@ -15,11 +15,8 @@ to read the documentation.
|
|||||||
|
|
||||||
To clone the repository, use:
|
To clone the repository, use:
|
||||||
```
|
```
|
||||||
git clone --recursive https://github.com/TREX-CoE/qmckl.git
|
git clone https://github.com/TREX-CoE/qmckl.git
|
||||||
```
|
```
|
||||||
to dowload also the [munit](https://github.com/nemequ/munit) unit testing
|
|
||||||
framework.
|
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
|
23
configure.ac
23
configure.ac
@ -193,29 +193,6 @@ if test "x${QMCKL_DEVEL}" != "x"; then
|
|||||||
HAS_CPPCHECK=1
|
HAS_CPPCHECK=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## munit
|
|
||||||
AC_ARG_WITH(munit, [AC_HELP_STRING([--without-munit],[use munit for testing])], ok=yes, ok=no)
|
|
||||||
if test "$ok" = "no"; then
|
|
||||||
AC_CHECK_FILE([munit/munit.h], [],
|
|
||||||
AC_MSG_ERROR([
|
|
||||||
-------------------------------------------------
|
|
||||||
Error: Git submodule for munit is not downloaded.
|
|
||||||
$ git submodule update --init
|
|
||||||
-------------------------------------------------
|
|
||||||
]) )
|
|
||||||
else
|
|
||||||
ARGS="${ARGS} munit"
|
|
||||||
AC_DEFINE(HAVE_MUNIT,1,[Define when using munit])
|
|
||||||
fi
|
|
||||||
AC_CHECK_HEADERS([fcntl.h langinfo.h limits.h locale.h mach/mach.h sys/time.h])
|
|
||||||
AC_TYPE_PID_T
|
|
||||||
AC_C_INLINE
|
|
||||||
AC_TYPE_SSIZE_T
|
|
||||||
AC_FUNC_REALLOC
|
|
||||||
AC_FUNC_STRERROR_R
|
|
||||||
AC_FUNC_FORK
|
|
||||||
AC_CHECK_FUNCS([clock_gettime dup2 gettimeofday nl_langinfo setlocale strcasecmp strtoul])
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#PKG-CONFIG
|
#PKG-CONFIG
|
||||||
|
@ -12,37 +12,15 @@
|
|||||||
/* Define to 1 if you have the <assert.h> header file. */
|
/* Define to 1 if you have the <assert.h> header file. */
|
||||||
#undef HAVE_ASSERT_H
|
#undef HAVE_ASSERT_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `clock_gettime' function. */
|
|
||||||
#undef HAVE_CLOCK_GETTIME
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRERROR_R
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#undef HAVE_DLFCN_H
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `dup2' function. */
|
|
||||||
#undef HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <errno.h> header file. */
|
/* Define to 1 if you have the <errno.h> header file. */
|
||||||
#undef HAVE_ERRNO_H
|
#undef HAVE_ERRNO_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
||||||
#undef HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `fork' function. */
|
|
||||||
#undef HAVE_FORK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gettimeofday' function. */
|
|
||||||
#undef HAVE_GETTIMEOFDAY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#undef HAVE_INTTYPES_H
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <langinfo.h> header file. */
|
|
||||||
#undef HAVE_LANGINFO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `efence' library (-lefence). */
|
/* Define to 1 if you have the `efence' library (-lefence). */
|
||||||
#undef HAVE_LIBEFENCE
|
#undef HAVE_LIBEFENCE
|
||||||
|
|
||||||
@ -52,15 +30,6 @@
|
|||||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||||
#undef HAVE_LIBPTHREAD
|
#undef HAVE_LIBPTHREAD
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <locale.h> header file. */
|
|
||||||
#undef HAVE_LOCALE_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <mach/mach.h> header file. */
|
|
||||||
#undef HAVE_MACH_MACH_H
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||||
to 0 otherwise. */
|
to 0 otherwise. */
|
||||||
#undef HAVE_MALLOC
|
#undef HAVE_MALLOC
|
||||||
@ -77,22 +46,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. */
|
|
||||||
#undef HAVE_NL_LANGINFO
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <pthread.h> header file. */
|
/* Define to 1 if you have the <pthread.h> header file. */
|
||||||
#undef HAVE_PTHREAD_H
|
#undef HAVE_PTHREAD_H
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
|
|
||||||
and to 0 otherwise. */
|
|
||||||
#undef HAVE_REALLOC
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setlocale' function. */
|
|
||||||
#undef HAVE_SETLOCALE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||||
#undef HAVE_STDBOOL_H
|
#undef HAVE_STDBOOL_H
|
||||||
|
|
||||||
@ -105,48 +61,24 @@
|
|||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
#undef HAVE_STDLIB_H
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `strcasecmp' function. */
|
|
||||||
#undef HAVE_STRCASECMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror' function. */
|
/* Define to 1 if you have the `strerror' function. */
|
||||||
#undef HAVE_STRERROR
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror_r' function. */
|
|
||||||
#undef HAVE_STRERROR_R
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
#undef HAVE_STRINGS_H
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
#undef HAVE_STRING_H
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `strtoul' function. */
|
|
||||||
#undef HAVE_STRTOUL
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
#undef HAVE_SYS_STAT_H
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
||||||
#undef HAVE_SYS_TIME_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
#undef HAVE_SYS_TYPES_H
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `vfork' function. */
|
|
||||||
#undef HAVE_VFORK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <vfork.h> header file. */
|
|
||||||
#undef HAVE_VFORK_H
|
|
||||||
|
|
||||||
/* Define to 1 if `fork' works. */
|
|
||||||
#undef HAVE_WORKING_FORK
|
|
||||||
|
|
||||||
/* Define to 1 if `vfork' works. */
|
|
||||||
#undef HAVE_WORKING_VFORK
|
|
||||||
|
|
||||||
/* 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
|
||||||
|
|
||||||
@ -192,9 +124,6 @@
|
|||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
/* Define to 1 if strerror_r returns char *. */
|
|
||||||
#undef STRERROR_R_CHAR_P
|
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
||||||
@ -208,12 +137,6 @@
|
|||||||
#define below would cause a syntax error. */
|
#define below would cause a syntax error. */
|
||||||
#undef _UINT64_T
|
#undef _UINT64_T
|
||||||
|
|
||||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
|
||||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
|
||||||
#ifndef __cplusplus
|
|
||||||
#undef inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to the type of a signed integer type of width exactly 32 bits if
|
/* Define to the type of a signed integer type of width exactly 32 bits if
|
||||||
such a type exists and the standard includes do not define it. */
|
such a type exists and the standard includes do not define it. */
|
||||||
#undef int32_t
|
#undef int32_t
|
||||||
@ -225,18 +148,9 @@
|
|||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
/* Define to rpl_malloc if the replacement function should be used. */
|
||||||
#undef malloc
|
#undef malloc
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
#undef pid_t
|
|
||||||
|
|
||||||
/* Define to rpl_realloc if the replacement function should be used. */
|
|
||||||
#undef realloc
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
#undef size_t
|
#undef size_t
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
#undef ssize_t
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||||
such a type exists and the standard includes do not define it. */
|
such a type exists and the standard includes do not define it. */
|
||||||
#undef uint32_t
|
#undef uint32_t
|
||||||
@ -244,6 +158,3 @@
|
|||||||
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
||||||
such a type exists and the standard includes do not define it. */
|
such a type exists and the standard includes do not define it. */
|
||||||
#undef uint64_t
|
#undef uint64_t
|
||||||
|
|
||||||
/* Define as `fork' if `vfork' does not work. */
|
|
||||||
#undef vfork
|
|
||||||
|
@ -48,12 +48,12 @@ gradients and Laplacian of the atomic basis functions.
|
|||||||
|
|
||||||
#+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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -829,51 +829,51 @@ double coefficient [prim_num] =
|
|||||||
|
|
||||||
qmckl_exit_code rc;
|
qmckl_exit_code rc;
|
||||||
|
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_type (context, typ);
|
rc = qmckl_set_ao_basis_type (context, typ);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_num (context, shell_num);
|
rc = qmckl_set_ao_basis_shell_num (context, shell_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_prim_num (context, prim_num);
|
rc = qmckl_set_ao_basis_prim_num (context, prim_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_center (context, shell_center);
|
rc = qmckl_set_ao_basis_shell_center (context, shell_center);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom);
|
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor);
|
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_center (context, shell_prim_num);
|
rc = qmckl_set_ao_basis_shell_center (context, shell_prim_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num);
|
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index);
|
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_exponent (context, exponent);
|
rc = qmckl_set_ao_basis_exponent (context, exponent);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_coefficient (context, coefficient);
|
rc = qmckl_set_ao_basis_coefficient (context, coefficient);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(qmckl_ao_basis_provided(context));
|
assert(qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -1071,7 +1071,7 @@ end function test_qmckl_ao_power
|
|||||||
|
|
||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
int test_qmckl_ao_power(qmckl_context context);
|
int test_qmckl_ao_power(qmckl_context context);
|
||||||
munit_assert_int(0, ==, test_qmckl_ao_power(context));
|
assert(0 == test_qmckl_ao_power(context));
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Value, Gradient and Laplacian of a polynomial
|
** Value, Gradient and Laplacian of a polynomial
|
||||||
@ -1447,7 +1447,7 @@ end function test_qmckl_ao_polynomial_vgl
|
|||||||
|
|
||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
int test_qmckl_ao_polynomial_vgl(qmckl_context context);
|
int test_qmckl_ao_polynomial_vgl(qmckl_context context);
|
||||||
munit_assert_int(0, ==, test_qmckl_ao_polynomial_vgl(context));
|
assert(0 == test_qmckl_ao_polynomial_vgl(context));
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Radial part
|
* Radial part
|
||||||
@ -1657,7 +1657,7 @@ end function test_qmckl_ao_gaussian_vgl
|
|||||||
|
|
||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
int test_qmckl_ao_gaussian_vgl(qmckl_context context);
|
int test_qmckl_ao_gaussian_vgl(qmckl_context context);
|
||||||
munit_assert_int(0, ==, test_qmckl_ao_gaussian_vgl(context));
|
assert(0 == test_qmckl_ao_gaussian_vgl(context));
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** TODO Slater basis functions
|
** TODO Slater basis functions
|
||||||
@ -1672,9 +1672,10 @@ munit_assert_int(0, ==, test_qmckl_ao_gaussian_vgl(context));
|
|||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
if (qmckl_context_destroy(context) != QMCKL_SUCCESS)
|
rc = qmckl_context_destroy(context);
|
||||||
return QMCKL_FAILURE;
|
assert (rc == QMCKL_SUCCESS);
|
||||||
return MUNIT_OK;
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
#+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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval h_private_type) :noweb yes
|
#+begin_src c :tangle (eval h_private_type) :noweb yes
|
||||||
@ -253,11 +253,11 @@ qmckl_context qmckl_context_create() {
|
|||||||
|
|
||||||
# Test
|
# Test
|
||||||
#+begin_src c :comments link :tangle (eval c_test) :exports none
|
#+begin_src c :comments link :tangle (eval c_test) :exports none
|
||||||
munit_assert_int64( qmckl_context_check(QMCKL_NULL_CONTEXT), ==, QMCKL_NULL_CONTEXT);
|
assert( qmckl_context_check(QMCKL_NULL_CONTEXT) == QMCKL_NULL_CONTEXT);
|
||||||
|
|
||||||
qmckl_context context = qmckl_context_create();
|
qmckl_context context = qmckl_context_create();
|
||||||
munit_assert_int64( context, !=, QMCKL_NULL_CONTEXT );
|
assert( context != QMCKL_NULL_CONTEXT );
|
||||||
munit_assert_int64( qmckl_context_check(context), ==, context );
|
assert( qmckl_context_check(context) == context );
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Locking
|
** Locking
|
||||||
@ -445,15 +445,15 @@ qmckl_exit_code qmckl_context_destroy(const qmckl_context context) {
|
|||||||
# Test
|
# Test
|
||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
/* Destroy valid context */
|
/* Destroy valid context */
|
||||||
munit_assert_int64(qmckl_context_check(context), ==, context);
|
assert(qmckl_context_check(context) == context);
|
||||||
munit_assert_int32(qmckl_context_destroy(context), ==, QMCKL_SUCCESS);
|
assert(qmckl_context_destroy(context) == QMCKL_SUCCESS);
|
||||||
|
|
||||||
/* Check that context is destroyed */
|
/* Check that context is destroyed */
|
||||||
munit_assert_int64(qmckl_context_check(context), !=, context);
|
assert(qmckl_context_check(context) != context);
|
||||||
munit_assert_int64(qmckl_context_check(context), ==, QMCKL_NULL_CONTEXT);
|
assert(qmckl_context_check(context) == QMCKL_NULL_CONTEXT);
|
||||||
|
|
||||||
/* Destroy invalid context */
|
/* Destroy invalid context */
|
||||||
munit_assert_int32(qmckl_context_destroy(QMCKL_NULL_CONTEXT), ==, QMCKL_INVALID_CONTEXT);
|
assert(qmckl_context_destroy(QMCKL_NULL_CONTEXT) == QMCKL_INVALID_CONTEXT);
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* End of files :noexport:
|
* End of files :noexport:
|
||||||
@ -465,7 +465,7 @@ munit_assert_int32(qmckl_context_destroy(QMCKL_NULL_CONTEXT), ==, QMCKL_INVALID_
|
|||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
return MUNIT_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -11,11 +11,11 @@ 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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ end function test_qmckl_distance_sq
|
|||||||
|
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
int test_qmckl_distance_sq(qmckl_context context);
|
int test_qmckl_distance_sq(qmckl_context context);
|
||||||
munit_assert_int(0, ==, test_qmckl_distance_sq(context));
|
assert(0 == test_qmckl_distance_sq(context));
|
||||||
#+end_src
|
#+end_src
|
||||||
* Distance
|
* Distance
|
||||||
|
|
||||||
@ -771,14 +771,13 @@ end function test_qmckl_dist
|
|||||||
|
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
int test_qmckl_dist(qmckl_context context);
|
int test_qmckl_dist(qmckl_context context);
|
||||||
munit_assert_int(0, ==, test_qmckl_dist(context));
|
assert(0 == test_qmckl_dist(context));
|
||||||
#+end_src
|
#+end_src
|
||||||
* End of files :noexport:
|
* End of files :noexport:
|
||||||
|
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
if (qmckl_context_destroy(context) != QMCKL_SUCCESS)
|
assert (qmckl_context_destroy(context) == QMCKL_SUCCESS);
|
||||||
return QMCKL_FAILURE;
|
return 0;
|
||||||
return MUNIT_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -20,11 +20,11 @@ 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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
context = qmckl_context_create();
|
context = qmckl_context_create();
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -399,18 +399,18 @@ double coord[walk_num*3*num] =
|
|||||||
|
|
||||||
qmckl_exit_code rc;
|
qmckl_exit_code rc;
|
||||||
|
|
||||||
munit_assert(!qmckl_electron_provided(context));
|
assert(!qmckl_electron_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_electron_num (context, up_num, down_num);
|
rc = qmckl_set_electron_num (context, up_num, down_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(!qmckl_electron_provided(context));
|
assert(!qmckl_electron_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_electron_walk_num (context, walk_num);
|
rc = qmckl_set_electron_walk_num (context, walk_num);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
munit_assert(qmckl_electron_provided(context));
|
assert(qmckl_electron_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_electron_coord (context, coord);
|
rc = qmckl_set_electron_coord (context, coord);
|
||||||
munit_assert_int64(rc, ==, QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -603,14 +603,14 @@ end function qmckl_compute_ee_distance_f
|
|||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
/* Reference input data */
|
/* Reference input data */
|
||||||
|
|
||||||
munit_assert(qmckl_electron_provided(context));
|
assert(qmckl_electron_provided(context));
|
||||||
|
|
||||||
double distance[walk_num*num*num];
|
double distance[walk_num*num*num];
|
||||||
rc = qmckl_get_electron_ee_distance(context, distance);
|
rc = qmckl_get_electron_ee_distance(context, distance);
|
||||||
rc = qmckl_get_electron_ee_distance(context, distance);
|
rc = qmckl_get_electron_ee_distance(context, distance);
|
||||||
munit_assert_double(distance[0], ==, 0.);
|
assert(distance[0] == 0.);
|
||||||
munit_assert_double(distance[1], ==, distance[num]);
|
assert(distance[1] == distance[num]);
|
||||||
munit_assert_double_equal(distance[1], 8.6114953086801, 12);
|
assert(abs(distance[1]-8.6114953086801) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ munit_assert_double_equal(distance[1], 8.6114953086801, 12);
|
|||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
if (qmckl_context_destroy(context) != QMCKL_SUCCESS)
|
if (qmckl_context_destroy(context) != QMCKL_SUCCESS)
|
||||||
return QMCKL_FAILURE;
|
return QMCKL_FAILURE;
|
||||||
return MUNIT_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
|
|
||||||
#+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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -360,7 +360,7 @@ if (x < 0) {
|
|||||||
|
|
||||||
** Test
|
** Test
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
return MUNIT_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -31,13 +31,13 @@ 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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#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()>>() {
|
int main() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
@ -170,19 +170,19 @@ info.size = (size_t) 3;
|
|||||||
int *a = (int*) qmckl_malloc(context, info);
|
int *a = (int*) qmckl_malloc(context, info);
|
||||||
|
|
||||||
/* Check that array of ints is OK */
|
/* Check that array of ints is OK */
|
||||||
munit_assert(a != NULL);
|
assert(a != NULL);
|
||||||
a[0] = 1; munit_assert_int(a[0], ==, 1);
|
a[0] = 1; assert(a[0] == 1);
|
||||||
a[1] = 2; munit_assert_int(a[1], ==, 2);
|
a[1] = 2; assert(a[1] == 2);
|
||||||
a[2] = 3; munit_assert_int(a[2], ==, 3);
|
a[2] = 3; assert(a[2] == 3);
|
||||||
|
|
||||||
/* Allocate another array of ints */
|
/* Allocate another array of ints */
|
||||||
int *b = (int*) qmckl_malloc(context, info);
|
int *b = (int*) qmckl_malloc(context, info);
|
||||||
|
|
||||||
/* Check that array of ints is OK */
|
/* Check that array of ints is OK */
|
||||||
munit_assert(b != NULL);
|
assert(b != NULL);
|
||||||
b[0] = 1; munit_assert_int(b[0], ==, 1);
|
b[0] = 1; assert(b[0] == 1);
|
||||||
b[1] = 2; munit_assert_int(b[1], ==, 2);
|
b[1] = 2; assert(b[1] == 2);
|
||||||
b[2] = 3; munit_assert_int(b[2], ==, 3);
|
b[2] = 3; assert(b[2] == 3);
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
When freeing the memory with ~qmckl_free~, the context is passed, in
|
When freeing the memory with ~qmckl_free~, the context is passed, in
|
||||||
@ -246,28 +246,28 @@ qmckl_exit_code qmckl_free(qmckl_context context, void * const ptr) {
|
|||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
qmckl_exit_code rc;
|
qmckl_exit_code rc;
|
||||||
/* Assert that both arrays are allocated */
|
/* Assert that both arrays are allocated */
|
||||||
munit_assert(a != NULL);
|
assert(a != NULL);
|
||||||
munit_assert(b != NULL);
|
assert(b != NULL);
|
||||||
|
|
||||||
/* Free in NULL context */
|
/* Free in NULL context */
|
||||||
rc = qmckl_free(QMCKL_NULL_CONTEXT, a);
|
rc = qmckl_free(QMCKL_NULL_CONTEXT, a);
|
||||||
munit_assert(rc == QMCKL_INVALID_CONTEXT);
|
assert(rc == QMCKL_INVALID_CONTEXT);
|
||||||
|
|
||||||
/* Free NULL pointer */
|
/* Free NULL pointer */
|
||||||
rc = qmckl_free(context, NULL);
|
rc = qmckl_free(context, NULL);
|
||||||
munit_assert(rc == QMCKL_INVALID_ARG_2);
|
assert(rc == QMCKL_INVALID_ARG_2);
|
||||||
|
|
||||||
/* Free for the first time */
|
/* Free for the first time */
|
||||||
rc = qmckl_free(context, a);
|
rc = qmckl_free(context, a);
|
||||||
munit_assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
/* Free again */
|
/* Free again */
|
||||||
rc = qmckl_free(context, a);
|
rc = qmckl_free(context, a);
|
||||||
munit_assert(rc == QMCKL_FAILURE);
|
assert(rc == QMCKL_FAILURE);
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
rc = qmckl_context_destroy(context);
|
rc = qmckl_context_destroy(context);
|
||||||
munit_assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ munit_assert(rc == QMCKL_SUCCESS);
|
|||||||
#+end_src
|
#+end_src
|
||||||
** Test
|
** Test
|
||||||
#+begin_src c :comments org :tangle (eval c_test)
|
#+begin_src c :comments org :tangle (eval c_test)
|
||||||
return MUNIT_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
#+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 "assert.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
int main() {
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval h_private_type)
|
#+begin_src c :tangle (eval h_private_type)
|
||||||
@ -327,7 +327,7 @@ double qmckl_get_numprec_epsilon(const qmckl_context context) {
|
|||||||
|
|
||||||
*** Test
|
*** Test
|
||||||
#+begin_src c :comments link :tangle (eval c_test)
|
#+begin_src c :comments link :tangle (eval c_test)
|
||||||
return MUNIT_OK;
|
return 0;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ function make_src()
|
|||||||
|
|
||||||
cd ${srcdir}
|
cd ${srcdir}
|
||||||
|
|
||||||
declare -A DEPS DEPS_ORG DEPS_TEST
|
declare -A DEPS DEPS_ORG DEPS_TEST TESTS
|
||||||
|
|
||||||
C_FILES=
|
C_FILES=
|
||||||
F_FILES=
|
F_FILES=
|
||||||
@ -29,15 +29,14 @@ function make_src()
|
|||||||
F_TEST_FILES=
|
F_TEST_FILES=
|
||||||
TANGLED_FILES=
|
TANGLED_FILES=
|
||||||
|
|
||||||
qmckl_f=" \$(srcdir)/src/qmckl_f.o"
|
|
||||||
|
|
||||||
for org in org/*.org ; do
|
for org in org/*.org ; do
|
||||||
i=$(basename ${org%.org})
|
i=$(basename ${org%.org})
|
||||||
tangled="\$(srcdir)/org/${i}.tangled"
|
tangled="\$(srcdir)/org/${i}.tangled"
|
||||||
c_test_o="\$(srcdir)/src/test_${i}.o"
|
c_test_x="\$(srcdir)/tests/test_${i}"
|
||||||
f_test_o="\$(srcdir)/src/test_${i}_f.o"
|
c_test_o="\$(srcdir)/tests/test_${i}.o"
|
||||||
c_test="\$(srcdir)/src/test_${i}.c"
|
f_test_o="\$(srcdir)/tests/test_${i}_f.o"
|
||||||
f_test="\$(srcdir)/src/test_${i}_f.f90"
|
c_test="\$(srcdir)/tests/test_${i}.c"
|
||||||
|
f_test="\$(srcdir)/tests/test_${i}_f.f90"
|
||||||
|
|
||||||
i="\$(srcdir)/src/${i}"
|
i="\$(srcdir)/src/${i}"
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ function make_src()
|
|||||||
grep -q "(eval f)" $org
|
grep -q "(eval f)" $org
|
||||||
if [[ $? -eq 0 ]] ; then
|
if [[ $? -eq 0 ]] ; then
|
||||||
DEPS[$f90]+="$tangled "
|
DEPS[$f90]+="$tangled "
|
||||||
DEPS[$fo]+="$f90 \$(qmckl_f)"
|
DEPS[$fo]+="$f90 \$(qmckl_fo)"
|
||||||
F_FILES+=" $f90"
|
F_FILES+=" $f90"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -112,64 +111,71 @@ function make_src()
|
|||||||
grep -q "(eval c_test)" $org
|
grep -q "(eval c_test)" $org
|
||||||
if [[ $? -eq 0 ]] ; then
|
if [[ $? -eq 0 ]] ; then
|
||||||
DEPS_TEST["${c_test}"]="${tangled} "
|
DEPS_TEST["${c_test}"]="${tangled} "
|
||||||
DEPS_TEST["${c_test_o}"]+=" ${c_test} $o \$(qmckl_h)"
|
|
||||||
C_TEST_FILES+=" ${c_test}"
|
C_TEST_FILES+=" ${c_test}"
|
||||||
|
TESTS["${c_test_x}"]+="${c_test} \$(qmckl_h)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep -q "(eval f_test)" $org
|
grep -q "(eval f_test)" $org
|
||||||
if [[ $? -eq 0 ]] ; then
|
if [[ $? -eq 0 ]] ; then
|
||||||
DEPS_TEST["${f_test}"]+="${tangled} "
|
DEPS_TEST["${f_test}"]+="${tangled} "
|
||||||
DEPS_TEST["${f_test_o}"]+=" ${f_test} $fo \$(qmckl_f)"
|
|
||||||
F_TEST_FILES+=" ${f_test}"
|
F_TEST_FILES+=" ${f_test}"
|
||||||
|
TESTS["${c_test_x}"]+=" ${f_test} \$(test_qmckl_f)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
OUTPUT=${WD}/generated.mk
|
echo
|
||||||
echo > ${OUTPUT}
|
echo "## Source files"
|
||||||
echo "## Source files" > ${OUTPUT}
|
echo
|
||||||
echo >> ${OUTPUT}
|
echo "ORG_FILES=${ORG_FILES}"
|
||||||
echo "ORG_FILES=${ORG_FILES}" >> ${OUTPUT}
|
echo "TANGLED_FILES=${TANGLED_FILES}"
|
||||||
echo "TANGLED_FILES=${TANGLED_FILES}" >> ${OUTPUT}
|
echo "C_FILES=${C_FILES}"
|
||||||
echo "C_FILES=${C_FILES}" >> ${OUTPUT}
|
echo "F_FILES=${F_FILES}"
|
||||||
echo "F_FILES=${F_FILES}" >> ${OUTPUT}
|
echo "C_O_FILES=${C_O_FILES}"
|
||||||
echo "C_O_FILES=${C_O_FILES}" >> ${OUTPUT}
|
echo "F_O_FILES=${F_O_FILES}"
|
||||||
echo "F_O_FILES=${F_O_FILES}" >> ${OUTPUT}
|
echo "FH_FUNC_FILES=${FH_FUNC_FILES}"
|
||||||
echo "FH_FUNC_FILES=${FH_FUNC_FILES}" >> ${OUTPUT}
|
echo "FH_TYPE_FILES=${FH_TYPE_FILES}"
|
||||||
echo "FH_TYPE_FILES=${FH_TYPE_FILES}" >> ${OUTPUT}
|
echo "H_FUNC_FILES=${H_FUNC_FILES}"
|
||||||
echo "H_FUNC_FILES=${H_FUNC_FILES}" >> ${OUTPUT}
|
echo "H_TYPE_FILES=${H_TYPE_FILES}"
|
||||||
echo "H_TYPE_FILES=${H_TYPE_FILES}" >> ${OUTPUT}
|
echo "H_PRIVATE_FUNC_FILES=${H_PRIVATE_FUNC_FILES}"
|
||||||
echo "H_PRIVATE_FUNC_FILES=${H_PRIVATE_FUNC_FILES}" >> ${OUTPUT}
|
echo "H_PRIVATE_TYPE_FILES=${H_PRIVATE_TYPE_FILES}"
|
||||||
echo "H_PRIVATE_TYPE_FILES=${H_PRIVATE_TYPE_FILES}" >> ${OUTPUT}
|
echo "C_TEST_FILES=${C_TEST_FILES}"
|
||||||
echo "C_TEST_FILES=${C_TEST_FILES}" >> ${OUTPUT}
|
echo "F_TEST_FILES=${F_TEST_FILES}"
|
||||||
echo "F_TEST_FILES=${F_TEST_FILES}" >> ${OUTPUT}
|
echo "TESTS=${!TESTS[@]}" | sed "s|\$(srcdir)/||g"
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
|
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
echo "## Org-mode inherited dependencies" >> ${OUTPUT}
|
echo "## Org-mode inherited dependencies"
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
for f in ${!DEPS_ORG[@]} ; do
|
for f in ${!DEPS_ORG[@]} ; do
|
||||||
echo ${DEPS_ORG[$f]}: $f
|
echo ${DEPS_ORG[$f]}: $f
|
||||||
echo " \$(tangle_verbose)\$(srcdir)/tools/tangle.sh $f"
|
echo " \$(tangle_verbose)\$(srcdir)/tools/tangle.sh $f"
|
||||||
echo ""
|
echo ""
|
||||||
done >> ${OUTPUT}
|
done
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
|
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
echo "## Source dependencies" >> ${OUTPUT}
|
echo "## Source dependencies"
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
for f in ${!DEPS[@]} ; do
|
for f in ${!DEPS[@]} ; do
|
||||||
echo "${f}: ${DEPS[$f]}"
|
echo "${f}: ${DEPS[$f]}"
|
||||||
done | sort >> ${OUTPUT}
|
done | sort
|
||||||
|
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
echo "## Test files" >> ${OUTPUT}
|
echo "## Test files"
|
||||||
echo >> ${OUTPUT}
|
echo
|
||||||
for f in ${!DEPS_TEST[@]} ; do
|
for f in ${!DEPS_TEST[@]} ; do
|
||||||
echo "${f}: ${DEPS_TEST[$f]} \$(qmckl_h) \$(srcdir)/src/libqmckl.la"
|
echo "${f}: ${DEPS_TEST[$f]}"
|
||||||
done | sort >> ${OUTPUT}
|
done | sort
|
||||||
|
echo
|
||||||
|
echo "check_PROGRAMS = \$(TESTS)"
|
||||||
|
for f in ${!TESTS[@]} ; do
|
||||||
|
echo "tests_$(basename $f)_SOURCES = ${TESTS[$f]}" #| sed "s|\$(srcdir)/||"
|
||||||
|
echo "tests_$(basename $f)_LDADD = src/libqmckl.la"
|
||||||
|
done | sort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
make_src
|
OUTPUT=${WD}/generated.mk
|
||||||
|
make_src > ${OUTPUT}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
; The following is required to compute the file names
|
; The following is required to compute the file names
|
||||||
(setq pwd (file-name-directory buffer-file-name))
|
(setq pwd (file-name-directory buffer-file-name))
|
||||||
(setq wd (concat pwd "/../src/"))
|
(setq wd (concat pwd "/../src/"))
|
||||||
|
(setq td (concat pwd "/../tests/"))
|
||||||
(setq name (file-name-nondirectory (substring buffer-file-name 0 -4)))
|
(setq name (file-name-nondirectory (substring buffer-file-name 0 -4)))
|
||||||
(setq f (concat wd name "_f.f90"))
|
(setq f (concat wd name "_f.f90"))
|
||||||
(setq fh_func (concat wd name "_fh_func.f90"))
|
(setq fh_func (concat wd name "_fh_func.f90"))
|
||||||
@ -44,7 +45,7 @@
|
|||||||
(setq h_type (concat wd name "_type.h"))
|
(setq h_type (concat wd name "_type.h"))
|
||||||
(setq h_private_type (concat wd name "_private_type.h"))
|
(setq h_private_type (concat wd name "_private_type.h"))
|
||||||
(setq h_private_func (concat wd name "_private_func.h"))
|
(setq h_private_func (concat wd name "_private_func.h"))
|
||||||
(setq c_test (concat wd "test_" name ".c"))
|
(setq c_test (concat td "test_" name ".c"))
|
||||||
(setq f_test (concat wd "test_" name "_f.f90"))
|
(setq f_test (concat td "test_" name "_f.f90"))
|
||||||
(org-babel-lob-ingest "../tools/lib.org")
|
(org-babel-lob-ingest "../tools/lib.org")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user