1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 20:36:01 +01:00

Introduced qmckl.h in org files

This commit is contained in:
Anthony Scemama 2021-05-11 13:57:23 +02:00
parent a4e49f4939
commit d4711206f0
10 changed files with 15 additions and 71 deletions

View File

@ -72,7 +72,7 @@ endif
tangle_verbose = $(tangle_verbose_@AM_V@)
tangle_verbose_ = $(tangle_verbose_@AM_DEFAULT_V@)
tangle_verbose_0 = @echo " TANGLE $@";
tangle_verbose_0 = @echo " TANGLE $<";
cat_h_verbose = $(cat_h_verbose_@AM_V@)
cat_h_verbose_ = $(cat_h_verbose_@AM_DEFAULT_V@)

View File

@ -74,15 +74,10 @@ MunitResult test_<<filename()>>() {
#include <stdbool.h>
#include <assert.h>
#include "qmckl_error_type.h"
#include "qmckl_context_type.h"
#include "qmckl.h"
#include "qmckl_context_private_type.h"
#include "qmckl_memory_private_type.h"
#include "qmckl_error_func.h"
#include "qmckl_memory_private_func.h"
#include "qmckl_memory_func.h"
#include "qmckl_context_func.h"
#+end_src
* Context

View File

@ -50,13 +50,9 @@ MunitResult test_<<filename()>>() {
#include <string.h>
#include <errno.h>
#include "qmckl_error_type.h"
#include "qmckl.h"
#include "qmckl_context_private_type.h"
#include "qmckl_context_type.h"
#include "qmckl_numprec_type.h"
#include "qmckl_memory_private_func.h"
#include "qmckl_context_func.h"
#+end_src

View File

@ -48,15 +48,10 @@ MunitResult test_<<filename()>>() {
#include <stdio.h>
#include "qmckl_error_type.h"
#include "qmckl_context_type.h"
#include "qmckl.h"
#include "qmckl_context_private_type.h"
#include "qmckl_memory_private_type.h"
#include "qmckl_error_func.h"
#include "qmckl_memory_private_func.h"
#include "qmckl_memory_func.h"
#include "qmckl_context_func.h"
#include "qmckl_electron_private_func.h"
#+end_src

View File

@ -25,12 +25,8 @@
#include <pthread.h>
#include <errno.h>
#include "qmckl_error_type.h"
#include "qmckl.h"
#include "qmckl_context_private_type.h"
#include "qmckl_context_type.h"
#include "qmckl_context_func.h"
#include "qmckl_error_func.h"
#+end_src
#+begin_src c :tangle (eval c_test) :noweb yes

View File

@ -23,15 +23,10 @@ optimized libraries to fine-tune the memory allocation.
#include <string.h>
#include <assert.h>
#include "qmckl_error_type.h"
#include "qmckl.h"
#include "qmckl_memory_private_type.h"
#include "qmckl_context_type.h"
#include "qmckl_context_private_type.h"
#include "qmckl_memory_private_func.h"
#include "qmckl_memory_func.h"
#include "qmckl_context_func.h"
#include "qmckl_error_func.h"
#+end_src
#+begin_src c :tangle (eval c_test) :noweb yes

View File

@ -40,15 +40,8 @@ MunitResult test_<<filename()>>() {
#include <stdlib.h>
#include <string.h>
#include "qmckl_error_type.h"
#include "qmckl_context_type.h"
#include "qmckl.h"
#include "qmckl_context_private_type.h"
#include "qmckl_numprec_type.h"
#include "qmckl_numprec_func.h"
#include "qmckl_error_func.h"
#include "qmckl_context_func.h"
#+end_src
* Control of the numerical precision

View File

@ -2,6 +2,7 @@ qmckl.org
qmckl_error.org
qmckl_context.org
qmckl_memory.org
qmckl_numprec.org
qmckl_electron.org
qmckl_ao.org
qmckl_distance.org

View File

@ -29,6 +29,8 @@ function make_src()
F_TEST_FILES=
TANGLED_FILES=
qmckl_f=" \$(srcdir)/src/qmckl_f.o"
for org in org/*.org ; do
i=$(basename ${org%.org})
tangled="\$(srcdir)/org/${i}.tangled"
@ -57,21 +59,19 @@ function make_src()
grep -q "(eval c)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$c]+=" $tangled"
DEPS[$o]+=" $c "
DEPS[$o]+=" $c \$(qmckl_h)"
C_FILES+=" $c"
C_O_FILES+=" $o"
fi
grep -q "(eval h_func)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$o]+=" $h_func"
DEPS[$h_func]+=" $tangled"
H_FUNC_FILES+=" $h_func"
fi
grep -q "(eval h_type)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$o]+=" $h_type"
DEPS[$h_type]+=" $tangled"
H_TYPE_FILES+=" $h_type"
fi
@ -93,20 +93,18 @@ function make_src()
grep -q "(eval f)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$f90]+="$tangled "
DEPS[$fo]+="$f90 "
DEPS[$fo]+="$f90 \$(qmckl_f)"
F_FILES+=" $f90"
fi
grep -q "(eval fh_func)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$fo]+=" $fh_func"
DEPS[$fh_func]+=" $tangled"
FH_FUNC_FILES+=" $fh_func"
fi
grep -q "(eval fh_type)" $org
if [[ $? -eq 0 ]] ; then
DEPS[$fo]+=" $fh_type"
DEPS[$fh_type]+=" $tangled"
FH_TYPE_FILES+=" $fh_type"
fi
@ -114,44 +112,18 @@ function make_src()
grep -q "(eval c_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS_TEST["${c_test}"]="${tangled} "
DEPS_TEST["${c_test_o}"]+=" ${c_test} $o"
DEPS_TEST["${c_test_o}"]+=" ${c_test} $o \$(qmckl_h)"
C_TEST_FILES+=" ${c_test}"
fi
grep -q "(eval f_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS_TEST["${f_test}"]+="${tangled} "
DEPS_TEST["${f_test_o}"]+=" ${f_test} $fo"
DEPS_TEST["${f_test_o}"]+=" ${f_test} $fo \$(qmckl_f)"
F_TEST_FILES+=" ${f_test}"
fi
done
for org in org/*.org ; do
i=${org%.org}
i="\$(srcdir)/src/${i#org/}"
c="${i}.c"
o="${i}.o"
fo="${i}_f.o"
for i in ${!DEPS[@]} ; do
extension="${i##*.}"
grep -q "$i" $org
if [[ $? -ne 0 ]] ; then
if [[ "$extension" == h ]] ; then
DEPS[$o]+=" $i"
elif [[ "$extension" == f90 ]] ; then
DEPS[$fo]+=" $i"
fi
fi
done
done
for f in ${!DEPS[@]} ; do
if [[ "${f/_f.o/_f.ox}" == ${f}x ]] ; then
DEPS["${f}"]+=" qmckl_f.o"
elif [[ "${f/.o/.ox}" == ${f}x ]] ; then
DEPS["$f"]+=" \$(qmckl_h)"
fi
done
OUTPUT=${WD}/generated.mk
echo > ${OUTPUT}

View File

@ -94,6 +94,7 @@ for i in ${HEADERS}
do
header=${srcdir}/src/$i
if [[ -f $header ]] ; then
echo "/* $header */" >> ${OUTPUT}
cat $header >> ${OUTPUT}
fi
done