[new-package] quantum-espresso 7.3.1

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2023-03-03 10:12:26 +01:00
parent 395c7e23f2
commit bc43af0012
6 changed files with 1296 additions and 0 deletions

5
mingw-w64-quantum-espresso/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
d3q
devxlib
fox
pw2qmcpack
qe-gipaw

View File

@@ -0,0 +1,33 @@
--- a/XClib/beefleg.h
+++ b/XClib/beefleg.h
@@ -626,10 +626,10 @@
//random number generation macros
#define unirandinc0() \
- ( ((double) random()) / ((double) RAND_MAX) )
+ ( ((double) rand()) / ((double) RAND_MAX) )
#define unirandex0() \
- ( (1.+random()) / (1.+RAND_MAX) )
+ ( (1.+rand()) / (1.+RAND_MAX) )
#define normrand() \
( sqrt(-2.*log(unirandex0())) * cos(M_PI*2.*unirandinc0()) )
--- a/XClib/beefun.c
+++ b/XClib/beefun.c
@@ -322,13 +322,13 @@
// initialize pseudo random number generator
void beefrandinit_(unsigned int *seed)
{
- srandom(*seed);
+ srand(*seed);
}
// initialize pseudo random number generator with default seed
void beefrandinitdef_()
{
- srandom(defaultseed);
+ srand(defaultseed);
}
// calculate ensemble energies

View File

@@ -0,0 +1,12 @@
--- a/external/devxlib/src/timer.c
+++ b/external/devxlib/src/timer.c
@@ -1,7 +1,9 @@
#include <time.h>
#include <sys/types.h>
+#ifndef _WIN32
#include <sys/times.h>
+#endif
#include <sys/time.h>

View File

@@ -0,0 +1,40 @@
--- a/Modules/CMakeLists.txt
+++ b/Modules/CMakeLists.txt
@@ -215,6 +215,7 @@
sockets.c
stack.c)
qe_add_library(qe_modules_c ${src_modules_c})
+set_target_properties(qe_modules_c PROPERTIES Fortran_MODULE_DIRECTORY "")
if(TARGET gitrev)
add_dependencies(qe_modules gitrev)
--- a/UtilXlib/CMakeLists.txt
+++ b/UtilXlib/CMakeLists.txt
@@ -34,6 +34,7 @@
memusage.c
ptrace.c)
qe_add_library(qe_utilx_c ${src_util_c})
+set_target_properties(qe_utilx_c PROPERTIES Fortran_MODULE_DIRECTORY "")
target_link_libraries(qe_utilx
PUBLIC
qe_utilx_c # cclock is exposed by the mytime module in clocks_handler
--- a/XClib/CMakeLists.txt
+++ b/XClib/CMakeLists.txt
@@ -43,6 +43,7 @@
pbecor.c
beefun.c)
qe_add_library(qe_libbeef ${sources_libbeef})
+set_target_properties(qe_libbeef PROPERTIES Fortran_MODULE_DIRECTORY "")
target_link_libraries(qe_libbeef
PUBLIC
qe_openacc_c
--- a/external/pw2qmcpack/CMakeLists.txt
+++ b/external/pw2qmcpack/CMakeLists.txt
@@ -47,6 +47,7 @@
qe_add_library(pw2qmcpack_esh5 src/esh5_interfaces.c)
target_compile_definitions(pw2qmcpack_esh5 PUBLIC "H5_USE_16_API;__HDF5_C")
target_link_libraries(pw2qmcpack_esh5 PRIVATE pw2qmcpack_hdf5_c pw2qmcpack_mpi_c)
+set_target_properties(pw2qmcpack_esh5 PROPERTIES Fortran_MODULE_DIRECTORY "")
set(sources src/pw2qmcpack.f90)
qe_add_executable(pw2qmcpack_exe ${sources})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,130 @@
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
_realname=quantum-espresso
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=7.3.1
pkgrel=1
_d3q_commit=87685245bc5bc14f226fc18e5126305501b368e8
_devxlib_commit=a6b89ef77b1ceda48e967921f1f5488d2df9226d
_fox_commit=3453648e6837658b747b895bb7bef4b1ed2eac40
_pw2qmcpack_commit=f72ab25fa4ea755c1b4b230ae8074b47d5509c70
_qe_gipaw_commit=75b01b694c9ba4df55d294cacc27cf28591b2161
pkgdesc="opEn-Source Package for Research in Electronic Structure, Simulation, and Optimization (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64')
url='http://www.quantum-espresso.org/'
msys2_repository_url="https://gitlab.com/QEF/q-e"
msys2_references=(
'aur: quantum-espresso'
)
license=('spdx:GPL-2.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-fftw"
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
$([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-libmbd"
#"${MINGW_PACKAGE_PREFIX}-libxc"
"${MINGW_PACKAGE_PREFIX}-omp"
"${MINGW_PACKAGE_PREFIX}-openblas")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-fc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-wannier90"
#"${MINGW_PACKAGE_PREFIX}-environ"
"git")
source=("https://gitlab.com/QEF/q-e/-/archive/qe-${pkgver}/q-e-qe-${pkgver}.tar.bz2"
#"d3q::git+https://github.com/anharmonic/d3q#commit=${_d3q_commit}"
"devxlib::git+https://gitlab.com/max-centre/components/devicexlib#commit=${_devxlib_commit}"
"fox::git+https://github.com/pietrodelugas/fox#commit=${_fox_commit}"
"pw2qmcpack::git+https://github.com/QMCPACK/pw2qmcpack#commit=${_pw2qmcpack_commit}"
#"qe-gipaw::git+https://github.com/dceresoli/qe-gipaw#commit=${_qe_gipaw_commit}"
"001-use-srand-instead-of-srandom.patch"
"002-fix-build-devxlib-on-mingw.patch"
"003-fix-install-c-libraries.patch"
"004-fix-executable-suffix-on-mingw.patch")
sha256sums=('4955e4ca5e47a0faafefc72442155bef02ff94c8b796698ad81d4804a1cf6d88'
'ef02c13a1ea73f38f0b81edd281c991c25bf045307ceb305f5c0f96b743d1556'
'8625181b53f2b616a0f704507b4f2381f7b9fabe02078dfb74ab41ee11f5c260'
'f0f5ebece3f0142e0d0b476db9547d8501de80259bc6409e9b108b887e4cc058'
'2e18a13c194328516176c2bc2429ac230c9fc585381aa238e586b6034a7df0cb'
'faaf147678e0c79a6678c5463dd5a466769257968275ef562f40ad1a0c2aacc6'
'8620f943efd69971a1ca9cd3f0bfe35a1f73a771bf30b1b3516bf74d9a2ca702'
'7ce3be146fca1868ad94f2fc7c91ad767e3ce359eadbaf0c3d275290c3fd16f0')
noextract=("q-e-qe-${pkgver}.tar.bz2")
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}
prepare() {
echo "Extracting q-e-qe-${pkgver}.tar.bz2..."
tar -xjf q-e-qe-${pkgver}.tar.bz2 || true
for _ext_prj in devxlib fox pw2qmcpack; do
mv ${_ext_prj} q-e-qe-${pkgver}/external/
done
cd "${srcdir}"/q-e-qe-${pkgver}
apply_patch_with_msg \
001-use-srand-instead-of-srandom.patch \
002-fix-build-devxlib-on-mingw.patch \
003-fix-install-c-libraries.patch \
004-fix-executable-suffix-on-mingw.patch
}
build() {
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
if [[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]]; then
export FFLAGS=" -Wno-missing-include-dirs -w"
fi
CFLAGS+=" -Wno-incompatible-pointer-types" \
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
"${MINGW_PREFIX}"/bin/cmake.exe -Wno-dev \
-GNinja \
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS=OFF \
-DQE_ENABLE_FOX=ON \
-DQE_ENABLE_HDF5=ON \
-DQE_ENABLE_OPENMP=ON \
-DQE_ENABLE_ENVIRON=OFF \
-DQE_ENABLE_LIBXC=OFF \
-DQE_ENABLE_MPI=OFF \
-DQE_ENABLE_TEST=OFF \
-DQE_ENABLE_PLUGINS="pw2qmcpack;legacy" \
-DQE_DEVICEXLIB_INTERNAL=ON \
-DQE_FOX_INTERNAL=ON \
-DQE_MBD_INTERNAL=OFF \
-DQE_WANNIER90_INTERNAL=OFF \
-DQE_FFTW_VENDOR="FFTW3" \
-DBLA_VENDOR=OpenBLAS \
-S q-e-qe-${pkgver} \
-B build-${MSYSTEM}
"${MINGW_PREFIX}"/bin/cmake.exe --build build-${MSYSTEM}
}
package() {
DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install build-${MSYSTEM}
install -Dm644 "${srcdir}"/q-e-qe-${pkgver}/License \
"${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/qe/*.cmake; do
sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f}
done
}