diff --git a/basis/math/blas/config/config-docs.factor b/basis/math/blas/config/config-docs.factor index 5c6cef83b8..826f26c646 100644 --- a/basis/math/blas/config/config-docs.factor +++ b/basis/math/blas/config/config-docs.factor @@ -6,20 +6,25 @@ ARTICLE: "math.blas.config" "Configuring the BLAS interface" { $subsections blas-library blas-fortran-abi + deploy-blas? } "The interface attempts to set default values based on the ones encountered on the Factor project's build machines. If these settings don't work with your system's BLAS, or you wish to use a commercial BLAS, you may change the global values of those variables in your " { $link "factor-rc" } ". For example, to use AMD's ACML library on Windows with " { $snippet "math.blas" } ", your " { $snippet "factor-rc" } " would look like this:" { $code """ USING: math.blas.config namespaces ; "X:\\path\\to\\acml.dll" blas-library set-global intel-windows-abi blas-fortran-abi set-global +t deploy-blas? set-global """ } "To take effect, the " { $snippet "blas-library" } " and " { $snippet "blas-fortran-abi" } " variables must be set before any other " { $snippet "math.blas" } " vocabularies are loaded." ; HELP: blas-library -{ $description "The name of the shared library containing the BLAS interface to load. The value of this variable must be a valid shared library name that can be passed to " { $link add-fortran-library } ". To take effect, this variable must be set before any other " { $snippet "math.blas" } " vocabularies are loaded. See " { $link "math.blas.config" } " for details and examples." } ; +{ $var-description "The name of the shared library containing the BLAS interface to load. The value of this variable must be a valid shared library name that can be passed to " { $link add-fortran-library } ". To take effect, this variable must be set before any other " { $snippet "math.blas" } " vocabularies are loaded. See " { $link "math.blas.config" } " for details and examples." } ; HELP: blas-fortran-abi -{ $description "The Fortran ABI used by the BLAS interface specified in the " { $link blas-library } " variable. The value of " { $snippet "blas-fortran-abi" } " must be one of the " { $link "alien.fortran-abis" } " that can be passed to " { $link add-fortran-library } ". To take effect, this variable must be set before any other " { $snippet "math.blas" } " vocabularies are loaded. See " { $link "math.blas.config" } " for details and examples." } ; +{ $var-description "The Fortran ABI used by the BLAS interface specified in the " { $link blas-library } " variable. The value of " { $snippet "blas-fortran-abi" } " must be one of the " { $link "alien.fortran-abis" } " that can be passed to " { $link add-fortran-library } ". To take effect, this variable must be set before any other " { $snippet "math.blas" } " vocabularies are loaded. See " { $link "math.blas.config" } " for details and examples." } ; + +HELP: deploy-blas? +{ $var-description "If set to a true value, the BLAS library will be configured to deploy with applications that use it. To take effect, this variable must be set before any other " { $snippet "math.blas" } " vocabularies are loaded. See " { $link "math.blas.config" } " for details and examples." } ; ABOUT: "math.blas.config" diff --git a/basis/math/blas/config/config.factor b/basis/math/blas/config/config.factor index bce6e663af..76524d80ee 100644 --- a/basis/math/blas/config/config.factor +++ b/basis/math/blas/config/config.factor @@ -1,7 +1,7 @@ USING: alien.fortran combinators kernel namespaces system ; IN: math.blas.config -SYMBOLS: blas-library blas-fortran-abi ; +SYMBOLS: blas-library blas-fortran-abi deploy-blas? ; blas-library [ { @@ -21,3 +21,5 @@ blas-fortran-abi [ [ f2c-abi ] } cond ] initialize + +deploy-blas? [ os macosx? not ] initialize diff --git a/basis/math/blas/ffi/ffi.factor b/basis/math/blas/ffi/ffi.factor index b7748f500f..5cc6a18b6d 100644 --- a/basis/math/blas/ffi/ffi.factor +++ b/basis/math/blas/ffi/ffi.factor @@ -1,9 +1,12 @@ USING: alien.fortran kernel math.blas.config namespaces ; +FROM: alien.libraries => deploy-library ; IN: math.blas.ffi << "blas" blas-library blas-fortran-abi [ get ] bi@ add-fortran-library + +deploy-blas? get [ "blas" deploy-library ] when >> LIBRARY: blas