GLPK: No such file or directory error when trying to install R package

前端 未结 8 1821
陌清茗
陌清茗 2020-12-10 04:10

I am trying to install sparkTable in R 3.1.0 which depends on Rglpk. I manually installed GPLK on the system and added the libs folder to LD_

相关标签:
8条回答
  • 2020-12-10 05:11

    I had this problem and took a good bit of digging in the package to understand what was happening. If Rgplk can't compile its test program when installing, it does something weird, including this bizarre cd to nowhere. Assuming glpk-devel is installed, the reason it can't compile the test program is that it can't find the gplk header as it is in a non-standard directory.

    Just set the environment variable CPATH=/usr/include/glpk

    and the test program will compile, allowing the package install to proceed normally.

    0 讨论(0)
  • 2020-12-10 05:13

    You must install glpk dependency first.

    On macOS (via homebrew):

    brew install glpk
    

    or in RStudio (via homebrew):

    system("brew install glpk")
    
    0 讨论(0)
提交回复
热议问题