Add doc in dist, and text doc

This commit is contained in:
Anthony Scemama 2021-04-21 12:44:03 +02:00
parent e18655b147
commit 399a632bdd
11 changed files with 83 additions and 43 deletions

1
.gitignore vendored
View File

@ -7,5 +7,6 @@ src/auto/
src/ltximg/
src/qmckl.mod
*.swp
*.tar.gz

View File

@ -8,9 +8,18 @@ package = qmckl
version = 0.1-alpha
tarname = $(package)
distdir = $(tarname)-$(version)
prefix = /usr/local
QMCKL_ROOT=$(CURDIR)
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
export prefix shared_lib static_lib qmckl_h qmckl_f
all clean check:
all clean doc check install uninstall:
$(MAKE) -C src $@
dist: $(distdir).tar.gz
@ -21,16 +30,24 @@ $(distdir).tar.gz: $(distdir)
rm -rf $(distdir)
$(distdir): include/qmckl.h include/qmckl_f.f90 src/Makefile.generated FORCE
$(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.generated doc FORCE
mkdir -p $(distdir)
mkdir -p $(distdir)/munit
mkdir -p $(distdir)/src
mkdir -p $(distdir)/include
cp munit/munit.h munit/munit.c $(distdir)/munit
cp src/*.c src/*.h src/*.f90 $(distdir)/src
mkdir -p $(distdir)/share/qmckl/fortran
mkdir -p $(distdir)/share/qmckl/doc/html/
mkdir -p $(distdir)/share/qmckl/doc/text/
mkdir -p $(distdir)/man
cp munit/munit.h munit/munit.c $(distdir)/munit/
cp src/*.c src/*.h src/*.f90 $(distdir)/src/
cp src/Makefile.generated $(distdir)/src/Makefile
cp include/* $(distdir)/include
cp Makefile $(distdir)/
cp docs/*.html $(distdir)/share/qmckl/doc/html/
cp docs/*.css $(distdir)/share/qmckl/doc/html/
cp docs/*.txt $(distdir)/share/qmckl/doc/text/
cp share/qmckl/fortran/* $(distdir)/share/qmckl/fortran
mkdir -p $(distdir)/lib
@ -49,9 +66,9 @@ distcheck: $(distdir).tar.gz
@echo "*** Package $(distdir).tar.gz is ready for distribution."
include/qmckl.h include/qmckl_f.f90 src/Makefile.generated:
$(MAKE) -C src
$(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.generated:
$(MAKE) -C src $@
.PHONY: all clean dist FORCE
.PHONY: all clean dist doc install uninstall FORCE

1
docs/.gitignore vendored Normal file
View File

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

0
man/.gitignore vendored Normal file
View File

1
share/qmckl/fortran/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
qmckl_f.f90

View File

@ -18,7 +18,7 @@ QMCKL_ROOT=$(shell dirname $(CURDIR))
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/include/qmckl_f.f90
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
export CC CFLAGS FC FFLAGS LIBS QMCKL_ROOT
@ -92,18 +92,18 @@ endif
# The Makefile.generated is the one that will be distributed with the library.
.PHONY: clean shared static doc all check
.PHONY: clean shared static doc all check install uninstall
.SECONDARY: # Needed to keep the produced C and Fortran files
$(shared_lib) $(static_lib): $(qmckl_h) $(qmckl_f) Makefile.generated
$(shared_lib) $(static_lib) install uninstall: $(qmckl_h) $(qmckl_f) Makefile.generated
$(MAKE) -f Makefile.generated $@
$(qmckl_f) $(qmckl_h): Makefile.generated
../tools/build_qmckl_h.sh
$(QMCKL_ROOT)/tools/build_qmckl_h.sh
shared: $(shared_lib)
static: $(static_lib)
all: shared static doc
all: shared static doc check
check: $(static_lib)
$(MAKE) -f Makefile.generated check
@ -125,5 +125,4 @@ Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURC
.SUFFIXES: .org .c
.org.c:
../tools/tangle.sh $<
$(QMCKL_ROOT)/tools/tangle.sh $<

View File

@ -2,19 +2,19 @@
#+PROPERTY: comments org
#+SETUPFILE: ../docs/theme.setup
# -*- mode: org -*-
* Using QMCkl
The =qmckl.h= header file has to be included in C codes when
QMCkl functions are used:
The =qmckl.h= header file installed in the =${prefix}/include= directory
has to be included in C codes when QMCkl functions are used:
#+begin_src c :tangle no
#include "qmckl.h"
#+end_src
In Fortran programs, the =qmckl_f.f90= interface file should be
included in the source code using the library, and the Fortran codes
should use the ~qmckl~ module as
In Fortran programs, the =qmckl_f.f90= installed in
=${prefix}/share/qmckl/fortran= interface file should be copied in the source
code using the library, and the Fortran codes should use the ~qmckl~ module as
#+begin_src f90 :tangle no
use qmckl
@ -23,7 +23,7 @@ use qmckl
Both files are located in the =include/= directory.
* Developing in QMCkl
** Literate programming
In a traditional source code, most of the lines of source files of a program
@ -115,7 +115,7 @@ Both files are located in the =include/= directory.
[[http://fortranwiki.org/fortran/show/Generating+C+Interfaces][this link]].
** Coding rules
The authors should follow the recommendations of the C99
[[https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard][SEI+CERT C Coding Standard]].
@ -186,7 +186,7 @@ cppcheck --addon=cert --enable=all *.c &> cppcheck.out
The internal structure of the context is not specified, to give a
maximum of freedom to the different implementations. Modifying
the state is done by setters and getters, prefixed by
=qmckl_set_= an =qmckl_get_=.
=qmckl_set_= an =qmckl_get_=.
** Headers
@ -222,7 +222,7 @@ cppcheck --addon=cert --enable=all *.c &> cppcheck.out
| =*_private_func.h= | Private | Function definitions |
| =*fh_type.f90= | Public | Fortran type definitions |
| =*fh_func.f90= | Public | Fortran function definitions |
** Low-level functions
Low-level functions are very simple functions which are leaves of

View File

@ -898,7 +898,7 @@ munit_assert(qmckl_ao_basis_provided(context));
| double | P[n][ldp] | out | Array containing all the powers of ~X~ |
| int64_t | ldp | in | Leading dimension of array ~P~ |
*** Requirements:
*** Requirements
- ~context~ is not ~QMCKL_NULL_CONTEXT~
- ~n~ > 0
@ -1124,7 +1124,7 @@ munit_assert_int(0, ==, test_qmckl_ao_power(context));
| double | VGL[n][ldv] | out | Value, gradients and Laplacian of the polynomials |
| int64_t | ldv | in | Leading dimension of array ~VGL~ |
*** Requirements:
*** Requirements
- ~context~ is not ~QMCKL_NULL_CONTEXT~
- ~n~ > 0
@ -1470,7 +1470,7 @@ munit_assert_int(0, ==, test_qmckl_ao_polynomial_vgl(context));
| ~VGL(ldv,5)~ | output | Value, gradients and Laplacian of the Gaussians |
| ~ldv~ | input | Leading dimension of array ~VGL~ |
Requirements :
Requirements
- ~context~ is not 0
- ~n~ > 0

View File

@ -85,7 +85,7 @@ QMCKL_ROOT=$(shell dirname $(CURDIR))
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/include/qmckl_f.f90
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
export CC CFLAGS FC FFLAGS LIBS QMCKL_ROOT
@ -164,10 +164,10 @@ endif
The Makefile.generated is the one that will be distributed with the library.
#+begin_src makefile
.PHONY: clean shared static doc all check
.PHONY: clean shared static doc all check install uninstall
.SECONDARY: # Needed to keep the produced C and Fortran files
$(shared_lib) $(static_lib): $(qmckl_h) $(qmckl_f) Makefile.generated
$(shared_lib) $(static_lib) install uninstall: $(qmckl_h) $(qmckl_f) Makefile.generated
$(MAKE) -f Makefile.generated $@
$(qmckl_f) $(qmckl_h): Makefile.generated
@ -175,7 +175,7 @@ $(qmckl_f) $(qmckl_h): Makefile.generated
shared: $(shared_lib)
static: $(static_lib)
all: shared static doc
all: shared static doc check
check: $(static_lib)
$(MAKE) -f Makefile.generated check
@ -306,7 +306,7 @@ cat << EOF > ${OUTPUT}
.POSIX:
.SUFFIXES:
PREFIX=/usr/local
prefix=/usr/local
CC=$CC
CFLAGS=$CFLAGS -I../munit/
@ -324,7 +324,7 @@ QMCKL_ROOT=\$(shell dirname \$(CURDIR))
shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/include/qmckl_f.f90
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=\$(QMCKL_ROOT)/munit/munit.c
shared: \$(shared_lib)
@ -339,7 +339,7 @@ all: shared static
# Test
qmckl_f.o: \$(qmckl_f)
\$(FC) \$(FFLAGS) -c \$(qmckl_f) -o \$@
@ -357,6 +357,16 @@ check: test_qmckl test_qmckl_shared
clean:
\$(RM) -- *.o *.mod \$(shared_lib) \$(static_lib) test_qmckl
install:
install -d \$(prefix)/lib
install -d \$(prefix)/include
install -d \$(prefix)/share/qmckl/fortran
install -d \$(prefix)/man
install \$(shared_lib) \$(prefix)/lib
install \$(static_lib) \$(prefix)/lib
install \$(qmckl_h) \$(prefix)/include
install \$(qmckl_f) \$(prefix)/share/qmckl/fortran
.SUFFIXES: .c .f90 .o
.c.o:
@ -428,6 +438,7 @@ cat << EOF > ${OUTPUT}
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
EOF
for i in ${HEADERS}
@ -448,7 +459,7 @@ EOF
HEADERS_TYPE="qmckl_*_fh_type.f90"
HEADERS="qmckl_*_fh_func.f90"
OUTPUT="../include/qmckl_f.f90"
OUTPUT="../share/qmckl/fortran/qmckl_f.f90"
cat << EOF > ${OUTPUT}
!
! <<qmckl-header>>

View File

@ -78,8 +78,8 @@ cat << EOF > ${OUTPUT}
*
*/
#ifndef QMCKL_H
#define QMCKL_H
#ifndef __QMCKL_H__
#define __QMCKL_H__
#include <stdlib.h>
#include <stdint.h>
@ -105,7 +105,7 @@ EOF
HEADERS_TYPE="qmckl_*_fh_type.f90"
HEADERS="qmckl_*_fh_func.f90"
OUTPUT="../include/qmckl_f.f90"
OUTPUT="../share/qmckl/fortran/qmckl_f.f90"
cat << EOF > ${OUTPUT}
!
! ------------------------------------------

View File

@ -21,7 +21,7 @@ OUTPUT=Makefile.generated
${QMCKL_ROOT}/tools/tangle.sh *.org
../tools/build_qmckl_h.sh
${QMCKL_ROOT}/tools/build_qmckl_h.sh
@ -66,7 +66,7 @@ cat << EOF > ${OUTPUT}
.POSIX:
.SUFFIXES:
PREFIX=/usr/local
prefix=/usr/local
CC=$CC
CFLAGS=$CFLAGS -I../munit/
@ -84,7 +84,7 @@ QMCKL_ROOT=\$(shell dirname \$(CURDIR))
shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/include/qmckl_f.f90
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=\$(QMCKL_ROOT)/munit/munit.c
shared: \$(shared_lib)
@ -99,7 +99,7 @@ all: shared static
# Test
qmckl_f.o: \$(qmckl_f)
\$(FC) \$(FFLAGS) -c \$(qmckl_f) -o \$@
@ -108,7 +108,7 @@ test_qmckl: test_qmckl.c \$(qmckl_h) \$(static_lib) \$(TESTS) \$(TESTS_F)
\$(munit) \$(TESTS) \$(TESTS_F) \$(static_lib) \$(LIBS) test_qmckl.c -o \$@
test_qmckl_shared: test_qmckl.c \$(qmckl_h) \$(shared_lib) \$(TESTS) \$(TESTS_F)
\$(CC) \$(CFLAGS) -Wl,-rpath,$PWD/../lib -L../lib \
\$(CC) \$(CFLAGS) -Wl,-rpath,\$(QMCKL_ROOT)/lib -L\$(QMCKL_ROOT)/lib \
\$(munit) \$(TESTS) \$(TESTS_F) -lqmckl \$(LIBS) test_qmckl.c -o \$@
check: test_qmckl test_qmckl_shared
@ -117,6 +117,16 @@ check: test_qmckl test_qmckl_shared
clean:
\$(RM) -- *.o *.mod \$(shared_lib) \$(static_lib) test_qmckl
install:
install -d \$(prefix)/lib
install -d \$(prefix)/include
install -d \$(prefix)/share/qmckl/fortran
install -d \$(prefix)/man
install \$(shared_lib) \$(prefix)/lib
install \$(static_lib) \$(prefix)/lib
install \$(qmckl_h) \$(prefix)/include
install \$(qmckl_f) \$(prefix)/share/qmckl/fortran
.SUFFIXES: .c .f90 .o
.c.o: