From eb98378e74d5f0d73e65b15e63d09b437239a247 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 9 Jul 2018 14:40:45 +0200 Subject: [PATCH] Modernized for zmq 4.2.5 and python2 --- build.ninja | 2 +- install/build.ninja | 14 +++++++------- install/scripts/install_f77_zmq.sh | 6 +++--- install/scripts/install_zmq.sh | 12 +++++++----- ocaml/compile.sh | 2 +- ocaml/ninja_ocaml.py | 4 ++-- scripts/compile_irpf90.sh | 2 +- scripts/compile_ocaml_dep.sh | 2 +- scripts/create_properties_ezfio.py | 2 +- scripts/create_properties_python.py | 2 +- src/PROPERTIES/properties.irp.f | 4 ++-- src/SAMPLING/block.irp.f | 2 +- src/SAMPLING/dmc_step.irp.f | 8 ++++---- src/SAMPLING/fkmc_step.irp.f | 8 ++++---- src/SAMPLING/pdmc_step.irp.f | 8 ++++---- src/SAMPLING/srmc_step.irp.f | 8 ++++---- src/SAMPLING/vmc_step.irp.f | 8 ++++---- src/ZMQ/qmc.irp.f | 2 +- src/ezfio_interface.irp.f | 2 +- src/properties.py | 2 +- 20 files changed, 51 insertions(+), 49 deletions(-) diff --git a/build.ninja b/build.ninja index 41243c7..010530e 100644 --- a/build.ninja +++ b/build.ninja @@ -4,7 +4,7 @@ rule compile_ezfio pool = console rule build_properties_config - command = bash -c "source qmcchemrc ; exec python ./scripts/create_properties_ezfio.py" + command = bash -c "source qmcchemrc ; exec python2 ./scripts/create_properties_ezfio.py" pool = console rule compile_irpf90 diff --git a/install/build.ninja b/install/build.ninja index 34ab4f7..1418f2a 100644 --- a/install/build.ninja +++ b/install/build.ninja @@ -4,11 +4,11 @@ ###### URL_OPAM ="https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh" -URL_IRPF90="https://github.com/scemama/irpf90/archive/v1.6.7.tar.gz" -URL_EZFIO ="https://github.com/scemama/EZFIO/archive/v1.3.1.tar.gz" +URL_IRPF90="https://github.com/scemama/irpf90/archive/v1.7.2.tar.gz" +URL_EZFIO ="https://gitlab.com/scemama/EZFIO/-/archive/v1.3.3/EZFIO-v1.3.3.tar.gz" -URL_ZMQ ="http://download.zeromq.org/zeromq-4.1.4.tar.gz" -URL_F77ZMQ="https://github.com/scemama/f77_zmq/archive/4.1.4.tar.gz" +URL_ZMQ ="https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz" +URL_F77ZMQ="https://github.com/scemama/f77_zmq/archive/v4.2.5.tar.gz" # Rules ####### @@ -49,7 +49,7 @@ build _build/irpf90.ok ../bin/irpman ../bin/irpf90: install | Downloads/irpf90.t target = irpf90 descr = IRPF90 -build _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.4 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h: install | Downloads/zmq.tar.gz +build _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.5 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h: install | Downloads/zmq.tar.gz target = zmq descr = ZeroMQ @@ -57,7 +57,7 @@ build _build/ezfio.ok: install | Downloads/ezfio.tar.gz _build/irpf90.ok ../bin target = ezfio descr = EZFIO -build _build/f77_zmq.ok ../src/ZMQ/f77_zmq.h ../lib/libf77zmq.a ../lib/libf77zmq.so: install | Downloads/f77_zmq.tar.gz _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.4 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h +build _build/f77_zmq.ok ../src/ZMQ/f77_zmq.h ../lib/libf77zmq.a ../lib/libf77zmq.so: install | Downloads/f77_zmq.tar.gz _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.5 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h target = f77_zmq descr = Fortran ZeroMQ interface @@ -69,7 +69,7 @@ build _build/ocaml.ok ../bin/opam: install | Downloads/opam_installer.sh _build target = ocaml descr = OCaml compiler -build _build/ocaml_zmq.ok: install | ../bin/opam ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h _build/ocaml.ok _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.4 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h +build _build/ocaml_zmq.ok: install | ../bin/opam ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h _build/ocaml.ok _build/zmq.ok ../lib/libzmq.a ../lib/libzmq.so.5 ../lib/libzmq.so ../lib/zmq.h ../lib/zmq_utils.h target = ocaml_zmq descr = OCaml ZeroMQ interface diff --git a/install/scripts/install_f77_zmq.sh b/install/scripts/install_f77_zmq.sh index a996788..d859a6c 100755 --- a/install/scripts/install_f77_zmq.sh +++ b/install/scripts/install_f77_zmq.sh @@ -5,17 +5,17 @@ function _install() { cd .. ; QMCCHEM_PATH="$PWD" ; cd - set +u - export C_INCLUDE_PATH="${C_INCLUDE_PATH}":../../../lib + export C_INCLUDE_PATH="${C_INCLUDE_PATH}":../../../include set -e set -u cd "${BUILD}" - export ZMQ_H="${QMCCHEM_PATH}"/lib/zmq.h + export ZMQ_H="${QMCCHEM_PATH}"/include/zmq.h cp "${ZMQ_H}" . make -j 8 cd - rm -f -- "${QMCCHEM_PATH}"/src/ZMQ/f77_zmq.h "${QMCCHEM_PATH}"/lib/libf77zmq.a "${QMCCHEM_PATH}"/lib/libf77zmq.so cp "${BUILD}"/libf77zmq.{a,so} ../lib/ - cp "${BUILD}"/f77_zmq.h ../src/ZMQ/ + cp "${BUILD}"/f77_zmq_free.h ../src/ZMQ/f77_zmq.h return 0 } diff --git a/install/scripts/install_zmq.sh b/install/scripts/install_zmq.sh index 6c7609c..4196b78 100755 --- a/install/scripts/install_zmq.sh +++ b/install/scripts/install_zmq.sh @@ -10,14 +10,16 @@ function _install() set -e set -u cd "${BUILD}" - ./configure --without-libsodium + ./autogen.sh + ./configure --without-libsodium --prefix=${QMCCHEM_PATH} --disable-libunwind make -j 8 + make install cd - rm -f -- "${QMCCHEM_PATH}"/lib/libzmq.{a,so,so.$LIBVERSION} - cp "${BUILD}"/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/ - cp "${BUILD}"/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION -# cp "${BUILD}"/src/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/ -# cp "${BUILD}"/src/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION +# cp "${BUILD}"/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/ +# cp "${BUILD}"/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION + cp "${BUILD}"/src/.libs/libzmq.a "${QMCCHEM_PATH}"/lib/ + cp "${BUILD}"/src/.libs/libzmq.so "${QMCCHEM_PATH}"/lib/libzmq.so.$LIBVERSION cp "${BUILD}"/include/{zmq,zmq_utils}.h "${QMCCHEM_PATH}"/lib/ cd "${QMCCHEM_PATH}"/lib ln libzmq.so.$LIBVERSION libzmq.so || cp libzmq.so.$LIBVERSION libzmq.so diff --git a/ocaml/compile.sh b/ocaml/compile.sh index 8ae5c7c..9ac0bd8 100755 --- a/ocaml/compile.sh +++ b/ocaml/compile.sh @@ -25,7 +25,7 @@ if [[ ${MD5} != ${REF} ]] then echo ${MD5} > ${LSMD5_FILE} echo Finding dependencies in OCaml files - python ./ninja_ocaml.py + python2 ./ninja_ocaml.py fi ninja ${@} diff --git a/ocaml/ninja_ocaml.py b/ocaml/ninja_ocaml.py index 775b670..fde91e3 100755 --- a/ocaml/ninja_ocaml.py +++ b/ocaml/ninja_ocaml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # # Copyright 2015 Anthony Scemama # @@ -218,7 +218,7 @@ GENERATED_NINJA=generated.ninja # Name of the auto-generated ninja file rule create_generated - command = python ./ninja_ocaml.py + command = python2 ./ninja_ocaml.py description = Finding dependencies between modules rule run_ninja diff --git a/scripts/compile_irpf90.sh b/scripts/compile_irpf90.sh index 2b790d5..aceffce 100755 --- a/scripts/compile_irpf90.sh +++ b/scripts/compile_irpf90.sh @@ -33,7 +33,7 @@ then IRPF90_FLAGS="${IRPF90_FLAGS} --ninja" # Check IRPF90 version - if [[ $( ${IRPF90} -v | python -c "import sys ; print float(sys.stdin.read().rsplit('.',1)[0]) >= 1.6") == False ]] + if [[ $( ${IRPF90} -v | python2 -c "import sys ; print float(sys.stdin.read().rsplit('.',1)[0]) >= 1.6") == False ]] then echo "IRPF90 version >= 1.6 required" exit -1 diff --git a/scripts/compile_ocaml_dep.sh b/scripts/compile_ocaml_dep.sh index ce7f610..84fe181 100755 --- a/scripts/compile_ocaml_dep.sh +++ b/scripts/compile_ocaml_dep.sh @@ -25,7 +25,7 @@ if [[ ${MD5} != ${REF} ]] then echo ${MD5} > ${LSMD5_FILE} echo Finding dependencies in OCaml files - python ./ninja_ocaml.py || exit -1 + python2 ./ninja_ocaml.py || exit -1 fi diff --git a/scripts/create_properties_ezfio.py b/scripts/create_properties_ezfio.py index d2fda6c..ed82d8a 100755 --- a/scripts/create_properties_ezfio.py +++ b/scripts/create_properties_ezfio.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # # Creates the properties.config file in the EZFIO directory. This is # done by reading all the properties written in the src/PROPERTIES diff --git a/scripts/create_properties_python.py b/scripts/create_properties_python.py index f763920..02e62f2 100755 --- a/scripts/create_properties_python.py +++ b/scripts/create_properties_python.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 import string import os diff --git a/src/PROPERTIES/properties.irp.f b/src/PROPERTIES/properties.irp.f index 93a4658..999ce14 100644 --- a/src/PROPERTIES/properties.irp.f +++ b/src/PROPERTIES/properties.irp.f @@ -1,4 +1,4 @@ -BEGIN_SHELL [ /usr/bin/env python ] +BEGIN_SHELL [ /usr/bin/env python2 ] import os from properties import properties root = os.environ['QMCCHEM_PATH'] @@ -59,7 +59,7 @@ END_SHELL ! DIMENSIONS !==========================================================================! -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/python2 ] from properties import * make_dims() END_SHELL diff --git a/src/SAMPLING/block.irp.f b/src/SAMPLING/block.irp.f index 2492e12..cc417b5 100644 --- a/src/SAMPLING/block.irp.f +++ b/src/SAMPLING/block.irp.f @@ -1,6 +1,6 @@ ! Providers of *_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ diff --git a/src/SAMPLING/dmc_step.irp.f b/src/SAMPLING/dmc_step.irp.f index 27397bc..259bd41 100644 --- a/src/SAMPLING/dmc_step.irp.f +++ b/src/SAMPLING/dmc_step.irp.f @@ -1,6 +1,6 @@ ! Providers of *_dmc_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ @@ -67,7 +67,7 @@ END_SHELL integer :: k, i_walk, i_step -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -150,7 +150,7 @@ END_SHELL psi_value_save(i_walk) = psi_value E_loc_save(i_walk) = E_loc -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -265,7 +265,7 @@ END_SHELL factor = 1.d0/block_weight SOFT_TOUCH block_weight -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then diff --git a/src/SAMPLING/fkmc_step.irp.f b/src/SAMPLING/fkmc_step.irp.f index c7e0e95..43efcf7 100644 --- a/src/SAMPLING/fkmc_step.irp.f +++ b/src/SAMPLING/fkmc_step.irp.f @@ -1,6 +1,6 @@ ! Providers of *_fkmc_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ @@ -77,7 +77,7 @@ END_SHELL integer :: k, i_walk, i_step -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -173,7 +173,7 @@ END_SHELL psi_value_save(i_walk) = psi_value E_loc_save(i_walk) = E_loc -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -339,7 +339,7 @@ END_SHELL factor = 1.d0/block_weight SOFT_TOUCH block_weight -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then diff --git a/src/SAMPLING/pdmc_step.irp.f b/src/SAMPLING/pdmc_step.irp.f index 484d7d8..740730c 100644 --- a/src/SAMPLING/pdmc_step.irp.f +++ b/src/SAMPLING/pdmc_step.irp.f @@ -1,6 +1,6 @@ ! Providers of *_pdmc_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ @@ -70,7 +70,7 @@ END_SHELL integer :: k, i_walk, i_step -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -197,7 +197,7 @@ END_SHELL ! E_loc_zv(i+pdmc_n_diag+1) = pdmc_pop_weight_mult(i-1) * pdmc_weight(i_walk) * dmc_zv_weight ! enddo -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -299,7 +299,7 @@ END_SHELL factor = 1.d0/block_weight SOFT_TOUCH block_weight -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then diff --git a/src/SAMPLING/srmc_step.irp.f b/src/SAMPLING/srmc_step.irp.f index 914cc8a..cdcf7c3 100644 --- a/src/SAMPLING/srmc_step.irp.f +++ b/src/SAMPLING/srmc_step.irp.f @@ -1,6 +1,6 @@ ! Providers of *_srmc_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ @@ -72,7 +72,7 @@ END_SHELL integer :: k, i_walk, i_step -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -210,7 +210,7 @@ END_SHELL endif -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -338,7 +338,7 @@ END_SHELL factor = 1.d0/block_weight SOFT_TOUCH block_weight -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then diff --git a/src/SAMPLING/vmc_step.irp.f b/src/SAMPLING/vmc_step.irp.f index e09ee80..f1c6f23 100644 --- a/src/SAMPLING/vmc_step.irp.f +++ b/src/SAMPLING/vmc_step.irp.f @@ -1,6 +1,6 @@ ! Providers of *_vmc_block_walk !============================== -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ @@ -39,7 +39,7 @@ END_SHELL PROVIDE time_step -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -93,7 +93,7 @@ END_SHELL block_weight += 1.d0 -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then @@ -153,7 +153,7 @@ END_SHELL double precision :: factor factor = 1.d0/block_weight SOFT_TOUCH block_weight -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * t = """ if (calc_$X) then diff --git a/src/ZMQ/qmc.irp.f b/src/ZMQ/qmc.irp.f index d2190cd..8e58cbb 100644 --- a/src/ZMQ/qmc.irp.f +++ b/src/ZMQ/qmc.irp.f @@ -101,7 +101,7 @@ subroutine run_qmc(cpu0) call zmq_send_real(msg,elec_coord_full,size(elec_coord_full)) endif -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/env python2 ] from properties import * derivlist = [] diff --git a/src/ezfio_interface.irp.f b/src/ezfio_interface.irp.f index 515df24..7b1888b 100644 --- a/src/ezfio_interface.irp.f +++ b/src/ezfio_interface.irp.f @@ -1,4 +1,4 @@ -BEGIN_SHELL [ /usr/bin/python ] +BEGIN_SHELL [ /usr/bin/python2 ] data = [ \ ("electrons_elec_coord_pool_size" , "integer" , "" ), diff --git a/src/properties.py b/src/properties.py index ff180f2..fa0d4fa 100755 --- a/src/properties.py +++ b/src/properties.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 import string import os