forked from rstudio/rstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
172 lines (115 loc) · 5.87 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
Installing RStudio from Source
=============================================================================
This document describes how to build and install RStudio from the source
distribution. Information on obtaining the RStudio source code can be found
in the file SOURCE. Note that precompiled binaries are also available for
Windows, macOS, as well as recent versions of various Linux distributions.
1) Installing Dependencies
----------------------------------------------------------------------------
Building RStudio requires a number of dependencies (including R itself).
There are platform-specific instructions for satisfying these dependencies
within the following directories
dependencies
linux
osx
windows
Please see the README file contained within the root of each platform's
directory for specific instructions.
2) Configuring the Build Environment
----------------------------------------------------------------------------
a) From the root of the RStudio tree create a build directory and then
change to it:
mkdir build
cd build
b) Configure the build using cmake as appropriate, e.g.
cmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release
cmake .. -DRSTUDIO_TARGET=Electron -DRSTUDIO_PACKAGE_BUILD=1
Variables that control configuration include:
RSTUDIO_TARGET Electron or Server
RSTUDIO_PACKAGE_BUILD Electron: must be set to 1 for following cases:
"make install"
"make-package"
CMAKE_BUILD_TYPE Debug, Release, RelMinSize, or RelWithDebInfo
CMAKE_INSTALL_PREFIX Defaults:
Linux (Electron): /usr/local/lib/rstudio
Linux (Server): /usr/local/lib/rstudio-server
macOS: /Applications/RStudio
Windows: C:\Program Files\RStudio
c) There are additional considerations on Windows. First, RStudio Server
is not supported on Windows so the configuration always defaults to
Electron. Second, you need to add an extra -G parameter to specify the
correct build toolchain, for example:
cmake .. -G "Visual Studio 16 2019" -A Win64 -DCMAKE_BUILD_TYPE=Release
To build on Windows:
cmake --build . --config Release
3) Building and Installing
----------------------------------------------------------------------------
a) Acquire administrative rights (if necessary). If you have configured
RStudio to be installed in a protected directory (the default on all
platforms) then you need to run the build/install command as an
administrator (e.g. "su -", "sudo sh", or running a console as an
Administrator on Windows)
b) Change to the build directory where you configured RStudio
c) Run the "make install" command:
Linux & macOS: sudo make install OR
Windows: cmake --build . --config Release --target install
NOTE: For RStudio Electron on Linux, make install automatically creates
an entry in the Applications -> Programming menu for RStudio.
d) If you are installing RStudio Server some additional configuration
steps are required to complete the installation. These steps are
detailed in the section below.
4) RStudio Server Configuration
----------------------------------------------------------------------------
If you have installed RStudio Server from source there are a number of other
steps (some required, some optional) you should take to complete your
installation. Note that these steps are taken automatically by the DEB
and RPM pre-built binary distributions of RStudio Server.
a) Create an rstudio-server system user account (RStudio will automatically
run under this account if it is present). You can do this with:
sudo useradd -r rstudio-server
b) RStudio Server uses PAM to authenticate users. Some Unix systems (such
as Debian and Ubuntu) use default PAM settings for applications which
aren't explicitly registered with PAM, so don't require additional PAM
configuration. If however your system requires explicit registration
(i.e. Redhat, Fedora, openSUSE) then you need to add an
/etc/pam.d/rstudio file to your configuration. You can find a default
version of this file at:
extras
/pam
rstudio
c) Register RStudio as a daemon using an init.d (for most systems) or
systemd(for Ubuntu from 15.04, RHEL from 7) or upstart (for Ubuntu
before 15.04) or launchd plist (for Mac OSX) script appropriate to your system.
The rstudio/server/extras directory contains the following scripts:
extras
/init.d
/debian
rstudio-server
/redhat
rstudio-server
/suse
rstudio-server
/systemd
rstudio-server.redhat.service
rstudio-server.service
/upstart
rstudio-server.redhat.conf
rstudio-server.conf
/launchd
com.rstudio.launchd.rserver.plist
NOTE: installation of init.d scripts require both copying them
into /etc/init.d, making them executable (chmod +x), as well as
executing a system dependent command to ensure that the service
is registered with the appropriate runlevels. For example:
Debian: sudo update-rc.d rstudio-server defaults
Redhat/SUSE: sudo /sbin/chkconfig --add rstudio-server
d) Create a soft link in /usr/sbin to the server administrative script
sudo ln -f -s /usr/local/lib/rstudio-server/bin/rstudio-server /usr/sbin/rstudio-server
Assuming you have previously installed an init.d or upstart script (as
described above) then you should now be able start the server with the
following command:
sudo rstudio-server start
Additional commands include stop, restart, offline, online, and others
e) Create /var directories required for RStudio to run. This can be done with:
mkdir -p /var/log/rstudio/rstudio-server
mkdir -p /var/lib/rstudio-server