1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-06-27 15:42:54 +02:00

parallel tangle OK

This commit is contained in:
Anthony Scemama 2021-05-11 12:15:08 +02:00
parent c61556ef77
commit 90474fee2d
7 changed files with 51 additions and 1159 deletions

30
.gitignore vendored
View File

@ -1,20 +1,24 @@
docs/index.html
docs/htmlize.el
autom4te.cache/
config.log
config.status
src/auto/
src/ltximg/
src/qmckl.mod
*.swp
*.tar.gz
.deps/
compile
depcomp
generated.mk
stamp-h1
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
Makefile
aclocal.m4
autom4te.cache/
config.guess
config.log
config.status
config.sub
configure
configure.ac.dist
include/config.h
*~
install-sh
qmckl.pc

View File

@ -52,15 +52,13 @@ fortran_DATA = $(qmckl_f)
export srcdir qmckl_f qmckl_h
sources_tangled = src/qmckl_ao.c
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)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES)
# ----->
endif

File diff suppressed because it is too large Load Diff

1
org/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.tangled

3
src/.gitignore vendored
View File

@ -6,6 +6,3 @@
*.html
*~
*.so
Makefile.generated
test_qmckl
merged_qmckl.org

View File

@ -2,13 +2,12 @@
#
# Creates all the dependencies from the org-mode files
set -e
if [[ -z ${srcdir} ]] ; then
echo "Error: srcdir environment variable is not defined"
exit 1
fi
WD=$PWD
function make_src()
@ -28,10 +27,17 @@ function make_src()
H_PRIVATE_TYPE_FILES=
C_TEST_FILES=
F_TEST_FILES=
TANGLED_FILES=
for org in org/*.org ; do
ORG_FILES+="\$(srcdir)/$org "
tangled="\$(srcdir)/${org%.org}.tangled"
i=${org%.org}
c_test_o="\$(srcdir)/src/test_${i}.o"
f_test_o="\$(srcdir)/src/test_${i}_f.o"
c_test="\$(srcdir)/src/test_${i}.c"
f_test="\$(srcdir)/src/test_${i}_f.f90"
i="\$(srcdir)/src/${i#org/}"
c="${i}.c"
o="${i}.o"
@ -44,9 +50,13 @@ function make_src()
fh_func="${i}_fh_func.f90"
fh_type="${i}_fh_type.f90"
ORG_FILES+="\$(srcdir)/$org "
TANGLED_FILES+="$tangled "
DEPS_ORG["\$(srcdir)/$org"]=$tangled
grep -q "(eval c)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$c "
DEPS[$c]+=" $tangled"
DEPS[$o]+=" $c "
C_FILES+=" $c"
C_O_FILES+=" $o"
@ -54,76 +64,64 @@ function make_src()
grep -q "(eval h_func)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$h_func "
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_ORG[$org]+="$h_type "
DEPS[$o]+=" $h_type"
DEPS[$h_type]+=" $tangled"
H_TYPE_FILES+=" $h_type"
fi
grep -q "(eval h_private_type)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$h_private_type "
DEPS[$o]+=" $h_private_type"
DEPS[$h_private_type]+=" $tangled"
H_PRIVATE_TYPE_FILES+=" $h_private_type"
fi
grep -q "(eval h_private_func)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$h_private_func "
DEPS[$o]+=" $h_private_func"
DEPS[$h_private_func]+=" $tangled"
H_PRIVATE_FUNC_FILES+=" $h_private_func"
fi
grep -q "(eval f)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$f90 "
DEPS[$f90]+="$tangled "
DEPS[$fo]+="$f90 "
F_FILES+=" $f90"
fi
grep -q "(eval fh_func)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$fh_func "
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_ORG[$org]+="$fh_type "
DEPS[$fo]+=" $fh_type"
DEPS[$fh_type]+=" $tangled"
FH_TYPE_FILES+=" $fh_type"
fi
done
for org in org/*.org ; do
i=${org%.org}
i=${i#org/}
o="\$(srcdir)/src/${i}.o"
fo="\$(srcdir)/src/${i}_f.o"
c="\$(srcdir)/src/${i}.c"
f90="\$(srcdir)/src/${i}_f.f90"
c_test_o="\$(srcdir)/src/test_${i}.o"
f_test_o="\$(srcdir)/src/test_${i}_f.o"
c_test="\$(srcdir)/src/test_${i}.c"
f_test="\$(srcdir)/src/test_${i}_f.f90"
grep -q "(eval c_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$c_test "
DEPS[$c_test_o]+=" $c_test $o"
DEPS["$c_test"]="${tangled} "
DEPS["$c_test_o"]+=" $c_test $o"
C_TEST_FILES+=" $c_test"
fi
grep -q "(eval f_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS_ORG[$org]+="$f_test "
DEPS[$f_test_o]+=" $f_test $fo"
DEPS["$f_test"]+="${tangled} "
DEPS["$f_test_o"]+=" $f_test $fo"
F_TEST_FILES+=" $f_test"
fi
done
@ -160,6 +158,7 @@ function make_src()
echo "## Source files" > ${OUTPUT}
echo >> ${OUTPUT}
echo "ORG_FILES=${ORG_FILES}" >> ${OUTPUT}
echo "TANGLED_FILES=${TANGLED_FILES}" >> ${OUTPUT}
echo "C_FILES=${C_FILES}" >> ${OUTPUT}
echo "F_FILES=${F_FILES}" >> ${OUTPUT}
echo "C_O_FILES=${C_O_FILES}" >> ${OUTPUT}

View File

@ -32,6 +32,10 @@ function tangle()
for i in $@
do
# echo "--- ${i} ----"
tangle ${i}
tangled=${i%.org}.tangled
NOW=$(date +"%m%d%H%M.%S")
tangle ${i} &> $tangled
# Make log file older than the tangled files
touch -t ${NOW} $tangled
done