The package rpms/python-pyscf.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-pyscf.git/commit/?id=584d2....
Change:
+ExcludeArch: %{power64}
Thanks.
Full change:
============
commit 584d2673f7f1255d2fab91c817029bcecd8006be
Author: Susi Lehtola <jussilehtola(a)fedoraproject.org>
Date: Thu Jan 23 19:08:55 2020 +0100
Disable build on power64.
diff --git a/python-pyscf.spec b/python-pyscf.spec
index dc38535..f73274e 100644
--- a/python-pyscf.spec
+++ b/python-pyscf.spec
@@ -19,6 +19,10 @@ Patch0: pyscf-1.7.0-python3.patch
# Disable rpath
Patch1: pyscf-1.7.0-rpath.patch
+# ppc64 doesn't appear to have floats beyond 64 bits, so ppc64 is
+# disabled as per upstream's request as for the libcint package.
+ExcludeArch: %{power64}
+
BuildRequires: openblas-devel
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
@@ -117,7 +121,7 @@ export PYTHONPATH=$PWD
%changelog
* Thu Jan 23 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-4
-- Switch buildrequire to libcint.
+- Switch buildrequire to libcint and disable build on ppc64.
* Thu Jan 23 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-3
- Filter provides and requires.
commit d72c8e343e08eeab7748802b0e260515360b1f23
Author: Susi Lehtola <jussilehtola(a)fedoraproject.org>
Date: Thu Jan 23 19:01:38 2020 +0100
Switch to libcint as buildrequire.
diff --git a/python-pyscf.spec b/python-pyscf.spec
index 5c1c1be..dc38535 100644
--- a/python-pyscf.spec
+++ b/python-pyscf.spec
@@ -8,7 +8,7 @@
Name: python-pyscf
Version: 1.7.0
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Python module for quantum chemistry
License: ASL 2.0
URL:
https://github.com/pyscf/pyscf/
@@ -26,7 +26,7 @@ BuildRequires: python3-numpy
BuildRequires: python3-scipy
BuildRequires: python3-h5py
BuildRequires: libxc-devel
-BuildRequires: qcint-devel
+BuildRequires: libcint-devel
BuildRequires: cmake
BuildRequires: gcc-c++
@@ -116,6 +116,9 @@ export PYTHONPATH=$PWD
%{python3_sitearch}/pyscf/
%changelog
+* Thu Jan 23 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-4
+- Switch buildrequire to libcint.
+
* Thu Jan 23 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-3
- Filter provides and requires.
commit 220bb4aaececf3fbc2cc3362360348d0bbb64376
Author: Susi Lehtola <jussilehtola(a)fedoraproject.org>
Date: Thu Jan 23 18:45:05 2020 +0100
Initial import
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..489b6df
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/pyscf-1.7.0.tar.gz
diff --git a/pyscf-1.7.0-python3.patch b/pyscf-1.7.0-python3.patch
new file mode 100644
index 0000000..869b1a8
--- /dev/null
+++ b/pyscf-1.7.0-python3.patch
@@ -0,0 +1,174 @@
+diff --git a/pyscf/dmrgscf/p_dmrg.py b/pyscf/dmrgscf/p_dmrg.py
+index 9522d5b9..8b6eb271 100644
+--- a/pyscf/dmrgscf/p_dmrg.py
++++ b/pyscf/dmrgscf/p_dmrg.py
+@@ -106,22 +106,22 @@ class PDMRG(DMRGCI):
+ fout.write(line)
+ fout.write('fullrestart')
+
+- import os
+- block_path = os.path.dirname(self.executable)
+- check_call(["%s %s/OH oh.conf wavenum >
oh.out"%(self.mpiprefix,block_path)], shell=True)
+- with open('oh.out','r') as f:
++ import os
++ block_path = os.path.dirname(self.executable)
++ check_call(["%s %s/OH oh.conf wavenum >
oh.out"%(self.mpiprefix,block_path)], shell=True)
++ with open('oh.out','r') as f:
+ H0 = float(f.readlines()[-4])
+- H0 -=self.core_energy
+- E0 = self.E_dmrg*self.H0factor + H0*(1.0-self.H0factor)
++ H0 -=self.core_energy
++ E0 = self.E_dmrg*self.H0factor + H0*(1.0-self.H0factor)
+
+- check_call(["head -n -1 %s > tmpfile"%self.H0_file], shell=True)
+- check_call(["cp tmpfile %s"%self.H0_file], shell=True)
+- with open('%s'%self.H0_file,'a') as f:
++ check_call(["head -n -1 %s > tmpfile"%self.H0_file], shell=True)
++ check_call(["cp tmpfile %s"%self.H0_file], shell=True)
++ with open('%s'%self.H0_file,'a') as f:
+ f.write('%s 0 0 0 0\n'%(-E0))
+
+- check_call(["head -n -1 %s > tmpfile"%self.H1_file], shell=True)
+- check_call(["cp tmpfile %s"%self.H1_file], shell=True)
+- with open('%s'%self.H1_file,'a') as f:
++ check_call(["head -n -1 %s > tmpfile"%self.H1_file], shell=True)
++ check_call(["cp tmpfile %s"%self.H1_file], shell=True)
++ with open('%s'%self.H1_file,'a') as f:
+ f.write('%s 0 0 0 0\n'%(-self.E_dmrg))
+
+ def compress(self):
+diff --git a/pyscf/tools/Molpro2Pyscf/MolproXml.py
b/pyscf/tools/Molpro2Pyscf/MolproXml.py
+index d58ceb9d..61c78617 100644
+--- a/pyscf/tools/Molpro2Pyscf/MolproXml.py
++++ b/pyscf/tools/Molpro2Pyscf/MolproXml.py
+@@ -30,6 +30,7 @@
+ # This file is adapted with permission from the wmme program of Gerald Knizia.
+ # See
http://sites.psu.edu/knizia/software/
+ #====================================================
++from __future__ import print_function
+
+
+
+@@ -209,7 +210,7 @@ def _ReadOrbitals(OrbitalsNode, Atoms, OrbBasis, SkipVirtual):
+ nBf = OrbBasis.nFn
+ Orbitals = []
+ count =0 #ELVIRA
+- print "# orb iSym iOrbInSym" #ELVIRA
++ print("# orb iSym iOrbInSym") #ELVIRA
+
+ nOrbInSym = np.array(8*[0])
+ for OrbNode in OrbitalsNode.findall("orbital"):
+@@ -225,7 +226,7 @@ def _ReadOrbitals(OrbitalsNode, Atoms, OrbBasis, SkipVirtual):
+ #raise Exception("Number of orbital coefficients differs from number of
basis functions.")
+ Orbitals.append(FOrbitalInfo(Coeffs, fEnergy, fOcc, iSym, iOrbInSym, OrbBasis))
+ if fOcc != 0.0:
+- print count , " ", iSym, " ", iOrbInSym
#ELVIRA
++ print(count , " ", iSym, " ", iOrbInSym)
#ELVIRA
+ count +=1 #ElVIRA
+ return Orbitals
+
+@@ -484,7 +485,7 @@ def _main():
+ FileName = "benzene.xml"
+ #FileName = "/home/cgk/dev/xml-molpro/test1.xml"
+ XmlData = ReadMolproXml(FileName,SkipVirtual=True)
+- print "Atoms from file [a.u.]:\n%s" %
XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)
++ print("Atoms from file
[a.u.]:\n{}".format(XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)))
+ OrbBasis = XmlData.OrbBasis
+ #BasisLibs = ["def2-nzvpp-jkfit.libmol"]
+
+@@ -494,14 +495,14 @@ def _main():
+ from wmme import mdot
+ C = XmlData.Orbs
+ S = ic.MakeOverlap()
+- print "Orbital matrix shape: %s (loaded from '%s')" % (C.shape,
FileName)
+- print "Overlap matrix shape: %s (made via WMME)" % (S.shape,)
++ print("Orbital matrix shape: {} (loaded from '{}')".format(C.shape,
FileName))
++ print("Overlap matrix shape: {} (made via WMME)".format(S.shape))
+ np.set_printoptions(precision=4,linewidth=10000,edgeitems=3,suppress=False)
+ SMo = mdot(C.T, S, C)
+- print "Read orbitals:"
++ print("Read orbitals:")
+ for OrbInfo in XmlData.Orbitals:
+- print "%30s" % OrbInfo.Desc
+- print "MO deviation from orthogonality: %.2e" % rmsd(SMo -
np.eye(SMo.shape[0]))
++ print("{:30s}".format(OrbInfo.Desc))
++ print("MO deviation from orthogonality: {:.2e}".format(rmsd(SMo -
np.eye(SMo.shape[0]))))
+
+ pass
+
+diff --git a/pyscf/tools/Molpro2Pyscf/example_Pd_atom.py
b/pyscf/tools/Molpro2Pyscf/example_Pd_atom.py
+index 5fcf6c7b..033b03d2 100644
+--- a/pyscf/tools/Molpro2Pyscf/example_Pd_atom.py
++++ b/pyscf/tools/Molpro2Pyscf/example_Pd_atom.py
+@@ -28,6 +28,7 @@
+ # Note, that right now the default value is SkipVirtual =True, that means that Orbitals
COrb include only those,
+ # which have non-zero occupation numbers in XML file. If you want virtual orbitals too,
change SkipVirtual to False.
+
++from __future__ import print_function
+
+ import numpy as np
+ from wmme import mdot
+@@ -47,20 +48,20 @@ def rmsd(X):
+
+
+ def PrintMatrix(Caption, M):
+- print "Matrix %s [%i x %i]:\n" % (Caption, M.shape[0], M.shape[1])
+- ColsFmt = M.shape[1] * " %11.5f"
++ print("Matrix {} [{} x {}]:\n".format(Caption, M.shape[0], M.shape[1]))
++ ColsFmt = M.shape[1] * " {:11.5f}"
+ for iRow in range(M.shape[0]):
+- print " %s" % (ColsFmt % tuple(M[iRow,:]))
++ print(ColsFmt.format(tuple(M[iRow,:])))
+
+
+ def _run_with_pyscf(FileNameXml):
+ # read Molpro XML file exported via {put,xml,filename}
+- print "\n* Reading: '%s'" % FileNameXml
++ print("\n* Reading: '{}'".format(FileNameXml))
+ XmlData = MolproXml.ReadMolproXml(FileNameXml, SkipVirtual=True)
+ # Note, that right now the default value is SkipVirtual =True, that means that Orbitals
COrb include only those,
+ # which have non-zero occupation numbers in XML file. If you want virtual orbitals too,
change SkipVirtual to False.
+
+- print "Atoms from file [a.u.]:\n%s" %
XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)
++ print("Atoms from file
[a.u.]:\n{}".format(XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)))
+
+ # convert data from XML file (atom positions, basis sets, MO coeffs) into format
compatible
+ # with PySCF.
+@@ -82,14 +83,14 @@ def _run_with_pyscf(FileNameXml):
+ # and the overlap matrix computed with PySCF to check that MO were imported
properly.
+ SMo = mdot(COrb.T, S, COrb)
+ PrintMatrix("MO-Basis overlap (should be unity!)", SMo)
+- print "RMSD(SMo-id): %8.2e" % rmsd(SMo - np.eye(SMo.shape[0]))
++ print("RMSD(SMo-id): {:8.2e}".format(rmsd(SMo - np.eye(SMo.shape[0]))))
+ print
+
+ def get_1e_integrals_in_MOs_from_Molpro_for_SOC(FileNameXml):
+ # read Molpro XML file exported via {put,xml,filename}
+- print "\n* Reading: '%s'" % FileNameXml
++ print("\n* Reading: '{}'".format(FileNameXml))
+ XmlData = MolproXml.ReadMolproXml(FileNameXml, SkipVirtual=True)
+- print "Atoms from file [a.u.]:\n%s" %
XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)
++ print("Atoms from file
[a.u.]:\n{}".format(XmlData.Atoms.MakeXyz(NumFmt="%20.15f",Scale=1/wmme.ToAng)))
+
+ # convert data from XML file (atom positions, basis sets, MO coeffs) into format
compatible # with PySCF.
+ Atoms, Basis, COrb = MolproXmlToPyscf.ConvertMolproXmlToPyscfInput(XmlData)
+@@ -122,8 +123,8 @@ def get_1e_integrals_in_MOs_from_Molpro_for_SOC(FileNameXml):
+ for o2 in range(norb):
+ ActOrb[o1,o2]= COrb[o1, Orblist[o2]]
+
+- print "================================================="
+- print " Now print So1e integrals"
++ print("=================================================")
++ print(" Now print So1e integrals")
+ for id in range(natoms):
+ chg = mol.atom_charge(id)
+ mol.set_rinv_origin_(mol.atom_coord(id)) # set the gauge origin to first atom
+@@ -134,7 +135,7 @@ def get_1e_integrals_in_MOs_from_Molpro_for_SOC(FileNameXml):
+ for i in range(3):
+ for j in range(h1[i].shape[0]):
+ for k in range(h1[i].shape[1]):
+- print id, i+1, j+1, k+1, h1[i][j,k]
++ print(id, i+1, j+1, k+1, h1[i][j,k])
+
+
+
diff --git a/pyscf-1.7.0-rpath.patch b/pyscf-1.7.0-rpath.patch
new file mode 100644
index 0000000..080364f
--- /dev/null
+++ b/pyscf-1.7.0-rpath.patch
@@ -0,0 +1,21 @@
+diff -up pyscf-1.7.0/pyscf/lib/CMakeLists.txt.rpath pyscf-1.7.0/pyscf/lib/CMakeLists.txt
+--- pyscf-1.7.0/pyscf/lib/CMakeLists.txt.rpath 2020-01-02 09:51:51.000000000 +0200
++++ pyscf-1.7.0/pyscf/lib/CMakeLists.txt 2020-01-22 12:00:17.241885886 +0200
+@@ -105,17 +105,6 @@ configure_file(
+ # to find config.h
+ include_directories("${PROJECT_BINARY_DIR}")
+
+-# See also
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
+-if (WIN32)
+- #?
+-elseif (APPLE)
+- #TODO: test me set(CMAKE_MACOSX_RPATH On)
+-else ()
+- set(CMAKE_SKIP_BUILD_RPATH True)
+- set(CMAKE_BUILD_WITH_INSTALL_RPATH True)
+- set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/deps/lib")
+-endif ()
+-
+ add_subdirectory(np_helper)
+ add_subdirectory(gto)
+ add_subdirectory(vhf)
diff --git a/python-pyscf.spec b/python-pyscf.spec
new file mode 100644
index 0000000..5c1c1be
--- /dev/null
+++ b/python-pyscf.spec
@@ -0,0 +1,126 @@
+# Omit internal libraries from dependency generation. We can omit all
+# the provides
+%global __provides_exclude_from ^%{python3_sitearch}/pyscf/lib/.*\\.so$
+# but since we still need to pick up the dependencies for libcint,
+# libxc, etc, we just have to filter out the internal libraries
+%global __requires_exclude
^(libao2mo\\.so|libcgto\\.so|libcvhf\\.so|libfci\\.so|libnp_helper\\.so).*$
+
+
+Name: python-pyscf
+Version: 1.7.0
+Release: 3%{?dist}
+Summary: Python module for quantum chemistry
+License: ASL 2.0
+URL:
https://github.com/pyscf/pyscf/
+Source0:
https://github.com/pyscf/pyscf/archive/v%{version}/pyscf-%{version}.tar.gz
+
+# Patch code to use python3; upstreamed at
https://github.com/pyscf/pyscf/pull/492
+Patch0: pyscf-1.7.0-python3.patch
+# Disable rpath
+Patch1: pyscf-1.7.0-rpath.patch
+
+BuildRequires: openblas-devel
+BuildRequires: python3-devel
+BuildRequires: python3dist(setuptools)
+BuildRequires: python3-numpy
+BuildRequires: python3-scipy
+BuildRequires: python3-h5py
+BuildRequires: libxc-devel
+BuildRequires: qcint-devel
+BuildRequires: cmake
+BuildRequires: gcc-c++
+
+# For tests
+BuildRequires: python3-pytest
+BuildRequires: python3-pytest-cov
+
+%description
+Pythonbased simulations of chemistry framework (PySCF) is a
+generalpurpose electronic structure platform designed from the ground
+up to emphasize code simplicity, so as to facilitate new method
+development and enable flexible computational workflows. The package
+provides a wide range of tools to support simulations of finitesize
+systems, extended systems with periodic boundary conditions,
+lowdimensional periodic systems, and custom Hamiltonians, using
+meanfield and postmeanfield methods with standard Gaussian basis
+functions. To ensure ease of extensibility, PySCF uses the Python
+language to implement almost all of its features, while
+computationally critical paths are implemented with heavily optimized
+C routines. Using this combined Python/C implementation, the package
+is as efficient as the best existing C or Fortranbased quantum
+chemistry programs.
+
+%package -n python3-pyscf
+Summary: Python 3 module for quantum chemistry
+# These are needed at runtime
+Requires: python3-numpy
+Requires: python3-scipy
+Requires: python3-h5py
+
+%description -n python3-pyscf
+Pythonbased simulations of chemistry framework (PySCF) is a
+generalpurpose electronic structure platform designed from the ground
+up to emphasize code simplicity, so as to facilitate new method
+development and enable flexible computational workflows. The package
+provides a wide range of tools to support simulations of finitesize
+systems, extended systems with periodic boundary conditions,
+lowdimensional periodic systems, and custom Hamiltonians, using
+meanfield and postmeanfield methods with standard Gaussian basis
+functions. To ensure ease of extensibility, PySCF uses the Python
+language to implement almost all of its features, while
+computationally critical paths are implemented with heavily optimized
+C routines. Using this combined Python/C implementation, the package
+is as efficient as the best existing C or Fortranbased quantum
+chemistry programs.
+
+%prep
+%setup -q -n pyscf-%{version}
+%patch0 -p1 -b .py3
+%patch1 -p1 -b .rpath
+
+# Remove shebangs
+find pyscf -name \*.py -exec sed -i '/#!\/usr\/bin\/env /d' '{}' \;
+find pyscf -name \*.py -exec sed -i '/#!\/usr\/bin\/python/d' '{}' \;
+
+%build
+cd pyscf/lib
+mkdir objdir
+cd objdir
+%cmake .. -DBUILD_LIBXC=OFF -DENABLE_XCFUN=OFF -DBUILD_XCFUN=OFF -DBUILD_LIBCINT=OFF
-DBLAS_LIBRARIES="-lopenblas" -DCMAKE_SKIP_BUILD_RPATH=1
+%make_build
+
+%install
+# Package doesn't have an install command, so we do this by hand.
+# Install all python sources
+for f in $(find pyscf -name \*.py); do
+ install -D -p -m 644 $f %{buildroot}%{python3_sitearch}/$f
+done
+# Install data files (mostly basis sets)
+for f in $(find pyscf -name \*.dat); do
+ install -D -p -m 644 $f %{buildroot}%{python3_sitearch}/$f
+done
+# Install compiled libraries
+for f in $(find pyscf -name \*.so); do
+ install -D -p -m 755 $f %{buildroot}%{python3_sitearch}/$f
+done
+
+%check
+export PYTHONPATH=$PWD
+## While the program has tests, they take forever and won't ever finish
+##on the build system.
+#pytest
+
+%files -n python3-pyscf
+%license LICENSE
+%doc CHANGELOG CONTRIBUTING.md FEATURES NOTICE README.md
+%{python3_sitearch}/pyscf/
+
+%changelog
+* Thu Jan 23 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-3
+- Filter provides and requires.
+
+* Wed Jan 22 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-2
+- Remove shebangs and rpath.
+
+* Tue Jan 07 2020 Susi Lehtola <jussilehtola(a)fedoraproject.org> - 1.7.0-1
+- First release.
diff --git a/sources b/sources
new file mode 100644
index 0000000..88dc00f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (pyscf-1.7.0.tar.gz) =
d358ad94fc212fe30b960134bb1d44455a99d6bf3223095d062d1a7d15d3b649d120de31175f3c4aaac049a903401009795e9d1023c8fbd4a98c6d4ff6bef2d7