Code Monkey home page Code Monkey logo

Comments (4)

jeanpauphilet avatar jeanpauphilet commented on August 18, 2024 2

Hi,

I had a similar issue recently.
It is likely due to the fact that one of the programs (R or Julia) is not built for the right architecture.

If you are using an M1 Max MacBook Pro, your architecture should be ARM (aarch64 or arm64).
You can check the architecture used by Julia by displaying the value of the Sys.ARCH constant (you should get :aarch64).
You can check the architecture used by R with the R.version command.

Then, you should reinstall any program (R or Julia) that is currently not built for the right architecture, by making sure you download the right installation files.

from rcall.jl.

palday avatar palday commented on August 18, 2024

I think @jeanpauphilet is exactly right.

from rcall.jl.

luboshanus avatar luboshanus commented on August 18, 2024

I still obtain same error as above on M3 MacBook and Julia LTS 1.6.7.

(@v1.6) pkg> st
      Status `~/.julia/environments/v1.6/Project.toml`
...
  [6f49c342] RCall v0.14.1

It works with Julia 1.8.5 and 1.10.2.

But the error is:

(@v1.6) pkg> build
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/51cab8e982c5b598eea9c8ceaced4b58d9dd37c9/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/47ac8cc196b81001a711f4b2c12c97372338f00c/build.log`
    Building RCall ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/846b2aab2d312fda5e7b099fc217c661e8fae27e/build.log`
ERROR: Error building `RCall`: 
ERROR: could not load library "/Library/Frameworks/R.framework/Resources/lib/libR.dylib"
dlopen(/Library/Frameworks/R.framework/Resources/lib/libR.dylib, 0x0001): tried: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
ERROR: LoadError: Try adding /Library/Frameworks/R.framework/Resources/lib to the "LD_LIBRARY_PATH" environmental variable and restarting Julia.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] validate_libR(libR::String)
   @ Main ~/.julia/packages/RCall/dDAVd/deps/setup.jl:26
 [3] top-level scope
   @ ~/.julia/packages/RCall/dDAVd/deps/build.jl:20
 [4] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [5] top-level scope
   @ none:5
in expression starting at /Users/luboshanus/.julia/packages/RCall/dDAVd/deps/build.jl:11

caused by: could not load library "/Library/Frameworks/R.framework/Resources/lib/libR.dylib"
dlopen(/Library/Frameworks/R.framework/Resources/lib/libR.dylib, 0x0001): tried: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:114
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:114 [inlined]
 [3] validate_libR(libR::String)
   @ Main ~/.julia/packages/RCall/dDAVd/deps/setup.jl:16
 [4] top-level scope
   @ ~/.julia/packages/RCall/dDAVd/deps/build.jl:20
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [6] top-level scope
   @ none:5

from rcall.jl.

palday avatar palday commented on August 18, 2024

@luboshanus Julia 1.6 has poor support for Apple silicon -- I suspect you're actually running an x86-64 binary via Rosetta, which would be binary incompatible with linking to a native R build.

from rcall.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.