Browse Source

Docs: minor tweaks on linux usage

provider
Christoph Ruegg 13 years ago
parent
commit
7a5f66d23f
  1. 6
      docs/content/MKL.fsx
  2. 32
      docs/content/index.fsx

6
docs/content/MKL.fsx

@ -51,7 +51,7 @@ fetch the MKL package of the right architecture (x64 or x86, `uname -m` if you d
Native assembly resolving is very different on Linux than on Windows, simply putting the native
libraries into the same folder as the executable is not enough. The safe way is to edit `/etc/ld.so.conf`
and use `ldconfig` to tell where to look for the libraries, but for now we'll just copy them to `usr/lib`:
and use `ldconfig` to tell where to look for the libraries, but for now we'll just copy them to `/usr/lib`:
[lang=sh]
sudo cp packages/MathNet.Numerics.MKL.Linux-x64.1.3.0/content/libiomp5.so /usr/lib/
@ -96,10 +96,10 @@ Let's create the following C# file `Example.cs`:
Compile and run:
[lang=sh]
// single line:
# single line:
mcs -optimize -lib:packages/MathNet.Numerics.3.0.0-alpha8/lib/net40/
-r:MathNet.Numerics.dll Example.cs -out:Example
// launch:
# launch:
mono Example

32
docs/content/index.fsx

@ -43,19 +43,22 @@ idiomatic and includes arbitrary precision types (BigInteger, BigRational).
It also works well in the interactive F# environment (REPL) which can be launched with
`fsharpi` on all platforms (including Linux). As a start let's enter the following lines
into F# interactive. Each `;;` will cause the preceding lines to be executed immediately,
use the `Tab` key for auto-completion or `#help;;` for help.
into F# interactive. Append `;;` to the end of a line to run all code up to there
immediately and print the result to the output. Use the tab key for auto-completion or `#help;;` for help.
You may also need to tell F# interactive where to look for assemblies with
the `#I "/some/path"` statement first before you can reference them with the `#r` statements.
[lang=fsharp]
#I "/path/to/referenced/assemblies"
#r "MathNet.Numerics.dll"
#r "MathNet.Numerics.FSharp.dll";;
#r "MathNet.Numerics.FSharp.dll"
open MathNet.Numerics;;
SpecialFunctions.Gamma(0.5);;
open MathNet.Numerics
SpecialFunctions.Gamma(0.5)
open MathNet.Numerics.LinearAlgebra;;
let m : Matrix<float> = DenseMatrix.randomStandard 50 50;;
(m * m.Transpose()).Determinant();;
open MathNet.Numerics.LinearAlgebra
let m : Matrix<float> = DenseMatrix.randomStandard 50 50
(m * m.Transpose()).Determinant()
Using Math.NET Numerics on Linux with Mono
@ -108,16 +111,13 @@ Let's create a C# file `Start.cs`:
}
}
Since we want to use the compiler directly, let's copy all references to the working directory
as well to keep the command line more compact (normally you'd use the -lib argument instead) and compile:
[lang=sh]
cp packages/MathNet.Numerics.3.0.0-alpha8/lib/net40/* .
mcs -optimize -r:MathNet.Numerics.dll Start.cs -out:Start
Run:
Compile and run:
[lang=sh]
# single line:
mcs -optimize -lib:packages/MathNet.Numerics.3.0.0-alpha8/lib/net40/
-r:MathNet.Numerics.dll Start.cs -out:Start
# launch:
mono Start
Which will print something like the following to the output:

Loading…
Cancel
Save