10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 04:14:07 +01:00
* Fixes #223

* Upgrade to OCaml 4.06 and Core 0.10

* Fixes #223 (#226) (#61)

* Fixed qp_edit
This commit is contained in:
Anthony Scemama 2018-01-22 02:45:17 +01:00 committed by GitHub
parent 2d8b0089f3
commit 61e65babd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 56 additions and 54 deletions

View File

@ -1,7 +1,9 @@
## IMPORTANT
If you have problems upgrading to the current version, consider re-installing everything from scratch including the OCaml compiler.
To do this, you will have to remove the `quantum_package` directory **and** the `$HOME/.opam` directory as well.
If you have problems upgrading to the current version, first try
`qp_upgrade_ocaml.sh`. If it fails, then consider re-installing everything from
scratch including the OCaml compiler. To do this, you will have to remove the
`quantum_package` directory **and** the `$HOME/.opam` directory as well.

28
configure vendored
View File

@ -49,7 +49,7 @@ QP_ROOT_INSTALL = join(QP_ROOT, "install")
os.environ["PATH"] = os.environ["PATH"] + ":" + QP_ROOT_BIN
d_dependency = {
"ocaml": ["m4", "curl", "zlib", "patch", "gcc", "zeromq"],
"ocaml": ["m4", "curl", "zlib", "patch", "gcc", "zeromq", "gmp"],
"m4": ["make"],
"curl": ["make"],
"zlib": ["gcc", "make"],
@ -67,7 +67,8 @@ d_dependency = {
"ninja": ["g++", "python"],
"make": [],
"p_graphviz": ["python"],
"bats": []
"bats": [],
"gmp" : ["make", "g++"]
}
from collections import namedtuple
@ -136,6 +137,11 @@ zeromq = Info(
description=' ZeroMQ',
default_path=join(QP_ROOT_LIB, "libzmq.a"))
gmp= Info(
url='https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2',
description=' The GNU Multiple Precision Arithmetic Library',
default_path=join(QP_ROOT_LIB, "libgmp.a"))
f77zmq = Info(
url='{head}/zeromq/f77_zmq/{tail}'.format(**path_github),
description=' F77-ZeroMQ',
@ -155,7 +161,7 @@ d_info = dict()
for m in ["ocaml", "m4", "curl", "zlib", "patch", "irpf90", "docopt",
"resultsFile", "ninja", "emsl", "ezfio", "p_graphviz",
"zeromq", "f77zmq", "bats"]:
"zeromq", "f77zmq", "bats", "gmp"]:
exec ("d_info['{0}']={0}".format(m))
@ -480,16 +486,16 @@ def create_ninja_and_rc(l_installed):
'export QP_PYTHON={0}'.format(":".join(l_python)), "",
'export IRPF90={0}'.format(path_irpf90.replace(QP_ROOT,"${QP_ROOT}")),
'export NINJA={0}'.format(path_ninja.replace(QP_ROOT,"${QP_ROOT}")),
'function qp_append_export () {',
' #Append path $2:${!1}. Add the semicolon only if ${!1} is defined',
'function qp_prepend_export () {',
' #Prepend path $2:${!1}. Add the semicolon only if ${!1} is defined',
' eval "value_1=\"\${$1}\""',
' echo ${2}${value_1:+:${value_1}}',
' echo ${value_1:+${value_1}:}${2}',
'}',
'export PYTHONPATH=$(qp_append_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")',
'export PATH=$(qp_append_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)',
'export LD_LIBRARY_PATH=$(qp_append_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)',
'export LIBRARY_PATH=$(qp_append_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)',
'export C_INCLUDE_PATH=$(qp_append_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)',
'export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")',
'export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)',
'export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)',
'export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)',
'export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)',
'',
'if [[ $SHELL == "bash" ]] ; then',
' source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh',

View File

@ -5,11 +5,12 @@ QP_ROOT=$PWD
cd -
# Normal installation
PACKAGES="core.v0.9.1 cryptokit.1.10 ocamlfind sexplib.v0.9.1 ZMQ ppx_sexp_conv ppx_deriving"
PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 ZMQ ppx_sexp_conv ppx_deriving"
# Needed for ZeroMQ
export C_INCLUDE_PATH="${QP_ROOT}"/include:"${C_INCLUDE_PATH}"
export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"
export LDFLAGS="-L$QP_ROOT/lib"
export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"
# return 0 if program version is equal or greater than check version
@ -64,7 +65,7 @@ fi
cd Downloads || exit 1
chmod +x ocaml.sh || exit 1
echo N | ./ocaml.sh ${QP_ROOT}/bin/ 4.04.2 || exit 1
echo N | ./ocaml.sh ${QP_ROOT}/bin/ 4.06.0 || exit 1
${QP_ROOT}/bin/opam config setup -a -q || exit 1

View File

@ -1,6 +1,7 @@
open Core
open Qptypes
module StringHashtbl = Hashtbl.Make(String)
type pub_state =
| Waiting
@ -28,7 +29,7 @@ type t =
progress_bar : Progress_bar.t option ;
running : bool;
accepting_clients : bool;
data : (string, string) Hashtbl.t;
data : string StringHashtbl.t;
}
@ -208,7 +209,7 @@ let end_job msg program_state rep_socket pair_socket =
address_inproc = None;
running = true;
accepting_clients = false;
data = Hashtbl.create ~hashable:String.hashable ();
data = StringHashtbl.create ();
}
and wait n =
@ -592,7 +593,7 @@ let put_data msg rest_of_msg program_state rep_socket =
in
let success () =
Hashtbl.set program_state.data ~key ~data:value ;
StringHashtbl.set program_state.data ~key ~data:value ;
Message.PutDataReply (Message.PutDataReply_msg.create ())
|> Message.to_string
|> ZMQ.Socket.send rep_socket;
@ -622,7 +623,7 @@ let get_data msg program_state rep_socket =
let success () =
let value =
match Hashtbl.find program_state.data key with
match StringHashtbl.find program_state.data key with
| Some value -> value
| None -> ""
in
@ -776,7 +777,7 @@ let run ~port =
address_inproc = None;
progress_bar = None ;
accepting_clients = false;
data = Hashtbl.create ~hashable:String.hashable ();
data = StringHashtbl.create ();
}
in

View File

@ -665,7 +665,7 @@ let run ?o b au c d m p cart xyz_file =
let command =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:(fun () -> "

View File

@ -128,7 +128,7 @@ let spec =
+> anon ("ezfio_file" %: string)
let () =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:( fun () -> "
Creates an open-shell multiplet initial guess\n\n" )

View File

@ -95,7 +95,7 @@ let spec =
let command =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:(fun () ->
"Find all the pi molecular orbitals to create a pi space.

View File

@ -141,7 +141,7 @@ let run_o ~action ezfio_filename =
;;
let command =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:(fun () ->
"

View File

@ -150,7 +150,7 @@ let spec =
let () =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:( fun () -> "
Executes a Quantum Package binary file among these:\n\n"

View File

@ -323,7 +323,7 @@ let spec =
let command =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:(fun () ->
"Set the orbital classes in an EZFIO directory

View File

@ -256,7 +256,7 @@ let spec =
let command =
Command.basic
Command.basic_spec
~summary: "Quantum Package command"
~readme:(fun () ->
"

View File

@ -1,27 +0,0 @@
#!/bin/bash
# Convert a old ezfio file (with option.irp.f ezfio_default)
# into a new EZFIO.cfg type
# Hartree Fock
# Changin the case, don't know if is needed or not
mv $1/Hartree_Fock $1/hartree_fock 2> /dev/null
mv $1/hartree_Fock/thresh_SCF $1/hartree_fock/thresh_scf 2> /dev/null
# BiInts
mv $1/bi_integrals $1/bielect_integrals 2> /dev/null
if [ -f $1/bielect_integrals/read_ao_integrals ]; then
if [ `cat $1/bielect_integrals/read_ao_integrals` -eq "True" ]
then
echo "Read" > $1/bielect_integrals/disk_access_ao_integrals
elif [ `cat bielect_integrals/write_ao_integrals` -eq "True" ]
then
echo "Write" > $1/bielect_integrals/disk_access_ao_integrals
else
echo "None" > $1/bielect_integrals/disk_access_ao_integrals
fi
fi

19
scripts/qp_upgrade_ocaml.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
OCAML_VERSION="4.06.0"
PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 ZMQ ppx_sexp_conv ppx_deriving"
if [[ -z ${QP_ROOT} ]]
then
print "The QP_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
exit -1
fi
cd $QP_ROOT/ocaml
opam update
opam switch ${OCAML_VERSION}
eval `opam config env`
opam install -y ${PACKAGES} || echo "Upgrade failed. You can try running
configure ; $0"