简体   繁体   English

编译rstudio-server时出现编译错误?

[英]Compilation error when compiling rstudio-server?

I am trying to compile rstudio-server in Mac OS X 10.11.4 but I am getting some compilation error related to libboost.我正在尝试在 Mac OS X 10.11.4 中编译 rstudio-server 但我遇到了一些与 libboost 相关的编译错误。 Any pointers on how to troubleshoot this?有关如何解决此问题的任何指示?

Note: I had previously installed boost with brew install boost .注意:我之前使用brew install boost

(The build output below is abbreviated) (下面的构建输出是缩写的)

sudo make install gives this: sudo make install给出了这个:

gwtc:
 [java] Compiling module org.rstudio.studio.RStudio
 [java]    Compiling 4 permutations
 [java]       Compiling permutation 0...
 [java]       Process output
 [java]          Compiling
 [java]             Compiling permutation 1...
 [java]          Compiling
 [java]             Compiling permutation 2...
 [java]       Compiling permutation 3...
 [java]    Compile of permutations succeeded
 [java]    Compilation succeeded -- 217.782s
 [java] Linking into Desktop/thingamabob/rstudio/src/gwt/www/rstudio; Writing extras to Desktop/thingamabob/rstudio/src/gwt/extras/rstudio
 [java]    Link succeeded
 [java]    Linking succeeded -- 4.739s

build:

BUILD SUCCESSFUL
Total time: 3 minutes 48 seconds
[ 19%] Built target gwt_build
[ 53%] Built target rstudio-core
[ 57%] Built target rstudio-core-hunspell
[ 58%] Built target rstudio-core-synctex
[ 59%] Built target rstudio-monitor
[ 59%] Built target rstudio-r
[ 59%] Built target rstudio-session-workers
[ 60%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/modules/SessionDependencies.cpp.o
[ 60%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/modules/SessionDiagnostics.cpp.o
[ 60%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/modules/SessionDirty.cpp.o
[ 61%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/modules/SessionErrors.cpp.o

etc...

[ 92%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/modules/SessionCrypto.cpp.o
[ 92%] Building CXX object src/cpp/session/CMakeFiles/rsession.dir/SessionModuleContext.mm.o
make[2]: *** No rule to make target `/opt/rstudio-tools/boost/boost_1_50_0/lib/libboost_date_time.a', needed by `src/cpp/session/rsession'.  Stop.
make[1]: *** [src/cpp/session/CMakeFiles/rsession.dir/all] Error 2
make: *** [all] Error 2

Previous steps之前的步骤

  1. I cloned the github repo ( https://github.com/rstudio/rstudio )我克隆了 github repo ( https://github.com/rstudio/rstudio )
  2. Created the build dir创建构建目录
  3. Ran cmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=OSXcmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=OSX
  4. Fixed those missing deps along the way by running the script install-dependencies-osx (in folder rstudio/dependencies/osx )通过运行脚本install-dependencies-osx (在文件夹rstudio/dependencies/osx )修复了这些缺失的 deps
  5. Now that the configuration was successful I simply ran sudo make install as described above.现在配置成功了,我只需按照上面的描述运行sudo make install

These are the steps I just followed to get RStudio server up and running in OSX.这些是我刚刚在 OSX 中启动并运行 RStudio 服务器的步骤。

Install dependencies安装依赖

  • XCode (or command line tools) XCode(或命令行工具)
  • R from here . R 从这里
  • JDK from here . JDK 从这里开始
  • Install cmake, ant and openssl.安装 cmake、ant 和 openssl。

You can install them with brew:您可以使用 brew 安装它们:

brew install cmake

brew install ant

brew install openssl
  • Clone rstudio github repository.克隆 rstudio github 存储库。

The project will be cloned into a directory called rstudio .该项目将被克隆到名为rstudio的目录中。 This will be ROOT below.这将是下面的 ROOT。

git clone https://github.com/rstudio/rstudio.git
  • Install RStudio dependencies安装 RStudio 依赖项

This will install, among other things, the boost library in /opt.除其他外,这将在 /opt 中安装boost库。

cd rstudio/dependencies/osx
./install-dependencies-osx

Build RStudio server构建 RStudio 服务器

  • Create build directory创建构建目录

(Check the value of ROOT above). (检查上面 ROOT 的值)。

cd ROOT
mkdir build
cd build
  • Configure配置

(check INSTALL file in ROOT directory for options). (检查 ROOT 目录中的 INSTALL 文件以获取选项)。

cmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release
sudo make install

Configure system:配置系统:

  • Copy launchd file to /Library/LaunchDaemon将启动文件复制到 /Library/LaunchDaemon

This will be used to run the rstudio server service.这将用于运行 rstudio 服务器服务。

sudo cp /usr/local/lib/rstudio-server/extras/launchd/com.rstudio.launchd.rserver.plist /Library/LaunchDaemon

NOTE: You can start the service using lanunchctl but I couldn't find the proper way to do it.注意:您可以使用lanunchctl启动该服务,但我找不到正确的方法。 A workaround is to restart your system.解决方法是重新启动系统。

  • Set minimum user id accepted by RStudio设置 RStudio 接受的最小用户 ID

If you cannot log in with your user, it might be that it has a user id < 1000 (like in my case- to check the user id type id in a shell and check the value of uid at the beginning of the output).如果您无法使用您的用户登录,则可能是它的用户 ID < 1000(例如在我的情况下 - 在 shell 中检查用户 ID 类型id并检查输出开头的uid值)。 Then you need to create a directory called rstudio in /etc然后你需要在 /etc 中创建一个名为rstudio的目录

cd /etc
mkdir rstudio
cd rstudio

Then create file named rserver.conf and add the following line, changing 100 by some value >100 and <=your user-id然后创建名为rserver.conf 的文件并添加以下行,将100更改为某个值 >100 和 <=your user-id

auth-minimum-user-id=101

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM