Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on Apple aarch64 #144

Open
Mankka opened this issue Dec 20, 2024 · 4 comments
Open

Installation fails on Apple aarch64 #144

Mankka opened this issue Dec 20, 2024 · 4 comments

Comments

@Mankka
Copy link

Mankka commented Dec 20, 2024

Installation of sass fails, probably due to wrong or missing header files. Installation of devtools also fails for similar dependency issues (one of them sass). Platform is

R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin24.1.0

See details for first error message. I can investigate further, but I'm not very experienced in R development so I don't know where to start.


> remotes::install_github("rstudio/sass")
Downloading GitHub repo rstudio/sass@HEAD
Running `R CMD build`...
* checking for file ‘/private/var/folders/l0/x1xgt3z53wvbypr79wc0tznm0000gn/T/RtmpNGtseY/remotesf0f66aca1212/rstudio-sass-9228fcf/DESCRIPTION’ ... OK
* preparing ‘sass’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
Removed empty directory ‘sass/scripts’
* building ‘sass_0.4.9.9000.tar.gz’
Installing package into ‘/Users/henrik/Library/R/arm64/4.4/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘sass’ ...
** using staged installation
** libs
/opt/local/Library/Frameworks/R.framework/Resources/share/make/shlib.mk:18: warning: overriding commands for target `shlib-clean'
Makevars:12: warning: ignoring old commands for target `shlib-clean'
using C compiler: ‘clang version 18.1.8’
using C++ compiler: ‘clang version 18.1.8’
using SDK: ‘MacOSX15.2.sdk’
/opt/local/Library/Frameworks/R.framework/Resources/share/make/shlib.mk:18: warning: overriding commands for target `shlib-clean'
Makevars:12: warning: ignoring old commands for target `shlib-clean'
/opt/local/bin/clang-mp-18 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./libsass/include  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk    -fPIC  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64  -c compile.c -o compile.o
/opt/local/bin/clang++-mp-18 -std=gnu++17 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./libsass/include  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk    -fPIC  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64   -c init.cpp -o init.o
MAKEFLAGS= CC="/opt/local/bin/clang-mp-18" CFLAGS="-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 " CXX="/opt/local/bin/clang++-mp-18 -std=gnu++17" AR="ar" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64" make -C libsass
/opt/local/bin/clang-mp-18 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64  -O2 -I ./include  -fPIC -c -o src/cencode.o src/cencode.c
/opt/local/bin/clang++-mp-18 -std=gnu++17 -Wall -O2 -std=c++11 -I ./include  -stdlib=libc++ -fPIC -c -o src/ast.o src/ast.cpp
In file included from src/ast.cpp:3:
In file included from src/sass.hpp:55:
In file included from src/memory.hpp:8:
In file included from src/memory/allocator.hpp:8:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/vector:308:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/__algorithm/copy.h:12:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/__algorithm/copy_move_common.h:18:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/__string/constexpr_c_functions.h:14:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/__memory/construct_at.h:23:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/new:364:
In file included from /opt/local/libexec/llvm-18/bin/../include/c++/v1/cstdlib:87:
/opt/local/libexec/llvm-18/bin/../include/c++/v1/stdlib.h:145:30: error: unknown type name 'ldiv_t'
  145 | inline _LIBCPP_HIDE_FROM_ABI ldiv_t div(long __x, long __y) _NOEXCEPT { return ::ldiv(__x, __y); }
      |                              ^
/opt/local/libexec/llvm-18/bin/../include/c++/v1/stdlib.h:145:82: error: no member named 'ldiv' in the global namespace
  145 | inline _LIBCPP_HIDE_FROM_ABI ldiv_t div(long __x, long __y) _NOEXCEPT { return ::ldiv(__x, __y); }

@Mankka
Copy link
Author

Mankka commented Dec 20, 2024

I noticed that the installation used CFLAGS="-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 " but that there was no corresponding CXXFLAGS. I am not familiar enough with the build process, so I resorted to a hack. I downloaded the source and edited the Makevars file to force it. Now everything works.

Is this an error in the package or the build process?

@gadenbuie
Copy link
Member

Can you share the output of sessioninfo::session_info()? I can't reproduce the issue and I'm on a very similar OS and hardware

─ Session info ──────────────────────────────────────────────
 setting  value
 version  R version 4.4.2 (2024-10-31)
 os       macOS Sequoia 15.1.1
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2024-12-20
 pandoc   3.6 @ /opt/homebrew/bin/pandoc

@Mankka
Copy link
Author

Mankka commented Dec 20, 2024

> sessioninfo::session_info()
─ Session info ─────────
 setting  value
 version  R version 4.4.2 (2024-10-31)
 os       macOS Sequoia 15.2
 system   aarch64, darwin24.1.0
 ui       unknown
 language (EN)
 collate  C
 ctype    UTF-8
 tz       Europe/Helsinki
 date     2024-12-20
 pandoc   NA

─ Packages ───────────
 package     * version date (UTC) lib source
 cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.2)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.2)

 [1] /Users/henrik/Library/R/arm64/4.4/library
 [2] /opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library

──────────────

@Mankka
Copy link
Author

Mankka commented Dec 20, 2024

I think the main issue is the absence of the isysroot for the c++ compiler, but I have no idea of why it wasn't there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants