forked from getspams/spams-R
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL-package
105 lines (83 loc) · 3.57 KB
/
INSTALL-package
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
This directory contains files to build the R interfaces
to the functions of SPAMS library already interfaced with matlab.
WARNING : the API of spams.OMP and spams.OMPMask has changed since version V2.2
##################################################
```
tar zxf spams-R-v2.6-2017-03-22.tar.gz
cd spams-R
rlib=install-directory
export R_LIBS=$rlib
R CMD INSTALL --html -l $R_LIBS spams
```
This should work on linux and MacOS. For windows see below.
However, if you have undefined symbols, you can add extra libraries
by modifying, in spams/src/Makevars the line
EXTRA_LIBS=
# tests
Note : to run test_TrainDL and test_TrainDL_Memory you need the R package png
(a version of this package can be found in the current directory).
We suppose that environment variable R_LIBS is set:
```
cd $R_LIB/spams/inst/test
Rscript test_spams.R -help
Rscript test_spams.R
```
Warning : for now the R interface is missing a little subset of the functions
described in the documentation of SPAMS.
# Notes:
As the C++ interface is built by Swig, I must add
dummy documentations for 3 class S4 methods
(I could not avoid warnings in R CMD check).
If you have a version of R lower than 2.13, there will remain
one warning with R CMD check, because SHLIB_OPENMP_CXXFLAGS must
be manually defined.
##################################################
Installing on macOS:
====================
I have tested it on macosx-10 64bits, kernel 10.8.0 :
I have installed R with popt, and added /opt/local/bin to my PATH
and "R CMD INSTALL" worked fine,
but I had to redefine TMPDIR (export TMPDIR=/var/tmp)
Special thanks to Karthikeyan Natesan Ramamurthy for his report about issues
he encountered on MAC OSX Yosemite:
{
the installer could not figure out the library paths for gfortran and quadmath.
... this is common issue with recent versions of MAC OSX, and we may have to install gfortran from https://gcc.gnu.org/wiki/GFortranBinaries (or some other place), and add soft links like this:
sudo ln -s /usr/local/gfortran/lib/libgfortran.* /usr/local/lib/
sudo ln -s /usr/local/gfortran/lib/libquadmath.* /usr/local/lib/
}
Installing on windows :
======================
On a 32bits windowssystem:
-------------------------
you need MinGW (www.mingw.org)
and GnuWin32 zip (http://gnuwin32.sourceforge.net/packages/zip.htm)
To build a binary package :
- open a MinGW console and extract files from the tar source package (tar zxf ....)
- enter directory spams-R
- execute win-build.sh
You will obtain spams-R-v2.6-2017-03-22.win32.exe (and spams_2.6.zip)
The .exe contains the .zip will automatically the module in R.
On a 64bits windows system :
---------------------------
you will build a package for 32 and 64 bits systems.
You need to install
MinGW (www.mingw.org)
and mingw64 (http://sourceforge.net/projects/mingw-w64/files)
and GnuWin32 zip (http://gnuwin32.sourceforge.net/packages/zip.htm)
and GnuWin32 unzip (http://gnuwin32.sourceforge.net/packages/unzip.htm)
- open a MinGW console as admin
(right click on the icon and select "Execute as admin")
- extract files from tar file
- cd spams-R
./win-build.sh
You will obtain spams-R-v2.6-2017-03-22.win32+amd64.exe (and spams_2.6.zip)
which contains 32 and 64 bits versions
Note : the .exe file will only install the R module corresponding
to the architecture of the system.
To manually install the binary package:
=======================================
- in R gui, select "install package from file" in menu "Packages"
- or start R and type
install.packages('spams-installation-path/spams_2.6.zip',repos=NULL)
NB: on windows7, you must execute R as admin.