math.blas.config: add deploy-blas? variable

db4
Joe Groff 2010-02-16 13:38:29 -08:00
parent 42089b6586
commit 08a20f9478
3 changed files with 13 additions and 3 deletions

View File

@ -6,20 +6,25 @@ ARTICLE: "math.blas.config" "Configuring the BLAS interface"
{ $subsections { $subsections
blas-library blas-library
blas-fortran-abi 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:" "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 """ { $code """
USING: math.blas.config namespaces ; USING: math.blas.config namespaces ;
"X:\\path\\to\\acml.dll" blas-library set-global "X:\\path\\to\\acml.dll" blas-library set-global
intel-windows-abi blas-fortran-abi 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." "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 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 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" ABOUT: "math.blas.config"

View File

@ -1,7 +1,7 @@
USING: alien.fortran combinators kernel namespaces system ; USING: alien.fortran combinators kernel namespaces system ;
IN: math.blas.config IN: math.blas.config
SYMBOLS: blas-library blas-fortran-abi ; SYMBOLS: blas-library blas-fortran-abi deploy-blas? ;
blas-library [ blas-library [
{ {
@ -21,3 +21,5 @@ blas-fortran-abi [
[ f2c-abi ] [ f2c-abi ]
} cond } cond
] initialize ] initialize
deploy-blas? [ os macosx? not ] initialize

View File

@ -1,9 +1,12 @@
USING: alien.fortran kernel math.blas.config namespaces ; USING: alien.fortran kernel math.blas.config namespaces ;
FROM: alien.libraries => deploy-library ;
IN: math.blas.ffi IN: math.blas.ffi
<< <<
"blas" blas-library blas-fortran-abi [ get ] bi@ "blas" blas-library blas-fortran-abi [ get ] bi@
add-fortran-library add-fortran-library
deploy-blas? get [ "blas" deploy-library ] when
>> >>
LIBRARY: blas LIBRARY: blas