Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用自制软件在Mac OS X上安装libRmath_R_Macos_Homebrew - Fatal编程技术网

使用自制软件在Mac OS X上安装libRmath

使用自制软件在Mac OS X上安装libRmath,r,macos,homebrew,R,Macos,Homebrew,我想在MacOSX(Mavericks)上安装libRmath.dylib,最好使用自制软件,因为我已经使用了这个软件包管理器 我没有找到libRmath的公式,但我确实找到了R的公式,因此我尝试使用以下内容对其进行扩展(请参见末尾的整个文件): 命令/configure;cd src/nmath/standalone;makedo createlibRmath.dylib如果我手动执行它们。但不使用brew安装r。我在Cell中找不到libRmath.dylib。我做错了什么?(请注意,我不熟

我想在MacOSX(Mavericks)上安装
libRmath.dylib
,最好使用自制软件,因为我已经使用了这个软件包管理器

我没有找到
libRmath
的公式,但我确实找到了
R
的公式,因此我尝试使用以下内容对其进行扩展(请参见末尾的整个文件):

命令
/configure;cd src/nmath/standalone;make
do create
libRmath.dylib
如果我手动执行它们。但不使用
brew安装r
。我在
Cell
中找不到
libRmath.dylib
。我做错了什么?(请注意,我不熟悉Ruby和Homebrew的公式。)

下面是整个文件

require 'formula'

class RDownloadStrategy < SubversionDownloadStrategy
  def stage
    quiet_safe_system 'cp', '-r', @clone, Dir.pwd
    Dir.chdir cache_filename
  end
end

class R < Formula
  homepage 'http://www.r-project.org/'
  url 'http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz'
  mirror 'http://cran.r-project.org/src/base/R-3/R-3.1.1.tar.gz'
  sha1 'e974ecc92e49266529e8e791e02a80c75e50b696'

  head do
    url 'https://svn.r-project.org/R/trunk', :using => RDownloadStrategy
    depends_on :tex
  end

  option "without-accelerate", "Build without the Accelerate framework (use Rblas)"
  option 'without-check', 'Skip build-time tests (not recommended)'
  option 'without-tcltk', 'Build without Tcl/Tk'

  depends_on :fortran
  depends_on 'readline'
  depends_on 'gettext'
  depends_on 'libtiff'
  depends_on 'jpeg'
  depends_on 'cairo'
  depends_on :x11 => :recommended
  depends_on 'valgrind' => :optional
  depends_on 'openblas' => :optional

  # This is the same script that Debian packages use.
  resource 'completion' do
    url 'https://rcompletion.googlecode.com/svn-history/r28/trunk/bash_completion/R', :using => :curl
    version 'r28'
    sha1 'af734b8624b33f2245bf88d6782bea0dc5d829a4'
  end

  def install
    args = [
      "--prefix=#{prefix}",
      "--with-aqua",
      "--with-libintl-prefix=#{Formula['gettext'].prefix}",
      "--enable-R-framework",
    ]

    if build.with? 'valgrind'
      args << '--with-valgrind-instrumentation=2'
      ENV.Og
    end

    if build.with? "openblas"
      args << "--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas" << "--with-lapack"
    elsif build.with? "accelerate"
      args << "--with-blas=-framework Accelerate" << "--with-lapack"
      # Fall back to Rblas without-accelerate or -openblas
    end

    args << '--without-tcltk' if build.without? 'tcltk'
    args << '--without-x' if build.without? 'x11'

    # Also add gettext include so that libintl.h can be found when installing packages.
    ENV.append "CPPFLAGS", "-I#{Formula['gettext'].include}"

    # Pull down recommended packages if building from HEAD.
    system './tools/rsync-recommended' if build.head?

    system "./configure", *args
    system "make"
    ENV.deparallelize # Serialized installs, please
    system "make check 2>&1 | tee make-check.log" if build.with? 'check'
    system "make install"

    # Also build libRmath.dylib
    system "cd src/nmath/standalone"
    system "make"
    system "make install"
    system "cd ../../.."
    lib.mkpath
    ln_s prefix+"R.framework/Resources/lib/", lib

    # Link binaries and manpages from the Framework
    # into the normal locations
    bin.mkpath
    man1.mkpath

    ln_s prefix+"R.framework/Resources/bin/R", bin
    ln_s prefix+"R.framework/Resources/bin/Rscript", bin
    ln_s prefix+"R.framework/Resources/man1/R.1", man1
    ln_s prefix+"R.framework/Resources/man1/Rscript.1", man1

    bash_completion.install resource('completion')

    prefix.install 'make-check.log' if build.with? 'check'

  end

  test do
    (testpath / 'test.R').write('print(1+1);')
    system "r < test.R --no-save"
    system "rscript test.R"
  end

  def caveats; <<-EOS.undent
    To enable rJava support, run the following command:
      R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
    EOS
  end
end
需要“公式”
类RDownloadStrategyRDownloadStrategy
取决于:特克斯
结束
选项“无加速”,“无加速框架构建(使用Rblas)”
选项“未经检查”,“跳过构建时测试(不推荐)”
选项“不带Tcl/Tk”、“不带Tcl/Tk的构建”
取决于:fortran
取决于“readline”
取决于“gettext”
取决于“libtiff”
取决于“jpeg”
取决于“开罗”
取决于:x11=>:推荐
取决于“valgrind”=>:可选
取决于“openblas”=>:可选
#这与Debian软件包使用的脚本相同。
资源“完成”do
url'https://rcompletion.googlecode.com/svn-history/r28/trunk/bash_completion/R',:using=>:curl
版本‘r28’
sha1“AF734B8624B33F2245BF88D67822BEA0DC5D829A4”
结束
def安装
args=[
“--前缀=#{prefix}”,
“--含水”,
“--带有libintl前缀=#{Formula['gettext'].prefix}”,
“--启用-R-框架”,
]
“如果你有什么想法?”瓦尔格林'
args现在有一个选项
和librmath only
,它只构建独立的librmath库

require 'formula'

class RDownloadStrategy < SubversionDownloadStrategy
  def stage
    quiet_safe_system 'cp', '-r', @clone, Dir.pwd
    Dir.chdir cache_filename
  end
end

class R < Formula
  homepage 'http://www.r-project.org/'
  url 'http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz'
  mirror 'http://cran.r-project.org/src/base/R-3/R-3.1.1.tar.gz'
  sha1 'e974ecc92e49266529e8e791e02a80c75e50b696'

  head do
    url 'https://svn.r-project.org/R/trunk', :using => RDownloadStrategy
    depends_on :tex
  end

  option "without-accelerate", "Build without the Accelerate framework (use Rblas)"
  option 'without-check', 'Skip build-time tests (not recommended)'
  option 'without-tcltk', 'Build without Tcl/Tk'

  depends_on :fortran
  depends_on 'readline'
  depends_on 'gettext'
  depends_on 'libtiff'
  depends_on 'jpeg'
  depends_on 'cairo'
  depends_on :x11 => :recommended
  depends_on 'valgrind' => :optional
  depends_on 'openblas' => :optional

  # This is the same script that Debian packages use.
  resource 'completion' do
    url 'https://rcompletion.googlecode.com/svn-history/r28/trunk/bash_completion/R', :using => :curl
    version 'r28'
    sha1 'af734b8624b33f2245bf88d6782bea0dc5d829a4'
  end

  def install
    args = [
      "--prefix=#{prefix}",
      "--with-aqua",
      "--with-libintl-prefix=#{Formula['gettext'].prefix}",
      "--enable-R-framework",
    ]

    if build.with? 'valgrind'
      args << '--with-valgrind-instrumentation=2'
      ENV.Og
    end

    if build.with? "openblas"
      args << "--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas" << "--with-lapack"
    elsif build.with? "accelerate"
      args << "--with-blas=-framework Accelerate" << "--with-lapack"
      # Fall back to Rblas without-accelerate or -openblas
    end

    args << '--without-tcltk' if build.without? 'tcltk'
    args << '--without-x' if build.without? 'x11'

    # Also add gettext include so that libintl.h can be found when installing packages.
    ENV.append "CPPFLAGS", "-I#{Formula['gettext'].include}"

    # Pull down recommended packages if building from HEAD.
    system './tools/rsync-recommended' if build.head?

    system "./configure", *args
    system "make"
    ENV.deparallelize # Serialized installs, please
    system "make check 2>&1 | tee make-check.log" if build.with? 'check'
    system "make install"

    # Also build libRmath.dylib
    system "cd src/nmath/standalone"
    system "make"
    system "make install"
    system "cd ../../.."
    lib.mkpath
    ln_s prefix+"R.framework/Resources/lib/", lib

    # Link binaries and manpages from the Framework
    # into the normal locations
    bin.mkpath
    man1.mkpath

    ln_s prefix+"R.framework/Resources/bin/R", bin
    ln_s prefix+"R.framework/Resources/bin/Rscript", bin
    ln_s prefix+"R.framework/Resources/man1/R.1", man1
    ln_s prefix+"R.framework/Resources/man1/Rscript.1", man1

    bash_completion.install resource('completion')

    prefix.install 'make-check.log' if build.with? 'check'

  end

  test do
    (testpath / 'test.R').write('print(1+1);')
    system "r < test.R --no-save"
    system "rscript test.R"
  end

  def caveats; <<-EOS.undent
    To enable rJava support, run the following command:
      R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
    EOS
  end
end