diff options
author | Anton Kudelin | 2022-11-24 16:15:48 +0200 |
---|---|---|
committer | Anton Kudelin | 2022-11-24 16:15:48 +0200 |
commit | f0fdc8fd0f7e8c7b798e963068adb6a050901879 (patch) | |
tree | a2c9d2fb528aceb1ac6e990820b861080decc97f | |
parent | 1694906fb699b30d0e05b525908ca0b784b1eb67 (diff) | |
download | aur-f0fdc8fd0f7e8c7b798e963068adb6a050901879.tar.gz |
sse+cblas patch
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | libcmatrix-3.11.0-sse.patch | 61 |
3 files changed, 88 insertions, 18 deletions
@@ -1,22 +1,24 @@ pkgbase = libcmatrix pkgdesc = A library designed for numerical studies of problems in NMR pkgver = 3.11.0 - pkgrel = 5 - url = https://www.dur.ac.uk/paul.hodgkinson/pNMRsim + pkgrel = 6 + url = https://www.dur.ac.uk/solids.nmr/software/pnmrsim arch = x86_64 license = GPL makedepends = root + makedepends = cblas depends = openmpi source = https://www.dur.ac.uk/paul.hodgkinson/pNMRsim/libcmatrixR3_lite.tar.gz source = libcmatrix-3.11.0-gcc5.2.patch source = libcmatrix-3.11.0-shared.patch source = libcmatrix-3.2.1-gcc4.7.patch source = libcmatrix-3.9.0-atlas.patch + source = libcmatrix-3.11.0-sse.patch sha256sums = 0cd4b1f921235ea64d7fbd8d814fbe639bf9ddb23e4a6d3182cf2788cc23f8b8 sha256sums = 58a1278a8f1323bd201979cdce8ecdc390ce8825f58a1d143264455d5bc0f80c sha256sums = e52c2adb42f5a2836db1e71e4ae2f3235e58bc5c92b04594069548201fd821cf sha256sums = bc4eec9967be3d9ad520d1750abb23f5b6732b8352c7ad61f54c78fb7c9d6312 sha256sums = fc4463ff41d3a691b351f4891bcd2fb3177ce3c04f0f4d2f3d398e5b64c26b0a + sha256sums = 48953cf9a0f4fc5daa65896222e1cdb43126c2c81d19732283bcf88e36aae633 pkgname = libcmatrix - @@ -2,39 +2,43 @@ pkgname=libcmatrix pkgver=3.11.0 -pkgrel=5 +pkgrel=6 pkgdesc="A library designed for numerical studies of problems in NMR" arch=('x86_64') -url="https://www.dur.ac.uk/paul.hodgkinson/pNMRsim" +url="https://www.dur.ac.uk/solids.nmr/software/pnmrsim" license=('GPL') depends=('openmpi') -makedepends=('root') -source=($url/libcmatrixR3_lite.tar.gz +makedepends=('root' 'cblas') +source=(https://www.dur.ac.uk/paul.hodgkinson/pNMRsim/libcmatrixR3_lite.tar.gz $pkgname-3.11.0-gcc5.2.patch $pkgname-3.11.0-shared.patch $pkgname-3.2.1-gcc4.7.patch - $pkgname-3.9.0-atlas.patch) + $pkgname-3.9.0-atlas.patch + $pkgname-3.11.0-sse.patch) sha256sums=('0cd4b1f921235ea64d7fbd8d814fbe639bf9ddb23e4a6d3182cf2788cc23f8b8' '58a1278a8f1323bd201979cdce8ecdc390ce8825f58a1d143264455d5bc0f80c' 'e52c2adb42f5a2836db1e71e4ae2f3235e58bc5c92b04594069548201fd821cf' 'bc4eec9967be3d9ad520d1750abb23f5b6732b8352c7ad61f54c78fb7c9d6312' - 'fc4463ff41d3a691b351f4891bcd2fb3177ce3c04f0f4d2f3d398e5b64c26b0a') + 'fc4463ff41d3a691b351f4891bcd2fb3177ce3c04f0f4d2f3d398e5b64c26b0a' + '48953cf9a0f4fc5daa65896222e1cdb43126c2c81d19732283bcf88e36aae633') prepare() { mv "$srcdir/libcmatrixR3" "$srcdir/$pkgname-$pkgver" cd "$srcdir/$pkgname-$pkgver" + patch -p1 < ../$pkgname-3.11.0-shared.patch patch -p1 < ../$pkgname-3.2.1-gcc4.7.patch patch -p1 < ../$pkgname-3.9.0-atlas.patch patch -p1 < ../$pkgname-3.11.0-gcc5.2.patch - - sed -i -e '/Warnings.h/a\' -e '#include <cstdio>' include/DynamicList.h - sed -i 's#0x80000000#(int)0x80000000#g' include/lcm_ssecomplex.h - sed -i 's#mutable space#space#' NMR/MetaPropagation.cc - sed -i 's#-lMinuit#-lMinuit2#g' configure - sed -i 's#Minuit,main#Minuit2,main#g' configure-libraries.ac - sed -i 's#libMinuit#libMinuit2#g' configure-libraries.ac - sed -i 's#latlas#lblas#g' configure + patch -p1 < ../$pkgname-3.11.0-sse.patch + + autoupdate -f configure-compiler.ac + autoupdate -f configure-libraries.ac + autoupdate -f configure.ac + + AUTOHEADER=true autoreconf -ifv configure.ac + + sed -i 's/latlas/lcblas/g' configure } build() { @@ -46,7 +50,9 @@ build() { --with-minuit \ --with-mpi \ CXX=mpic++ \ - LDFLAGS='-L/usr/lib/root' + ATLAS_CFLAGS='-I/usr/include' \ + ATLAS_LIBS='-lcblas' \ + LDFLAGS='-L/usr/lib -L/usr/lib/root' make } @@ -55,6 +61,7 @@ package() { install -dm 755 "$pkgdir"/usr/{include/libcmatrix,lib} install -m755 include/*.h "$pkgdir/usr/include/libcmatrix" install -m755 lib/libcmatrix.so.$pkgver "$pkgdir/usr/lib" + cd "$pkgdir/usr/lib" ln -sf libcmatrix.so.$pkgver libcmatrix.so.3 ln -sf libcmatrix.so.3 libcmatrix.so diff --git a/libcmatrix-3.11.0-sse.patch b/libcmatrix-3.11.0-sse.patch new file mode 100644 index 000000000000..fa0721fb8691 --- /dev/null +++ b/libcmatrix-3.11.0-sse.patch @@ -0,0 +1,61 @@ +diff --color -Naur a/include/DynamicList.h b/include/DynamicList.h +--- a/include/DynamicList.h 2010-12-04 20:13:35.000000000 +0200 ++++ b/include/DynamicList.h 2022-11-24 13:09:10.524337827 +0200 +@@ -5,6 +5,7 @@ + #include "BaseList.h" + #include "lcm_basethreads.h" + #include "Warnings.h" ++#include <cstdio> + + namespace libcmatrix { + +diff --color -Naur a/include/lcm_ssecomplex.h b/include/lcm_ssecomplex.h +--- a/include/lcm_ssecomplex.h 2011-05-16 12:22:07.000000000 +0300 ++++ b/include/lcm_ssecomplex.h 2022-11-24 13:09:10.527671113 +0200 +@@ -151,7 +151,7 @@ + { + static const union { + int i[4]; ssecomplex_t v; +- } signbithigh = {{0,0,0,0x80000000}}; ++ } signbithigh = {{0,0,0,(int)0x80000000}}; + ssecomplex_t b_im = _mm_shuffle_pd(b,b,3); // Imag. part of b in both + const ssecomplex_t b_re = _mm_shuffle_pd(b,b,0); // Real part of b in both + const ssecomplex_t tmp=_mm_mul_pd(a,b_re); +@@ -166,7 +166,7 @@ + ssecomplex_t b_re = _mm_set1_pd(b); + static const union { + int i[4]; ssecomplex_t v; +- } signbithigh = {{0,0,0,0x80000000}}; ++ } signbithigh = {{0,0,0,(int)0x80000000}}; + b_re = _mm_xor_pd(b_re, signbithigh.v); // Change sign of high + return complex(_mm_mul_pd(a.z_, b_re)); + } +@@ -184,14 +184,14 @@ + inline complex operator- (const complex& a) { + static const union { // (signbit,signbit) + int i[4]; ssecomplex_t v; +- } signbits = {{0,0x80000000,0,0x80000000}}; ++ } signbits = {{0,(int)0x80000000,0,(int)0x80000000}}; + return complex(_mm_xor_pd(a, signbits.v)); // Change sign of both elements + } + + inline complex conj(const complex& a) { + static const union { // (signbit,signbit) + int i[4]; ssecomplex_t v; +- } signbithigh = {{0,0,0,0x80000000}}; ++ } signbithigh = {{0,0,0,(int)0x80000000}}; + return complex(_mm_xor_pd(a.z_, signbithigh.v)); // Change sign of imag. part + } + +diff --color -Naur a/NMR/MetaPropagation.cc b/NMR/MetaPropagation.cc +--- a/NMR/MetaPropagation.cc 2011-04-28 21:37:11.000000000 +0300 ++++ b/NMR/MetaPropagation.cc 2022-11-24 13:09:10.531004401 +0200 +@@ -2289,7 +2289,7 @@ + { ref_.clear(0); } + const space_T& operator()() const { return ref_; } + ~fudge_isotropic_() { ref_.ensure_rank(0); } +- mutable space_T& ref_; ++ space_T& ref_; + }; + template<> struct fudge_isotropic_<double> { + fudge_isotropic_(double v) : v_(v) {}; |