1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-03 01:46:12 +02:00

Fixing CI

This commit is contained in:
Anthony Scemama 2021-03-19 13:47:50 +01:00
parent 14c216a51a
commit 87ad36e342
7 changed files with 59 additions and 62 deletions

View File

@ -20,7 +20,7 @@ OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE
INCLUDE=-I$(QMCKL_ROOT)/include/ INCLUDE=-I$(QMCKL_ROOT)/include/
# Compiler options # Compiler options
# GNU, Intel and LLVM compilers are supported. Choose here: # GNU, Intel and LLVM compilers are supported. Choose here:
@ -42,14 +42,14 @@ FFLAGS=-fPIC $(INCLUDE) \
-fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising \ -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising \
-Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation \ -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation \
-Wreal-q-constant -Wuninitialized -fbacktrace -finit-real=nan \ -Wreal-q-constant -Wuninitialized -fbacktrace -finit-real=nan \
-ffpe-trap=zero,overflow,underflow -ffpe-trap=zero,overflow,underflow
LIBS+=-lgfortran -lm LIBS+=-lgfortran -lm
#---------------------------------------------------------- #----------------------------------------------------------
endif endif
# Intel # Intel
ifeq ($(COMPILER),INTEL) ifeq ($(COMPILER),INTEL)
#---------------------------------------------------------- #----------------------------------------------------------
@ -65,7 +65,7 @@ CC=icc -xHost
endif endif
# LLVM # LLVM
ifeq ($(COMPILER),LLVM) ifeq ($(COMPILER),LLVM)
#---------------------------------------------------------- #----------------------------------------------------------
@ -87,7 +87,7 @@ endif
.PHONY: clean .PHONY: clean
.SECONDARY: # Needed to keep the produced C and Fortran files .SECONDARY: # Needed to keep the produced C and Fortran files
libqmckl.so: Makefile.generated libqmckl.so: Makefile.generated
$(MAKE) -f Makefile.generated $(MAKE) -f Makefile.generated
../include/qmckl.h: libqmckl.so ../include/qmckl.h: libqmckl.so
@ -97,7 +97,7 @@ test: Makefile.generated ../include/qmckl.h
$(MAKE) -f Makefile.generated test $(MAKE) -f Makefile.generated test
doc: $(ORG_SOURCE_FILES) doc: $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/create_doc.sh $(QMCKL_ROOT)/tools/build_doc.sh
clean: clean:
$(RM) test_qmckl_* test_qmckl.c test_qmckl \ $(RM) test_qmckl_* test_qmckl.c test_qmckl \

View File

@ -65,9 +65,9 @@ echo "#+end_src"
#+begin_src c :tangle no #+begin_src c :tangle no
{ (char*) "test_qmckl_error", test_qmckl_error, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL}, { (char*) "test_qmckl_error", test_qmckl_error, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL},
{ (char*) "test_qmckl_context", test_qmckl_context, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL}, { (char*) "test_qmckl_context", test_qmckl_context, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL},
// { (char*) "test_qmckl_memory", test_qmckl_memory, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL}, { (char*) "test_qmckl_memory", test_qmckl_memory, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL},
// { (char*) "test_qmckl_distance", test_qmckl_distance, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL}, { (char*) "test_qmckl_distance", test_qmckl_distance, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL},
// { (char*) "test_qmckl_ao", test_qmckl_ao, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL}, { (char*) "test_qmckl_ao", test_qmckl_ao, NULL,NULL,MUNIT_TEST_OPTION_NONE,NULL},
#+end_src #+end_src
:end: :end:

View File

@ -10,9 +10,9 @@ echo "This file was created by tools/Building.org"
#+NAME: check-src #+NAME: check-src
#+begin_src bash #+begin_src bash
if [[ $(basename $PWD) != "src" ]] ; then if [[ $(basename ${PWD}) != "src" ]] ; then
echo "This script needs to be run in the src directory" echo "This script needs to be run in the src directory"
exit -1 exit -1
fi fi
#+end_src #+end_src
@ -200,22 +200,26 @@ Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURC
The file is not tangled if the last modification date of the org The file is not tangled if the last modification date of the org
file is less recent than one of the tangled files. file is less recent than one of the tangled files.
#+begin_src bash #+begin_src bash
function tangle() function tangle()
{ {
if [[ -f ${1%.org}.c && $1 -ot ${1%.org}.c ]] local org_file=$1
then return local c_file=${org_file%.org}.c
elif [[ -f ${1%.org}.f90 && $1 -ot ${1%.org}.f90 ]] local f_file=${org_file%.org}.f90
then return
fi
emacs --batch $1 --load=../tools/config_tangle.el -f org-babel-tangle
}
if [[ ${org_file} -ot ${c_file} ]] ; then
return
elif [[ ${org_file} -ot ${f_file} ]] ; then
return
fi
emacs --batch ${org_file} --load=../tools/config_tangle.el -f org-babel-tangle
}
for i in $@ for i in $@
do do
echo "--- $i ----" echo "--- ${i} ----"
tangle $i tangle ${i}
done done
#+end_src #+end_src
@ -247,14 +251,9 @@ ${QMCKL_ROOT}/tools/tangle.sh *.org
#+begin_src bash #+begin_src bash
OBJECTS="qmckl_f.o" OBJECTS="qmckl_f.o"
for i in $(ls qmckl_*.c) ; do for i in $(ls qmckl_*.c qmckl_*f.f90) ; do
FILE=${i%.c} FILE=${i%.*}
OBJECTS="${OBJECTS} ${FILE}.o" OBJECTS+=" ${FILE}.o"
done >> $OUTPUT
for i in $(ls qmckl*_f.f90) ; do
FILE=${i%.f90}
OBJECTS="${OBJECTS} ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
#+end_src #+end_src
@ -263,8 +262,8 @@ done >> $OUTPUT
#+begin_src bash #+begin_src bash
TESTS="" TESTS=""
for i in $(ls test_qmckl_*.c) ; do for i in $(ls test_qmckl_*.c) ; do
FILE=${i%.c}.o FILE=${i%.c}
TESTS="${TESTS} ${FILE}" TESTS+=" ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
#+end_src #+end_src
@ -273,8 +272,8 @@ done >> $OUTPUT
#+begin_src bash #+begin_src bash
TESTS_F="" TESTS_F=""
for i in $(ls test_qmckl_*_f.f90) ; do for i in $(ls test_qmckl_*_f.f90) ; do
FILE=${i%.f90}.o FILE=${i%.f90}
TESTS_F="${TESTS_F} ${FILE}" TESTS_F+=" ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
#+end_src #+end_src

View File

@ -69,7 +69,7 @@ cat << EOF > ${OUTPUT}
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* *
* *
* *
*/ */
@ -139,7 +139,7 @@ cat << EOF > ${OUTPUT}
! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! !
! !
! !
! !
! !
module qmckl module qmckl

View File

@ -14,7 +14,6 @@
("gnu" . 10))) ("gnu" . 10)))
(require 'htmlize)
(require 'font-lock) (require 'font-lock)
(setq org-confirm-babel-evaluate nil) (setq org-confirm-babel-evaluate nil)
(global-font-lock-mode t) (global-font-lock-mode t)

View File

@ -7,7 +7,7 @@
# This script generates the Makefile that compiles the library. # This script generates the Makefile that compiles the library.
# The ~OUTPUT~ variable contains the name of the generated Makefile,typically # The ~OUTPUT~ variable contains the name of the generated Makefile,typically
# =Makefile.generated=. # =Makefile.generated=.
# This file was created by tools/Building.org # This file was created by tools/Building.org
@ -29,14 +29,9 @@ ${QMCKL_ROOT}/tools/tangle.sh *.org
OBJECTS="qmckl_f.o" OBJECTS="qmckl_f.o"
for i in $(ls qmckl_*.c) ; do for i in $(ls qmckl_*.c qmckl_*f.f90) ; do
FILE=${i%.c} FILE=${i%.*}
OBJECTS="${OBJECTS} ${FILE}.o" OBJECTS+=" ${FILE}.o"
done >> $OUTPUT
for i in $(ls qmckl*_f.f90) ; do
FILE=${i%.f90}
OBJECTS="${OBJECTS} ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
@ -46,8 +41,8 @@ done >> $OUTPUT
TESTS="" TESTS=""
for i in $(ls test_qmckl_*.c) ; do for i in $(ls test_qmckl_*.c) ; do
FILE=${i%.c}.o FILE=${i%.c}
TESTS="${TESTS} ${FILE}" TESTS+=" ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
@ -57,8 +52,8 @@ done >> $OUTPUT
TESTS_F="" TESTS_F=""
for i in $(ls test_qmckl_*_f.f90) ; do for i in $(ls test_qmckl_*_f.f90) ; do
FILE=${i%.f90}.o FILE=${i%.f90}
TESTS_F="${TESTS_F} ${FILE}" TESTS_F+=" ${FILE}.o"
done >> $OUTPUT done >> $OUTPUT
@ -68,7 +63,7 @@ done >> $OUTPUT
cat << EOF > ${OUTPUT} cat << EOF > ${OUTPUT}
CC=$CC CC=$CC
CFLAGS=$CFLAGS -I../munit/ CFLAGS=$CFLAGS -I../munit/
FC=$FC FC=$FC
FFLAGS=$FFLAGS FFLAGS=$FFLAGS
@ -80,8 +75,8 @@ LIBS=$LIBS
libqmckl.so: \$(OBJECT_FILES) libqmckl.so: \$(OBJECT_FILES)
\$(CC) -shared \$(OBJECT_FILES) -o libqmckl.so \$(CC) -shared \$(OBJECT_FILES) -o libqmckl.so
%.o: %.c %.o: %.c
\$(CC) \$(CFLAGS) -c \$*.c -o \$*.o \$(CC) \$(CFLAGS) -c \$*.c -o \$*.o
%.o: %.f90 qmckl_f.o %.o: %.f90 qmckl_f.o

View File

@ -19,19 +19,23 @@
# The file is not tangled if the last modification date of the org # The file is not tangled if the last modification date of the org
# file is less recent than one of the tangled files. # file is less recent than one of the tangled files.
function tangle() function tangle()
{ {
if [[ -f ${1%.org}.c && $1 -ot ${1%.org}.c ]] local org_file=$1
then return local c_file=${org_file%.org}.c
elif [[ -f ${1%.org}.f90 && $1 -ot ${1%.org}.f90 ]] local f_file=${org_file%.org}.f90
then return
fi
emacs --batch $1 --load=../tools/config_tangle.el -f org-babel-tangle
}
if [[ ${org_file} -ot ${c_file} ]] ; then
return
elif [[ ${org_file} -ot ${f_file} ]] ; then
return
fi
emacs --batch ${org_file} --load=../tools/config_tangle.el -f org-babel-tangle
}
for i in $@ for i in $@
do do
echo "--- $i ----" echo "--- ${i} ----"
tangle $i tangle ${i}
done done