Opam package

This commit is contained in:
Anthony Scemama 2018-03-28 01:50:19 +02:00
parent f4f31db614
commit 17c9aef254
8 changed files with 148 additions and 16 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
_build/
Makefile
*.byte
*.native

View File

@ -15,10 +15,10 @@ val class_of_contracted_shell_pair_couple : ContractedShellPairCouple.t -> float
val get_chem : t -> int -> int -> int -> int -> float
(** Get an integral using the Chemist's convention { \[ (ij|kl) \] }. *)
(** Get an integral using the Chemist's convention {% $(ij|kl)$ %}. *)
val get_phys : t -> int -> int -> int -> int -> float
(** Get an integral using the Physicist's convention { \[ \langle ij|kl \rangle \] }. *)
(** Get an integral using the Physicist's convention {% $\langle ij|kl \rangle$ %}. *)
val of_basis : Basis.t -> t
(** Compute all ERI's for a given {!Basis.t}. *)

3
META Normal file
View File

@ -0,0 +1,3 @@
version = "%{version}%"
description = "Quantum Chamistry"
requires = "lacaml"

View File

@ -3,30 +3,28 @@
INCLUDE_DIRS=Nuclei,Utils,Basis,HartreeFock
LIBS=
PKGS=
OCAMLCFLAGS="-g -warn-error A"
OCAMLOPTFLAGS="opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"
#ODOC_LTXHTML_DIR=qpackage.docdir/ltx
ODOCFLAGS=-docflags "-g ltxhtml.cma -sort -css-style $(PWD)/style.css -colorize-code"
OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) $(ODOCFLAGS) -Is $(INCLUDE_DIRS) -ocamlopt $(OCAMLOPTFLAGS)
OCAMLBUILD=ocamlbuild -j 0 -cflags $(ocamlcflags) -lflags $(ocamlcflags) $(ocamldocflags) -Is $(INCLUDE_DIRS) -ocamlopt $(ocamloptflags)
MLLFILES=$(wildcard */*.mll) $(wildcard *.mll) Utils/math_functions.c
MLYFILES=$(wildcard */*.mly) $(wildcard *.mly)
MLFILES= $(wildcard */*.ml) $(wildcard *.ml)
MLIFILES=$(wildcard */*.mli) $(wildcard *.mli)
ALL_NATIVE=$(patsubst %.ml,%.native,$(wildcard run_*.ml))
ALL_BYTE=$(patsubst %.ml,%.byte,$(wildcard run_*.ml))
ALL_EXE=$(ALL_BYTE) $(ALL_NATIVE)
.PHONY: default
.PHONY: default doc
default: $(ALL_EXE)
default: $(ALL_EXE) doc
tests: $(ALL_TESTS)
qpackage.odocl: $(MLIFILES)
ls $(MLIFILES) | sed "s/\.mli//" > qpackage.odocl
QCaml.odocl: $(MLIFILES)
ls $(MLIFILES) | sed "s/\.mli//" > QCaml.odocl
doc: qpackage.odocl
$(OCAMLBUILD) qpackage.docdir/index.html -use-ocamlfind $(PKGS)
doc: QCaml.odocl
$(OCAMLBUILD) QCaml.docdir/index.html -use-ocamlfind $(PKGS)
%.inferred.mli: $(MLFILES)
$(OCAMLBUILD) $*.inferred.mli -use-ocamlfind $(PKGS)
@ -54,3 +52,9 @@ clean:
debug: run_integrals.native
./debug.sh
install: $(ALL_NATIVE)
cp run_hartree_fock.native $(bin)/run_hartree_fock
uninstall:
rm -f $(bin)/run_hartree_fock

View File

@ -2,8 +2,8 @@
There are two kinds of ordering of indices:
- Physicist's : { \[ \langle i j | k l \rangle \] }
- Chemist's : { \[ ( i j | k l ) \] }
- Physicist's : {% $\langle i j | k l \rangle$ %}
- Chemist's : {% $(ij|kl)$ %}
*)

2
_tags
View File

@ -1,4 +1,4 @@
true: package(str,unix,bigarray,zarith,lacaml)
true: package(str,unix,bigarray,lacaml)
<*.byte> : linkdep(Utils/math_functions.o), custom
<*.native>: linkdep(Utils/math_functions.o)
<odoc-ltxhtml>: not_hygienic

102
configure vendored Executable file
View File

@ -0,0 +1,102 @@
#!/bin/sh
# --------------------------------
# Defaults
package_name="QCaml"
prefix='/usr/local'
bin='$(prefix)/bin'
lib='$(prefix)/lib'
doc='$(prefix)/doc'
share='$(prefix)/share'
man='$(prefix)/man'
etc='$(prefix)/etc'
ocamlcflags='"-g -warn-error A"'
ocamloptflags='"opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"'
ocamldocflags='-docflags "-g ltxhtml.cma -sort -css-style $(PWD)/style.css -colorize-code"'
# --------------------------------
LC_ALL=C
export LC_ALL
if [ x.$OPAM_PACKAGE_NAME != x. ] ; then
package_name=$OPAM_PACKAGE_NAME
fi
help()
{
cat <<EOF
usage: configure [options]
where options include:
-prefix dir installation directory
-bin dir default: $bin
-lib dir default: $lib
-doc dir default: $doc
-share dir default: $share
-man dir default: $man
-etc dir default: $etc
-ocamlcflags default: $ocamlcflags
-ocamloptflags default: $ocamloptflags
EOF
exit
}
while : ; do
case "$1" in
"")
break;;
-prefix|--prefix)
prefix="$2"
shift;;
-bin|--bin)
bin="$2"
shift;;
-lib|--lib)
lib="$2"
shift;;
-doc|--doc)
doc="$2"
shift;;
-etc|--etc)
etc="$2"
shift;;
-man|--man)
man="$2"
shift;;
-share|--share)
share="$2"
shift;;
-help|--help)
help;;
*)
echo "Unknown option $1, try -help"
exit 2;;
esac
shift
done
cat << EOF > Makefile
package_name=$package_name
prefix=$prefix
bin=$bin
lib=$lib
doc=$doc
share=$share
man=$man
etc=$etc
ocamlcflags=$ocamlcflags
ocamloptflags=$ocamloptflags
ocamldocflags=$ocamldocflags
include Makefile.include
EOF

22
opam Normal file
View File

@ -0,0 +1,22 @@
opam-version: "1.2"
name: "QCaml"
version: "0.1"
maintainer: "Anthony Scemama <scemama@irsamc.ups-tlse.fr>"
authors: "Anthony Scemama <scemama@irsamc.ups-tlse.fr>"
homepage: "http://github.com/scemama/QCaml"
#bug-reports: ""
#license: ""
#dev-repo: ""
build: [
["./configure" "-prefix" "%{prefix}%"]
[make]
]
install: [make "install"]
remove: [
["./configure" "-prefix" "%{prefix}%"]
[make "uninstall"]
["ocamlfind" "remove" "QCaml"]
]
depends: [
"ocamlfind" "lacaml" {build}
]