From 07b48ef2f722b526323a101f2c38f258129ee53f Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 2 Dec 2016 11:53:56 +0100 Subject: [PATCH] Updated install scripts --- README.md | 2 +- configure | 13 ++++-- include/.empty | 0 install/scripts/build.sh | 6 ++- install/scripts/install_curl.sh | 8 +--- install/scripts/install_f77zmq.sh | 3 +- install/scripts/install_gmp.sh | 17 ++++++++ install/scripts/install_m4.sh | 3 +- install/scripts/install_patch.sh | 4 +- install/scripts/install_zeromq.sh | 13 +----- install/scripts/install_zlib.sh | 7 +-- plugins/MRCC_Utils/mrcc_utils.irp.f | 68 +++++++++++++++-------------- src/Davidson/u0Hu0.irp.f | 4 +- 13 files changed, 79 insertions(+), 69 deletions(-) create mode 100644 include/.empty create mode 100755 install/scripts/install_gmp.sh diff --git a/README.md b/README.md index bb63b691..3caef9a0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Demo * Python >= 2.6 * GNU make * Bash -* Blast/Lapack +* Blas/Lapack * unzip * g++ (For ninja) diff --git a/configure b/configure index 8cb02608..060ae9b9 100755 --- a/configure +++ b/configure @@ -70,9 +70,10 @@ d_dependency = { "resultsFile": ["python"], "emsl": ["python"], "gcc": [], + "gmp": [ "gcc", "make" ], "g++": [], - "zeromq" : [ "g++" ], - "f77zmq" : [ "zeromq", "python" ], + "zeromq" : [ "g++", "make" ], + "f77zmq" : [ "zeromq", "python", "make" ], "python": [], "ninja": ["g++", "python"], "make": [], @@ -131,6 +132,11 @@ ninja = Info( description=' ninja', default_path=join(QP_ROOT_BIN, "ninja")) +gmp = Info( + url='https://gmplib.org/download/gmp/gmp-6.1.1.tar.bz2', + description=' GMP library', + default_path=join(QP_ROOT_LIB, "libgmp.so")) + emsl = Info( url='{head}/LCPQ/EMSL_Basis_Set_Exchange_Local/{tail}'.format(**path_github), description=' EMSL basis set library', @@ -166,7 +172,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)) @@ -495,6 +501,7 @@ def create_ninja_and_rc(l_installed): 'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"', 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "", + 'export C_INCLUDE_PATH="${C_INCLUDE_PATH}":"${QP_ROOT}"/include', 'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh', "", 'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true', '', diff --git a/include/.empty b/include/.empty new file mode 100644 index 00000000..e69de29b diff --git a/install/scripts/build.sh b/install/scripts/build.sh index 79a71065..5071b5aa 100755 --- a/install/scripts/build.sh +++ b/install/scripts/build.sh @@ -4,7 +4,11 @@ BUILD=_build/${TARGET} rm -rf -- ${BUILD} mkdir ${BUILD} || exit 1 -tar -zxf Downloads/${TARGET}.tar.gz --strip-components=1 --directory=${BUILD} || exit 1 +if [[ -f Downloads/${TARGET}.tar.gz ]] ; then + tar -zxf Downloads/${TARGET}.tar.gz --strip-components=1 --directory=${BUILD} || exit 1 +elif [[ -f Downloads/${TARGET}.tar.bz2 ]] ; then + tar -jxf Downloads/${TARGET}.tar.bz2 --strip-components=1 --directory=${BUILD} || exit 1 +fi _install || exit 1 rm -rf -- ${BUILD} _build/${TARGET}.log exit 0 diff --git a/install/scripts/install_curl.sh b/install/scripts/install_curl.sh index c3a48024..6194a0e0 100755 --- a/install/scripts/install_curl.sh +++ b/install/scripts/install_curl.sh @@ -10,10 +10,4 @@ function _install() mv curl.ermine ${QP_ROOT}/bin/curl || return 1 } -BUILD=_build/${TARGET} -rm -rf -- ${BUILD} -mkdir ${BUILD} || exit 1 -tar -xvjf Downloads/${TARGET}.tar.bz2 --strip-components=1 --directory=${BUILD} || exit 1 -_install || exit 1 -rm -rf -- ${BUILD} _build/${TARGET}.log -exit 0 \ No newline at end of file +source scripts/build.sh diff --git a/install/scripts/install_f77zmq.sh b/install/scripts/install_f77zmq.sh index 8357857c..92388337 100755 --- a/install/scripts/install_f77zmq.sh +++ b/install/scripts/install_f77zmq.sh @@ -7,10 +7,9 @@ function _install() cd .. QP_ROOT=$PWD cd - - export C_INCLUDE_PATH="${C_INCLUDE_PATH}":"${QP_ROOT}"/lib set -e set -u - export ZMQ_H="${QP_ROOT}"/lib/zmq.h + export ZMQ_H="${QP_ROOT}"/include/zmq.h cd "${BUILD}" make -j 8 || exit 1 mv libf77zmq.a "${QP_ROOT}"/lib || exit 1 diff --git a/install/scripts/install_gmp.sh b/install/scripts/install_gmp.sh new file mode 100755 index 00000000..e1464567 --- /dev/null +++ b/install/scripts/install_gmp.sh @@ -0,0 +1,17 @@ +#!/bin/bash -x + +TARGET=gmp + +function _install() +{ + rm -rf -- ${TARGET} + mkdir ${TARGET} || exit 1 + cd .. + QP_ROOT=$PWD + cd - + cd ${BUILD} + ./configure --prefix=$QP_ROOT && make || exit 1 + make install || exit 1 +} + +source scripts/build.sh diff --git a/install/scripts/install_m4.sh b/install/scripts/install_m4.sh index ca62a025..5a52d757 100755 --- a/install/scripts/install_m4.sh +++ b/install/scripts/install_m4.sh @@ -8,8 +8,7 @@ function _install() QP_ROOT=$PWD cd - cd ${BUILD} - ./configure && make || exit 1 - ln -sf ${PWD}/src/m4 ${QP_ROOT}/bin || exit 1 + ./configure --prefix=$QP_ROOT && make || exit 1 } source scripts/build.sh diff --git a/install/scripts/install_patch.sh b/install/scripts/install_patch.sh index 10522401..224ac8f8 100755 --- a/install/scripts/install_patch.sh +++ b/install/scripts/install_patch.sh @@ -9,11 +9,11 @@ function _install() QP_ROOT=$PWD cd - cd ${BUILD} - ./configure --prefix=${QP_ROOT}/install/${TARGET} && make || exit 1 + ./configure --prefix=${QP_ROOT} && make || exit 1 make install || exit 1 cd - cp ${TARGET}/bin/${TARGET} ${QP_ROOT}/bin || exit 1 rm -R -- ${TARGET} || exit 1 } -source scripts/build.sh \ No newline at end of file +source scripts/build.sh diff --git a/install/scripts/install_zeromq.sh b/install/scripts/install_zeromq.sh index 3bf2a715..f6596f9c 100755 --- a/install/scripts/install_zeromq.sh +++ b/install/scripts/install_zeromq.sh @@ -7,22 +7,13 @@ function _install() cd .. QP_ROOT=$PWD cd - - export C_INCLUDE_PATH="${C_INCLUDE_PATH}":./ set -e set -u ORIG=$(pwd) cd "${BUILD}" - ./configure --without-libsodium || exit 1 + ./configure --prefix=$QP_ROOT --without-libsodium || exit 1 make -j 8 || exit 1 - rm -f -- "${QP_ROOT}"/lib/libzmq.a "${QP_ROOT}"/lib/libzmq.so "${QP_ROOT}"/lib/libzmq.so.? - cp .libs/libzmq.a "${QP_ROOT}"/lib - cp .libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.5 -# cp src/.libs/libzmq.a "${QP_ROOT}"/lib -# cp src/.libs/libzmq.so "${QP_ROOT}"/lib/libzmq.so.4 - cp include/{zmq.h,zmq_utils.h} "${QP_ROOT}"/lib - cd "${QP_ROOT}"/lib - ln -s libzmq.so.5 libzmq.so -# ln -s libzmq.so.4 libzmq.so + make install || exit 1 cd ${ORIG} return 0 } diff --git a/install/scripts/install_zlib.sh b/install/scripts/install_zlib.sh index 06ce67f3..ea268f2e 100755 --- a/install/scripts/install_zlib.sh +++ b/install/scripts/install_zlib.sh @@ -11,11 +11,8 @@ function _install() cd - cd ${BUILD} ./configure && make || exit 1 - make install prefix=$QP_ROOT/install/${TARGET} || exit 1 - ln -s -f $QP_ROOT/install/${TARGET}/lib/libz.so $QP_ROOT/lib || exit 1 - ln -s -f $QP_ROOT/install/${TARGET}/lib/libz.a $QP_ROOT/lib || exit 1 - ln -s -f $QP_ROOT/install/${TARGET}/include/zlib.h $QP_ROOT/lib || exit 1 - ln -s -f $QP_ROOT/install/${TARGET}/include/zconf.h $QP_ROOT/lib || exit 1 + ./configure --prefix=$QP_ROOT && make || exit 1 + make install || exit 1 } source scripts/build.sh diff --git a/plugins/MRCC_Utils/mrcc_utils.irp.f b/plugins/MRCC_Utils/mrcc_utils.irp.f index 5cb3f945..16fb6eff 100644 --- a/plugins/MRCC_Utils/mrcc_utils.irp.f +++ b/plugins/MRCC_Utils/mrcc_utils.irp.f @@ -174,42 +174,44 @@ END_PROVIDER call u_0_S2_u_0(CI_eigenvectors_s2_dressed,CI_eigenvectors_dressed,N_det,psi_det,N_int,& N_states_diag,size(CI_eigenvectors_dressed,1)) - double precision :: u_dot_u - double precision, allocatable :: h(:,:), s(:,:) - allocate (h(N_states,N_states), s(N_states,N_states)) - do i=1,N_states - do j=1,N_states - s(i,j) = u_dot_v(CI_eigenvectors_dressed(1,i),CI_eigenvectors_dressed(1,j),N_det) - print *, 'S(',i,',',j,')', s(i,j) - enddo - enddo +! double precision :: u_dot_u +! double precision, allocatable :: h(:,:,:), s(:,:) +! allocate (h(N_states,N_states,N_states), s(N_states,N_states)) +! do i=1,N_states +! do j=1,N_states +! s(i,j) = u_dot_v(CI_eigenvectors_dressed(1,i),CI_eigenvectors_dressed(1,j),N_det) +! print *, 'S(',i,',',j,')', s(i,j) +! enddo +! enddo +! +! do i=1,N_states +! h(i,i) = CI_electronic_energy_dressed(i) +! do j=i+1,N_states +! h(j,i) = (CI_electronic_energy_dressed(j)-CI_electronic_energy_dressed(i)) * s(i,j) +! h(i,j) = -h(j,i) +! print *, 'h(',i,',',i,')', h(i,j) +! enddo +! print *, 'h(',i,',',i,')', h(i,i) +! enddo +! call lapack_diag(eigenvalues,eigenvectors, h,size(h,1),N_states) +! do i=1,N_states +! CI_electronic_energy_dressed(i) = eigenvalues(i) +! do j=1,N_states +! h(i,j) = eigenvectors(i,j) +! enddo +! enddo +! do k=1,N_states +! eigenvectors(1:N_det,k) = 0.d0 +! do i=1,N_states +! eigenvectors(1:N_det,k) += CI_eigenvectors_dressed(1:N_det,k) * h(k,i) +! enddo +! enddo +! deallocate(h,s) +! - do i=1,N_states - h(i,i) = CI_electronic_energy_dressed(i) - do j=i+1,N_states - h(j,i) = (CI_electronic_energy_dressed(j)-CI_electronic_energy_dressed(i)) * s(i,j) - h(i,j) = -h(j,i) - print *, 'h(',i,',',i,')', h(i,j) - enddo - print *, 'h(',i,',',i,')', h(i,i) - enddo - call lapack_diag(eigenvalues,eigenvectors, h,size(h,1),N_states) - do i=1,N_states - CI_electronic_energy_dressed(i) = eigenvalues(i) - do j=1,N_states - h(i,j) = eigenvectors(i,j) - enddo - enddo - do k=1,N_states - eigenvectors(1:N_det,k) = 0.d0 - do i=1,N_states - eigenvectors(1:N_det,k) += CI_eigenvectors_dressed(1:N_det,k) * h(k,i) - enddo - enddo - deallocate(h,s) + call multi_state(CI_electronic_energy_dressed,CI_eigenvectors_dressed,size(CI_eigenvectors_dressed,1)) deallocate (eigenvectors,eigenvalues) - else if (diag_algorithm == "Lapack") then diff --git a/src/Davidson/u0Hu0.irp.f b/src/Davidson/u0Hu0.irp.f index dd5ab1ab..4c465e40 100644 --- a/src/Davidson/u0Hu0.irp.f +++ b/src/Davidson/u0Hu0.irp.f @@ -344,7 +344,7 @@ subroutine H_S2_u_0_nstates(v_0,s_0,u_0,H_jj,S2_jj,n,keys_tmp,Nint,N_st,sze_8) Vt = 0.d0 St = 0.d0 - !$OMP DO SCHEDULE(static,1) + !$OMP DO SCHEDULE(dynamic) do sh=1,shortcut(0,2) do i=shortcut(sh,2),shortcut(sh+1,2)-1 org_i = sort_idx(i,2) @@ -369,7 +369,7 @@ subroutine H_S2_u_0_nstates(v_0,s_0,u_0,H_jj,S2_jj,n,keys_tmp,Nint,N_st,sze_8) enddo !$OMP END DO NOWAIT do sh=1,shortcut(0,1) - !$OMP DO SCHEDULE(static,1) + !$OMP DO SCHEDULE(dynamic) do sh2=sh,shortcut(0,1) exa = 0 do ni=1,Nint