|
| 1 | +extends: [autotools_package] |
| 2 | + |
| 3 | +dependencies: |
| 4 | + build: [blas, gnu-sed, lapack, mpi] |
| 5 | + |
| 6 | +sources: |
| 7 | +- key: tar.gz:qs6kil25x247lxjlzlvwdhsgbv5tpcye |
| 8 | + url: http://ftp.mcs.anl.gov/pub/petsc/externalpackages/hypre-2.9.1a.tar.gz |
| 9 | + |
| 10 | +defaults: |
| 11 | + # Skip build-time tests (not recommended) |
| 12 | + without_check: false |
| 13 | + # Build with Accelerate framework (on OS X) |
| 14 | + with_accelerate: false |
| 15 | + # Build with OpenBLAS |
| 16 | + with_openblas: false |
| 17 | + # Build with debug flags |
| 18 | + debug: false |
| 19 | + |
| 20 | +build_stages: |
| 21 | +# lib/Makefile treats the hypre internal BLAS & LAPACK implementations |
| 22 | +# as dependencies for libHYPRE.a (the hypre library). When building with |
| 23 | +# an external BLAS library, strip out these dependencies. |
| 24 | +- name: external-BLAS |
| 25 | + before: configure |
| 26 | + handler: bash |
| 27 | + bash: | |
| 28 | + sed -i 's/.*BLASFILES.*//g' src/lib/Makefile |
| 29 | + sed -i 's/.*LAPACKFILES.*//g' src/lib/Makefile |
| 30 | +
|
| 31 | +- name: enter-src-dir |
| 32 | + before: configure |
| 33 | + after: external-BLAS |
| 34 | + handler: bash |
| 35 | + bash: | |
| 36 | + cd src |
| 37 | +
|
| 38 | +- name: set-compiler |
| 39 | + after: prologue |
| 40 | + before: configure |
| 41 | + handler: bash |
| 42 | + bash: | |
| 43 | + export CC=${MPICC} |
| 44 | + export CXX=${MPICXX} |
| 45 | + export F77=${MPIF77} |
| 46 | +
|
| 47 | +- when: with_openblas |
| 48 | + name: configure |
| 49 | + mode: update |
| 50 | + extra: ["--with-blas=yes", |
| 51 | + "--with-blas-libs=openblas", |
| 52 | + "--with-blas-lib-dirs=${BLAS_DIR}/lib", |
| 53 | + "--with-lapack=yes", |
| 54 | + "--with-lapack-libs=openblas", |
| 55 | + "--with-lapack-lib-dirs=${BLAS_DIR}/lib"] |
| 56 | + |
| 57 | +- when: with_accelerate and not with_openblas |
| 58 | +# Libraries used for linking to Accelerate framework; `otool -L` |
| 59 | +# shows that these libraries link to the same dylibs that the |
| 60 | +# Accelerate framework libraries do. Using the |
| 61 | +# "-framework Accelerate" flag would be preferable, but setting |
| 62 | +# CFLAGS, etc. overrides the flags in the Makefile and results |
| 63 | +# in errors. |
| 64 | + name: configure |
| 65 | + mode: update |
| 66 | + extra: ["--with-blas=yes", |
| 67 | + '--with-blas-libs="blas cblas"', |
| 68 | + "--with-blas-lib-dirs=/usr/lib", |
| 69 | + "--with-lapack=yes", |
| 70 | + '--with-lapack-libs="lapack clapack f77lapack"', |
| 71 | + "--with-lapack-lib-dirs=/usr/lib"] |
| 72 | + |
| 73 | +- when: not with_accelerate and not with_openblas |
| 74 | + name: configure |
| 75 | + mode: update |
| 76 | + extra: ["--with-blas=yes", |
| 77 | + '--with-blas-libs=blas', |
| 78 | + "--with-blas-lib-dirs=${BLAS_DIR}/lib", |
| 79 | + "--with-lapack=yes", |
| 80 | + '--with-lapack-libs=lapack', |
| 81 | + "--with-lapack-lib-dirs=${LAPACK_DIR}/lib"] |
| 82 | + |
| 83 | +- when: debug |
| 84 | + name: configure |
| 85 | + mode: update |
| 86 | + extra: ["--enable-debug"] |
| 87 | + |
| 88 | +- when: not fortran |
| 89 | + name: configure |
| 90 | + mode: update |
| 91 | + extra: ["--disable-fortran"] |
| 92 | + |
| 93 | +- name: configure |
| 94 | + mode: update |
| 95 | + extra: ["--with-MPI", |
| 96 | + "--with-MPI-include=${MPI_DIR}/include", |
| 97 | + "--with-MPI-lib-dirs=${MPI_DIR}/lib", |
| 98 | +# MPI library strings for linking depends on compilers |
| 99 | +# enabled. Only the C library strings are needed (without the |
| 100 | +# lib), because hypre is a C library. |
| 101 | + '--with-MPI-lib="mpi"'] |
| 102 | + |
| 103 | +- name: configure |
| 104 | + mode: update |
| 105 | + extra: ["--without-babel", |
| 106 | + "--without-mli", |
| 107 | + "--without-fei", |
| 108 | + "--without-superlu"] |
| 109 | + |
| 110 | +- when: platform != 'Darwin' |
| 111 | + name: configure |
| 112 | + mode: update |
| 113 | + extra: ["--enable-shared"] |
| 114 | + |
| 115 | +- when: platform == 'linux' |
| 116 | + name: rpath-fix |
| 117 | + after: install |
| 118 | + handler: bash |
| 119 | + bash: | |
| 120 | + oldRPath=$(${PATCHELF} --print-rpath ${ARTIFACT}/lib/libHYPRE.so) |
| 121 | + ${PATCHELF} --set-rpath ${oldRPath}:${ARTIFACT}/lib:${BLAS_DIR}/lib:${LAPACK_DIR}/lib:${MPI_DIR}/lib ${ARTIFACT}/lib/libHYPRE.so |
| 122 | +
|
| 123 | +- when: platform != 'linux' |
| 124 | + name: rpath-fix |
| 125 | + after: install |
| 126 | + handler: bash |
| 127 | + bash: | |
| 128 | +
|
| 129 | +- when: not without_check and platform == 'linux' |
| 130 | + name: check |
| 131 | + after: rpath-fix |
| 132 | + handler: bash |
| 133 | + bash: | |
| 134 | + make check |
| 135 | + make test |
| 136 | + ${PATCHELF} --set-rpath ${ARTIFACT}/lib:${BLAS_DIR}/lib:${LAPACK_DIR}/lib:${MPI_DIR}/lib test/ij |
| 137 | + ${PATCHELF} --set-rpath ${ARTIFACT}/lib:${BLAS_DIR}/lib:${LAPACK_DIR}/lib:${MPI_DIR}/lib test/struct |
| 138 | + ${PATCHELF} --set-rpath ${ARTIFACT}/lib:${BLAS_DIR}/lib:${LAPACK_DIR}/lib:${MPI_DIR}/lib test/sstruct |
| 139 | + ./test/ij |
| 140 | + ./test/struct |
| 141 | + ./test/sstruct -in test/sstruct.in.default -solver 40 -rhsone |
| 142 | +
|
| 143 | +- when: not without_check and platform != 'linux' |
| 144 | + name: check |
| 145 | + after: rpath-fix |
| 146 | + handler: bash |
| 147 | + bash: | |
| 148 | + make check |
| 149 | + make test |
| 150 | + ./test/ij |
| 151 | + ./test/struct |
| 152 | + ./test/sstruct -in test/sstruct.in.default -solver 40 -rhsone |
| 153 | +
|
| 154 | +- when: without_check |
| 155 | + name: check |
| 156 | + after: rpath-fix |
| 157 | + handler: bash |
| 158 | + bash: | |
| 159 | +
|
| 160 | +- name: caveats |
| 161 | + after: check |
| 162 | + handler: bash |
| 163 | + bash: | |
| 164 | + echo "Please register for hypre at:" |
| 165 | + echo |
| 166 | + echo "https://computation.llnl.gov/project/linear_solvers/download/hypre-2.9.0b_reg.php" |
0 commit comments