From d4711206f0d298869757aab607312f446c4d8aaa Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 11 May 2021 13:57:23 +0200 Subject: [PATCH] Introduced qmckl.h in org files --- Makefile.am | 2 +- org/qmckl_ao.org | 7 +------ org/qmckl_context.org | 6 +----- org/qmckl_electron.org | 7 +------ org/qmckl_error.org | 6 +----- org/qmckl_memory.org | 7 +------ org/qmckl_numprec.org | 9 +-------- org/table_of_contents | 1 + tools/build_makefile.sh | 40 ++++++---------------------------------- tools/build_qmckl_h.sh | 1 + 10 files changed, 15 insertions(+), 71 deletions(-) diff --git a/Makefile.am b/Makefile.am index c3930d7..67a59ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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@) diff --git a/org/qmckl_ao.org b/org/qmckl_ao.org index 5db5c92..fcd73a1 100644 --- a/org/qmckl_ao.org +++ b/org/qmckl_ao.org @@ -74,15 +74,10 @@ MunitResult test_<>() { #include #include -#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 diff --git a/org/qmckl_context.org b/org/qmckl_context.org index a26ac28..51f2257 100644 --- a/org/qmckl_context.org +++ b/org/qmckl_context.org @@ -50,13 +50,9 @@ MunitResult test_<>() { #include #include -#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 diff --git a/org/qmckl_electron.org b/org/qmckl_electron.org index 586d8af..736a16d 100644 --- a/org/qmckl_electron.org +++ b/org/qmckl_electron.org @@ -48,15 +48,10 @@ MunitResult test_<>() { #include -#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 diff --git a/org/qmckl_error.org b/org/qmckl_error.org index 608f5f8..05aa0a2 100644 --- a/org/qmckl_error.org +++ b/org/qmckl_error.org @@ -25,12 +25,8 @@ #include #include -#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 diff --git a/org/qmckl_memory.org b/org/qmckl_memory.org index 753850c..bd0be82 100644 --- a/org/qmckl_memory.org +++ b/org/qmckl_memory.org @@ -23,15 +23,10 @@ optimized libraries to fine-tune the memory allocation. #include #include -#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 diff --git a/org/qmckl_numprec.org b/org/qmckl_numprec.org index 85ba916..df5a00b 100644 --- a/org/qmckl_numprec.org +++ b/org/qmckl_numprec.org @@ -40,15 +40,8 @@ MunitResult test_<>() { #include #include -#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 diff --git a/org/table_of_contents b/org/table_of_contents index 4b48cf9..2098a47 100644 --- a/org/table_of_contents +++ b/org/table_of_contents @@ -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 diff --git a/tools/build_makefile.sh b/tools/build_makefile.sh index 6aca004..1b43e36 100755 --- a/tools/build_makefile.sh +++ b/tools/build_makefile.sh @@ -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} diff --git a/tools/build_qmckl_h.sh b/tools/build_qmckl_h.sh index 78ae050..fdec31e 100755 --- a/tools/build_qmckl_h.sh +++ b/tools/build_qmckl_h.sh @@ -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