commit:     5f3bbdd655e095639112920670142a829ec65683
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Fri Jan 15 20:04:29 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Fri Jan 15 20:04:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=5f3bbdd6

sci-physics/openmx: fix fetch, version bump

no keywords yet because compilation fails
at the end with some undefined references

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>

 sci-physics/openmx/files/3.7-fortran_objects.patch | 15 ----
 sci-physics/openmx/openmx-3.6.ebuild               | 96 ----------------------
 .../{openmx-3.7.8.ebuild => openmx-3.9.ebuild}     | 87 ++++++++------------
 3 files changed, 34 insertions(+), 164 deletions(-)

diff --git a/sci-physics/openmx/files/3.7-fortran_objects.patch 
b/sci-physics/openmx/files/3.7-fortran_objects.patch
deleted file mode 100644
index 62521a4da..000000000
--- a/sci-physics/openmx/files/3.7-fortran_objects.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -Naurp openmx3.7.orig/source/makefile openmx3.7/source/makefile
---- openmx3.7.orig/source/makefile     2013-06-18 11:22:23.000000000 +0000
-+++ openmx3.7/source/makefile  2013-06-18 11:36:31.118716378 +0000
-@@ -818,8 +818,8 @@ TRAN_Set_SurfOverlap_NC.o: TRAN_Set_Surf
- 
- 
- elpa1.o: elpa1.f90 
--      $(FC) -c elpa1.f90
-+      $(FC) -c elpa1.f90 -o elpa1.o
- solve_evp_real.o: solve_evp_real.f90 
--      $(FC) -c solve_evp_real.f90 
-+      $(FC) -c solve_evp_real.f90 -o solve_evp_real.o
- solve_evp_complex.o: solve_evp_complex.f90 
--      $(FC) -c solve_evp_complex.f90
-+      $(FC) -c solve_evp_complex.f90 -o solve_evp_complex.o

diff --git a/sci-physics/openmx/openmx-3.6.ebuild 
b/sci-physics/openmx/openmx-3.6.ebuild
deleted file mode 100644
index 4da849ef5..000000000
--- a/sci-physics/openmx/openmx-3.6.ebuild
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils multilib toolchain-funcs
-
-DESCRIPTION="Material eXplorer"
-HOMEPAGE="http://www.openmx-square.org/";
-SRC_URI="
-       http://www.openmx-square.org/${PN}${PV}.tar.gz
-       http://www.openmx-square.org/bugfixed/11Nov14/patch${PV}.1.tar.gz";
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="-debug mpi openmp test"
-
-RDEPEND="
-       virtual/blas
-       virtual/lapack
-       sci-libs/fftw:3.0[mpi?,openmp?]
-       mpi? ( virtual/mpi )"
-DEPEND="${RDEPEND}
-       virtual/pkgconfig"
-
-S="${WORKDIR}/${PN}${PV}"
-
-pkg_setup() {
-       if use mpi; then
-               export CC="mpicc"
-       else
-               tc-export CC
-       fi
-
-       if use openmp; then
-               if tc-has-openmp; then
-                       export CC="${CC} -fopenmp"
-               else
-                       die "Please switch to an openmp compatible compiler"
-               fi
-       fi
-}
-
-src_prepare() {
-       cd "${WORKDIR}"
-       mv *.out "${PN}${PV}"/work/input_example
-       mv *.[hc] "${PN}${PV}"/source
-}
-
-src_configure() {
-       local FFTW_FLAVOUR=fftw3
-       if use openmp; then
-          FFTW_FLAVOUR=fftw3_omp
-       else
-          export CFLAGS="${CFLAGS} -Dnoomp"
-       fi
-       if use mpi; then
-          FFTW_FLAVOUR=fftw3_mpi
-       else
-          export CFLAGS="${CFLAGS} -Dnompi"
-       fi
-       CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags lapack)"
-       CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags ${FFTW_FLAVOUR})"
-       export CFLAGS
-
-       local MX_LIB="$($(tc-getPKG_CONFIG) --static --libs lapack)"
-       local MX_LIB="${MX_LIB} $($(tc-getPKG_CONFIG) --static --libs 
${FFTW_FLAVOUR})"
-
-       sed \
-               -e "s%^CC *=.*$%CC  = ${CC} ${CFLAGS}%" \
-               -e "s%^LIB *=.*$%LIB = ${MX_LIB}%" \
-               -i source/makefile || die
-}
-
-src_compile() {
-       emake -C source
-}
-
-src_test() {
-       cd work
-       ../source/openmx -runtest || die
-}
-
-src_install() {
-       insinto /usr/share/${P}
-       doins -r DFT_DATA11
-       cd work
-       insinto /usr/share/${P}/examples
-       doins -r *
-       cd ../source
-       dodir /usr/bin
-       emake DESTDIR="${D}/usr/bin" install
-       dodoc "${S}/${PN}${PV}.pdf"
-       use test && dodoc "${S}"/work/runtest.result
-}

diff --git a/sci-physics/openmx/openmx-3.7.8.ebuild 
b/sci-physics/openmx/openmx-3.9.ebuild
similarity index 62%
rename from sci-physics/openmx/openmx-3.7.8.ebuild
rename to sci-physics/openmx/openmx-3.9.ebuild
index 3a9758c85..dd2aa4975 100644
--- a/sci-physics/openmx/openmx-3.7.8.ebuild
+++ b/sci-physics/openmx/openmx-3.9.ebuild
@@ -1,34 +1,29 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit eutils multilib toolchain-funcs fortran-2
-
-PATCHDATE="14Feb17"
+inherit multilib toolchain-funcs flag-o-matic fortran-2
 
 DESCRIPTION="Material eXplorer"
-HOMEPAGE="http://www.openmx-square.org/";
-SRC_URI="
-       http://www.openmx-square.org/${PN}${PV%.[0-9]}.tar.gz
-       http://www.openmx-square.org/bugfixed/${PATCHDATE}/patch${PV}.tar.gz";
+HOMEPAGE="http://www.openmx-square.org/"; # no https, SSL invalid
+SRC_URI="http://t-ozaki.issp.u-tokyo.ac.jp/${PN}${PV}.tar.gz";
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="-debug mpi openmp test"
+KEYWORDS=""
+
+IUSE="debug openmp test"
 
 RDEPEND="
        virtual/blas
        virtual/lapack
-       sci-libs/fftw:3.0[mpi?,openmp?]
-       mpi? ( virtual/mpi )"
-DEPEND="${RDEPEND}
-       virtual/pkgconfig"
-
-S="${WORKDIR}/${PN}${PV%.[0-9]}"
+       virtual/mpi
+       sci-libs/fftw:3.0[mpi,openmp?]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
 
-MAKEOPTS+=" -j1"
+S="${WORKDIR}/${PN}${PV}/source"
 
 FORTRAN_STANDARD=90
 
@@ -41,13 +36,8 @@ pkg_setup() {
        fi
        export FC_LIB
 
-       if use mpi; then
-               export CC="mpicc"
-               export FC="mpif90"
-       else
-               tc-export CC
-               tc-export FC
-       fi
+       export CC="mpicc"
+       export FC="mpif90"
 
        if use openmp; then FORTRAN_NEED_OPENMP=1; fi
 
@@ -107,63 +97,54 @@ pkg_setup() {
 
 }
 
-src_prepare() {
-       cd "${WORKDIR}"
-       mv *.[hc] "${S}"/source
-       epatch "${FILESDIR}/3.7-fortran_objects.patch"
-}
-
 src_configure() {
        local FFTW_FLAVOUR=fftw3
        if use openmp; then
           FFTW_FLAVOUR=fftw3_omp
        else
-          export CFLAGS="${CFLAGS} -Dnoomp"
-       fi
-       if use mpi; then
-          FFTW_FLAVOUR=fftw3_mpi
-       else
-          export CFLAGS="${CFLAGS} -Dnompi"
+          append-cflag -Dnoomp
        fi
-       CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags lapack)"
-       CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags ${FFTW_FLAVOUR})"
-       export CFLAGS
+       append-cflags $($(tc-getPKG_CONFIG) --cflags lapack)
+       append-cflags $($(tc-getPKG_CONFIG) --cflags ${FFTW_FLAVOUR})
 
-       FCFLAGS="${FCFLAGS} -I/usr/include"
-       FCFLAGS="${FCFLAGS} $($(tc-getPKG_CONFIG) --cflags lapack)"
-       FCFLAGS="${FCFLAGS} $($(tc-getPKG_CONFIG) --cflags ${FFTW_FLAVOUR})"
-       export FCFLAGS
+       append-fflags -I/usr/include
+       append-fflags $($(tc-getPKG_CONFIG) --cflags lapack)
+       append-fflags $($(tc-getPKG_CONFIG) --cflags ${FFTW_FLAVOUR})
+
+       # otherwise we get Error: Rank mismatch between actual argument
+       # at (1) and actual argument at (2) (rank-1 and scalar)
+       append-fflags -fallow-argument-mismatch
 
        local MX_LIB="$($(tc-getPKG_CONFIG) --static --libs lapack)"
        MX_LIB="${MX_LIB} $($(tc-getPKG_CONFIG) --static --libs 
${FFTW_FLAVOUR})"
-       if use mpi; then
-               MX_LIB="${MX_LIB} $(mpif90 -showme:link)"
-       fi
+       MX_LIB="${MX_LIB} $(mpif90 -showme:link)"
 
        sed \
                -e "s%^CC *=.*$%CC  = ${CC} ${CFLAGS}%" \
                -e "s%^FC *=.*$%FC  = ${FC} ${FCFLAGS}%" \
                -e "s%^LIB *=.*$%LIB = ${MX_LIB} ${FC_LIB}%" \
-               -i source/makefile || die
+               -i makefile || die
 }
 
 src_compile() {
-       emake -C source
+       # does not properly parallelize
+       # file 1 says can't find file 2
+       # and at the same time file 2 can't find file 3
+       emake -j1
 }
 
 src_test() {
-       cd work
+       cd ../work
        ../source/openmx -runtest || die
 }
 
 src_install() {
        insinto /usr/share/${P}
-       doins -r DFT_DATA13
-       cd work
+       doins -r DFT_DATA19
+       cd ../work
        insinto /usr/share/${P}/examples
        doins -r *
        cd ../source
-       dodir /usr/bin
        emake DESTDIR="${D}/usr/bin" install
        dodoc "${S}/${PN}${PV%.?}.pdf"
        use test && dodoc "${S}"/work/runtest.result

Reply via email to