mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
Merging org files
This commit is contained in:
parent
2467214b3a
commit
e774a725b9
1
src/.gitignore
vendored
1
src/.gitignore
vendored
@ -8,3 +8,4 @@
|
|||||||
*.so
|
*.so
|
||||||
Makefile.generated
|
Makefile.generated
|
||||||
test_qmckl
|
test_qmckl
|
||||||
|
merged_qmckl.org
|
||||||
|
26
src/Makefile
26
src/Makefile
@ -5,19 +5,20 @@ FC=gfortran -g
|
|||||||
FFLAGS=-fPIC -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
|
FFLAGS=-fPIC -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
|
||||||
|
|
||||||
LIBS=-lgfortran -lm
|
LIBS=-lgfortran -lm
|
||||||
|
|
||||||
#CC=icc
|
|
||||||
#CFLAGS=-fPIC -g
|
|
||||||
#
|
#
|
||||||
#FC=ifort
|
#CC=icc -xHost
|
||||||
#FFLAGS=-fPIC -g
|
#CFLAGS=-fPIC -g -O2
|
||||||
|
#
|
||||||
|
#FC=ifort -xHost
|
||||||
|
#FFLAGS=-fPIC -g -O2
|
||||||
#
|
#
|
||||||
#LIBS=-lm -lifcore -lirc
|
#LIBS=-lm -lifcore -lirc
|
||||||
|
|
||||||
|
|
||||||
export CC CFLAGS FC FFLAGS LIBS
|
export CC CFLAGS FC FFLAGS LIBS
|
||||||
|
|
||||||
ORG_SOURCE_FILES=$(wildcard qmckl*.org) test_qmckl.org
|
MERGED_ORG=merged_qmckl.org
|
||||||
|
ORG_SOURCE_FILES=$(wildcard *.org)
|
||||||
OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE_FILES)))
|
OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE_FILES)))
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
@ -29,12 +30,15 @@ libqmckl.so: Makefile.generated
|
|||||||
test: Makefile.generated
|
test: Makefile.generated
|
||||||
$(MAKE) -f Makefile.generated test
|
$(MAKE) -f Makefile.generated test
|
||||||
|
|
||||||
doc:$(ORG_SOURCE_FILES)
|
$(MERGED_ORG): $(ORG_SOURCE_FILES)
|
||||||
./create_doc.sh README.org $(ORG_SOURCE_FILES)
|
./merge_org.sh
|
||||||
|
|
||||||
|
doc:$(MERGED_ORG)
|
||||||
|
./create_doc.sh $(MERGED_ORG)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f qmckl.h test_qmckl_* test_qmckl.c test_qmckl qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so *.html *.fh
|
rm -f qmckl.h test_qmckl_* test_qmckl.c test_qmckl qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so *.html *.fh *.mod
|
||||||
|
|
||||||
Makefile.generated: $(ORG_SOURCE_FILES) Makefile create_makefile.sh
|
Makefile.generated: $(MERGED_ORG) Makefile create_makefile.sh
|
||||||
./create_makefile.sh $(ORG_SOURCE_FILES)
|
./create_makefile.sh $(MERGED_ORG)
|
||||||
|
|
||||||
|
@ -1,23 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
INPUT=$1
|
||||||
|
#emacs merged_qmckl.org --batch --eval "(require 'htmlize)" -f org-html-export-to-html --kill
|
||||||
|
emacs \
|
||||||
|
$INPUT \
|
||||||
|
--batch \
|
||||||
|
--eval "(package-initialize)" \
|
||||||
|
-f org-html-export-to-html \
|
||||||
|
--kill
|
||||||
|
|
||||||
# Tangle org files
|
|
||||||
|
|
||||||
emacsclient -a "" \
|
|
||||||
--socket-name=org_to_code \
|
|
||||||
--eval "(load-file \"config.el\")"
|
|
||||||
|
|
||||||
for INPUT in $@ ; do
|
|
||||||
echo $INPUT
|
|
||||||
emacsclient \
|
|
||||||
--no-wait \
|
|
||||||
--socket-name=org_to_code \
|
|
||||||
--eval "(find-file \"$INPUT\")" \
|
|
||||||
--eval "(org-html-export-to-html)"
|
|
||||||
done
|
|
||||||
mv *.html ../docs
|
mv *.html ../docs
|
||||||
|
|
||||||
emacsclient \
|
|
||||||
--no-wait \
|
|
||||||
--socket-name=org_to_code \
|
|
||||||
--eval '(kill-emacs)'
|
|
||||||
|
|
||||||
|
@ -1,24 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
INPUT=$1
|
||||||
OUTPUT=Makefile.generated
|
OUTPUT=Makefile.generated
|
||||||
|
|
||||||
# Tangle org files
|
# Tangle org files
|
||||||
|
emacs \
|
||||||
emacsclient -a "" \
|
$INPUT \
|
||||||
--socket-name=org_to_code \
|
--batch \
|
||||||
--eval "(require 'org)"
|
-f org-babel-tangle \
|
||||||
|
--kill
|
||||||
for INPUT in $@ ; do
|
|
||||||
emacsclient \
|
|
||||||
--no-wait \
|
|
||||||
--socket-name=org_to_code \
|
|
||||||
--eval "(org-babel-tangle-file \"$INPUT\")"
|
|
||||||
done
|
|
||||||
|
|
||||||
emacsclient \
|
|
||||||
--no-wait \
|
|
||||||
--socket-name=org_to_code \
|
|
||||||
--eval '(kill-emacs)'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +58,7 @@ libqmckl.so: \$(OBJECT_FILES)
|
|||||||
%.o: %.c
|
%.o: %.c
|
||||||
\$(CC) \$(CFLAGS) -c \$*.c -o \$*.o
|
\$(CC) \$(CFLAGS) -c \$*.c -o \$*.o
|
||||||
|
|
||||||
%.o: %.f90
|
%.o: %.f90 qmckl_f.o
|
||||||
\$(FC) \$(FFLAGS) -c \$*.f90 -o \$*.o
|
\$(FC) \$(FFLAGS) -c \$*.f90 -o \$*.o
|
||||||
|
|
||||||
test_qmckl: test_qmckl.c libqmckl.so \$(TESTS) \$(TESTS_F)
|
test_qmckl: test_qmckl.c libqmckl.so \$(TESTS) \$(TESTS_F)
|
||||||
|
12
src/merge_org.sh
Executable file
12
src/merge_org.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
for i in README.org \
|
||||||
|
qmckl.org \
|
||||||
|
qmckl_memory.org \
|
||||||
|
qmckl_context.org \
|
||||||
|
qmckl_distance.org \
|
||||||
|
qmckl_ao.org \
|
||||||
|
test_qmckl.org
|
||||||
|
do
|
||||||
|
cat $i >> merged_qmckl.org
|
||||||
|
done
|
@ -12,6 +12,8 @@
|
|||||||
This file produces the =qmckl.h= header file, which is included in all
|
This file produces the =qmckl.h= header file, which is included in all
|
||||||
other C header files. It is the main entry point to the library.
|
other C header files. It is the main entry point to the library.
|
||||||
|
|
||||||
|
We also create the =qmckl_f.f90= which is the Fortran equivalent.
|
||||||
|
|
||||||
#+BEGIN_SRC C :tangle qmckl.h
|
#+BEGIN_SRC C :tangle qmckl.h
|
||||||
#ifndef QMCKL_H
|
#ifndef QMCKL_H
|
||||||
#define QMCKL_H
|
#define QMCKL_H
|
||||||
@ -19,6 +21,11 @@ other C header files. It is the main entry point to the library.
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
module qmckl
|
||||||
|
use, intrinsic :: iso_c_binding
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Constants
|
* Constants
|
||||||
|
|
||||||
** Success/failure
|
** Success/failure
|
||||||
@ -35,6 +42,10 @@ typedef int64_t qmckl_context ;
|
|||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
integer, parameter :: QMCKL_SUCCESS = 0
|
||||||
|
integer, parameter :: QMCKL_FAILURE = 0
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Precision-related constants
|
** Precision-related constants
|
||||||
|
|
||||||
@ -47,6 +58,11 @@ typedef int64_t qmckl_context ;
|
|||||||
#define QMCKL_DEFAULT_RANGE 11
|
#define QMCKL_DEFAULT_RANGE 11
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
integer, parameter :: QMCKL_DEFAULT_PRECISION = 53
|
||||||
|
integer, parameter :: QMCKL_DEFAULT_RANGE = 11
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Header files
|
* Header files
|
||||||
|
|
||||||
All the functions expoed in the API are defined in the following
|
All the functions expoed in the API are defined in the following
|
||||||
@ -61,6 +77,13 @@ typedef int64_t qmckl_context ;
|
|||||||
#include "qmckl_ao.h"
|
#include "qmckl_ao.h"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
! include 'qmckl_memory.fh'
|
||||||
|
include 'qmckl_context.fh'
|
||||||
|
include 'qmckl_distance.fh'
|
||||||
|
include 'qmckl_ao.fh'
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* End of header
|
* End of header
|
||||||
|
|
||||||
#+BEGIN_SRC C :tangle qmckl.h
|
#+BEGIN_SRC C :tangle qmckl.h
|
||||||
@ -68,3 +91,14 @@ typedef int64_t qmckl_context ;
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
end module qmckl
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
* Include all other org files here :noexport:
|
||||||
|
|
||||||
|
#+INCLUDE: qmckl_memory.org
|
||||||
|
#+INCLUDE: qmckl_context.org
|
||||||
|
#+INCLUDE: qmckl_distance.org
|
||||||
|
#+INCLUDE: qmckl_ao.org
|
||||||
|
@ -160,10 +160,8 @@ end function qmckl_ao_powers
|
|||||||
*** Test :noexport:
|
*** Test :noexport:
|
||||||
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
||||||
integer(c_int32_t) function test_qmckl_ao_powers(context) bind(C)
|
integer(c_int32_t) function test_qmckl_ao_powers(context) bind(C)
|
||||||
use, intrinsic :: iso_c_binding
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
include 'qmckl_context.fh'
|
|
||||||
include 'qmckl_ao.fh'
|
|
||||||
|
|
||||||
integer(c_int64_t), intent(in), value :: context
|
integer(c_int64_t), intent(in), value :: context
|
||||||
|
|
||||||
@ -401,10 +399,8 @@ end function qmckl_ao_polynomial_vgl
|
|||||||
*** Test :noexport:
|
*** Test :noexport:
|
||||||
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
||||||
integer(c_int32_t) function test_qmckl_ao_polynomial_vgl(context) bind(C)
|
integer(c_int32_t) function test_qmckl_ao_polynomial_vgl(context) bind(C)
|
||||||
use, intrinsic :: iso_c_binding
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
include 'qmckl_context.fh'
|
|
||||||
include 'qmckl_ao.fh'
|
|
||||||
|
|
||||||
integer(c_int64_t), intent(in), value :: context
|
integer(c_int64_t), intent(in), value :: context
|
||||||
|
|
||||||
@ -643,10 +639,8 @@ end function qmckl_ao_gaussians_vgl
|
|||||||
*** Test :noexport:
|
*** Test :noexport:
|
||||||
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
#+BEGIN_SRC f90 :comments link :tangle test_qmckl_ao_f.f90
|
||||||
integer(c_int32_t) function test_qmckl_ao_gaussians_vgl(context) bind(C)
|
integer(c_int32_t) function test_qmckl_ao_gaussians_vgl(context) bind(C)
|
||||||
use, intrinsic :: iso_c_binding
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
include 'qmckl_context.fh'
|
|
||||||
include 'qmckl_ao.fh'
|
|
||||||
|
|
||||||
integer(c_int64_t), intent(in), value :: context
|
integer(c_int64_t), intent(in), value :: context
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user