forked from oseledets/TT-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 3
/
INSTALL
54 lines (48 loc) · 2.71 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
1 Setting path
Use the script setup.m in this directory.
It will add all subfolders to the MATLAB path automatically.
2. Compiling the MEX libraries
In order to accelerate some slow MATLAB routines (like gmres),
the TT-Toolbox contains their alternatives in C and FORTRAN, located in fmex/.
Moreover, the tt_read/tt_write modules allow to read/save a tt_tensor from/to the special SVD file.
If you have a Linux/Mac OS machine, you probably don't need to recompile the binaries already included.
In addition, all algorithms (eg. als_adapt_solve) can be parametrized to use the MATLAB codes only
(see help of a certain routine, if it claims on absent/bad MEX module).
However, on some other architectures, and if you would like to use your own compiler/LAPACK/etc,
proceed as follows.
As soon as you have just cloned/downloaded the TT-Toolbox, fmex/ contains an empty directory tt-fort/.
This is for our another repository https://github.com/oseledets/tt-fort, containing some FORTRAN and C
codes for TT algebra, etc.
Please pull it as a GIT submodule: staying in the TT-Toolbox directory, invoke
git submodule init
git submodule update
Now, create new files named Makefile.cpu in both fmex/ and fmex/tt-fort/.
These files should contain one line:
CPU = your_cpu_alias
where "your_cpu_alias" shall be one of possible variants from Makefile.in
### Important ###
1) There are separate Makefile.in and Makefile.cpu in fmex/ and fmex/tt-fort
2) In fmex/tt-fort, you must choose a preset depending on your machine:
with 8-byte integers on a x64 system: i8-gnu or i8-intel, and
with 4-byte integers on a x32 system: i4-gnu or i4-intel
################
You may take any of our presets (eg. "default") given in Makefile.in,
or write your own, naming the variables (CC, COPT and so on) similarly to the existing aliases.
A reasonable idea is to start from the example Makefile.cpu.default files (for x64 systems),
or Makefile.cpu.default32 (for x32 systems)
You may invoke
cp Makefile.cpu.default Makefile.cpu
staying in fmex/ and fmex/tt-fort/ directories.
For x64 systems, please make sure that 8-byte integers are used, i.e. the parameters -fdefault-integer-8 for
gfortran or -i8 for Intel are passed in the compiler options.
After that, run make in fmex/.
The library mytt.a will be built in tt-fort/ automatically, followed by the MEX files in fmex/.
The whole sequence of commands for the default x64 GNU compilation thus may be as follows:
git submodule init
git submodule update
cd fmex/tt-fort
cp Makefile.cpu.default Makefile.cpu
cd ../
cp Makefile.cpu.default Makefile.cpu
make
On a x32 machine, replace Makefile.cpu.default by Makefile.cpu.default32 in the commands above.