10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-25 20:27:28 +02:00

Fixed Qcaml module

This commit is contained in:
Anthony Scemama 2020-12-29 00:03:01 +01:00
parent 68d022987e
commit 56d151ea36
3 changed files with 37 additions and 50 deletions

View File

@ -12,32 +12,36 @@
* Dune files :noexport: * Dune files :noexport:
** Generate dune files
Use [C-c C-c] on the code below to create the output for the dune files Use [C-c C-c] on the code below to create the output for the dune files
#+header: :noweb strip-export #+header: :noweb yes
#+header: :var name=(file-name-directory buffer-file-name) #+header: :var name=(file-name-directory buffer-file-name)
#+header: :var dune="lib/dune" #+header: :var dune="lib/dune"
#+header: :var dunetest="test/dune" #+header: :var dunetest="test/dune"
#+header: :var dependencies=dependencies
#+begin_src python :exports none :results output none #+begin_src python :exports none :results output none
name = name.split('/')[-2] name = name.split('/')[-2]
synopsis = """ synopsis = """
<<synopsis>> <<synopsis>>
""" """
dependencies = '\n '.join(map(lambda x: x[0], dependencies))
with open(dune,'w') as f: with open(dune,'w') as f:
f.write(f""" f.write(f"""
(library (library
(name {name}) (name {name})
(public_name qcaml.{name}) (public_name qcaml.{name})
(synopsis {synopsis} ) (synopsis {synopsis} )
<<dependencies>> (libraries
{dependencies}
)
<<noimplementation>> <<noimplementation>>
<<c-files>> <<c-files>>
) )
<<lex-yacc>> <<lex-yacc>>
""") """.replace("qcaml.qcaml","qcaml"))
with open(dunetest,'w') as f: with open(dunetest,'w') as f:
f.write(f""" f.write(f"""
@ -49,43 +53,25 @@ with open(dunetest,'w') as f:
qcaml.{name} qcaml.{name}
) )
) )
""") """.replace("qcaml.qcaml","qcaml"))
#+end_src #+end_src
** Dependencies
#+name: dependencies #+name: dependencies
#+begin_src elisp #+begin_src sh :output value
(libraries grep "public_name" ../*/lib/dune | grep -v "qcaml)" | cut -d ' ' -f 3 | tr ')' ' '
qcaml.ao
qcaml.common
qcaml.gaussian
qcaml.gaussian_integrals
qcaml.mo
qcaml.operators
qcaml.particles
qcaml.perturbation
qcaml.simulation
)
#+end_src #+end_src
** Modules without implementation #+RESULTS: dependencies
| (libraries |
#+name: noimplementation | qcaml.ao |
#+begin_src elisp | qcaml.common |
#+end_src | qcaml.gaussian |
| qcaml.gaussian_integrals |
** Extra C files | qcaml.linear_algebra |
| qcaml.mo |
#+begin_src elisp | qcaml.operators |
#+end_src | qcaml.particles |
| qcaml.perturbation |
** Parser files | qcaml.simulation |
| ) |
#+name: lex-yacc
#+begin_src elisp
#+end_src

View File

@ -1,7 +1,7 @@
(library (library
(name qcaml) (name qcaml)
(public_name qcaml.qcaml) (public_name qcaml)
(synopsis (synopsis
"Main QCaml entry point" "Main QCaml entry point"
) )
@ -10,6 +10,7 @@
qcaml.common qcaml.common
qcaml.gaussian qcaml.gaussian
qcaml.gaussian_integrals qcaml.gaussian_integrals
qcaml.linear_algebra
qcaml.mo qcaml.mo
qcaml.operators qcaml.operators
qcaml.particles qcaml.particles

View File

@ -4,6 +4,6 @@
(synopsis "Test for qcaml library") (synopsis "Test for qcaml library")
(libraries (libraries
alcotest alcotest
qcaml.qcaml qcaml
) )
) )