Revision
144288
Author
sean@macports.org
Date
2016-01-05 17:13:31 -0800 (Tue, 05 Jan 2016)

Log Message

scalapack: add test phase, openblas, and atlas; fixes #49511

Modified Paths

Diff

Modified: trunk/dports/math/scalapack/Portfile (144287 => 144288)


--- trunk/dports/math/scalapack/Portfile	2016-01-06 00:04:01 UTC (rev 144287)
+++ trunk/dports/math/scalapack/Portfile	2016-01-06 01:13:31 UTC (rev 144288)
@@ -7,6 +7,7 @@
 
 name                scalapack
 version             2.0.2
+revision            1
 categories          math
 platforms           darwin
 maintainers         sean openmaintainer
@@ -29,12 +30,42 @@
 
 configure.args      -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
                     -DBUILD_SHARED_LIBS=ON \
-                    -DBUILD_TESTING=OFF
+                    -DBUILD_TESTING=ON
+# BUILD_TESTING only affects BLACS directory anyway
 
+test.run            yes
+
+pre-test {
+    # test infrastructure uses /bin/ps (I think for checking on job timeout), which is forbidden by sandboxing
+    append portsandbox_profile " (allow process-exec (literal \"/bin/ps\") (with no-profile))"
+}
+
+if {![variant_isset atlas] && ![variant_isset openblas]} {
+    default_variants-append +accelerate
+}
+
+variant accelerate conflicts atlas openblas description {Use built-in Accelerate for BLAS and LAPACK} {
+    depends_lib-append    port:vecLibFort
+    configure.args-append -DLAPACK_LIBRARIES=${prefix}/lib/libvecLibFort.dylib
+}
+
+variant openblas conflicts accelerate atlas description {Use OpenBLAS for BLAS and LAPACK} {
+    # allow OpenBLAS-devel too
+    depends_lib-append    path:lib/libopenblas.dylib:OpenBLAS
+    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
+    configure.args-append -DLAPACK_LIBRARIES=${prefix}/lib/libopenblas.dylib
+}
+
+variant atlas conflicts accelerate openblas description {Use ATLAS for BLAS and LAPACK} {
+    depends_lib-append    port:atlas
+    configure.args-append -DLAPACK_LIBRARIES=${prefix}/lib/libsatlas.dylib
+}
+
 pre-configure {
     configure.args-append \
-                    -DMPI_C_COMPILER=${mpi.cc} \
-                    -DMPI_Fortran_COMPILER=${mpi.fc}
+        -DMPI_C_COMPILER=${mpi.cc} \
+        -DMPI_Fortran_COMPILER=${mpi.fc} \
+        -DMPIEXEC=${prefix}/bin/${mpi.exec}
 }
 
 livecheck.type      regex