ANTsX / ANTsRCore

Rcpp bindings for the C++ ANTs library used by the ANTsR package
9 stars 9 forks source link

Compilation fails on ARM64 Docker container #156

Open vgonzenbach opened 1 year ago

vgonzenbach commented 1 year ago

Describe the bug Compilation fails for ANTsRCore package when building a Docker image on an Macbook Pro with M1 chip. I'm building natively (no emulation) using this Dockerfile. ANTs and ITKR install/compile successfully, however.

To Reproduce On an M1 Macbook Pro:

git clone https://github.com/vgonzenbach/ANTsRCore-arm64.git
cd ANTsRCore-arm64
docker build -t antsrcore-arm64-debug . &> build.log

Please include output from R docker build:

#11 3356.7 [output clipped, log limit 1MiB reached]
#11 3369.2 /usr/bin/ld: antsImageMutualInformation.o: in function `Rcpp::SlotProxyPolicy<Rcpp::S4_Impl<Rcpp::PreserveStorage> >::slot(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [clone .part.273]':
#11 3369.2 /usr/local/lib/R/library/Rcpp/include/Rcpp/exceptions.h:209:(.text+0x14): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `vtable for Rcpp::not_s4' defined in .data.rel.ro._ZTVN4Rcpp6not_s4E[_ZTVN4Rcpp6not_s4E] section in antsImage.o
#11 3369.2 /usr/bin/ld: /usr/local/lib/R/library/Rcpp/include/Rcpp/exceptions.h:209: warning: too many GOT entries for -fpic, please recompile with -fPIC
#11 3369.2 /usr/bin/ld: final link failed: nonrepresentable section on output
#11 3369.2 collect2: error: ld returned 1 exit status
#11 3369.2 make: *** [/usr/local/lib/R/share/make/shlib.mk:10: ANTsRCore.so] Error 1
#11 3369.3 ERROR: compilation failed for package 'ANTsRCore'
#11 3369.3 * removing '/usr/local/lib/R/library/ANTsRCore'
#11 3370.9 There were 17 warnings (use warnings() to see them)
#11 DONE 3371.1s

Session Info (Container)

sessioninfo::sess
#> - Session info ----------------------------------------------------------------------------------------------------------------------------
#>  setting  value
#>  version  R version 4.2.2 (2022-10-31)
#>  os       Debian GNU/Linux 10 (buster)
#>  system   aarch64, linux-gnu
#>  ui       X11
#>  language (EN)
#>  collate  C
#>  ctype    C
#>  tz       Etc/UTC
#>  date     2023-03-02
#>  pandoc   NA
#> 
#> - Packages --------------------------------------------------------------------------------------------------------------------------------
#>  package     * version date (UTC) lib source
#>  cli           3.6.0   2023-01-09 [1] CRAN (R 4.2.2)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.2)
#> 
#>  [1] /usr/local/lib/R/library
#> 
#> -------------------------------------------------------------------------------------------------------------------------------------------
system.file(package="ITKR")
#> [1] "/usr/local/lib/R/library/ITKR"

Session Info (Local)

session::session_info()
#> ─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>  setting value
#>  version R version 4.2.1 (2022-06-23)
#>  os    macOS Big Sur ... 10.16
#>  system  x86_64, darwin17.0
#>  ui    X11
#>  language (EN)
#>  collate en_US.UTF-8
#>  ctype  en_US.UTF-8
#>  tz    America/New_York
#>  date   2023-03-02
#>  pandoc  2.19.2 @ /usr/local/bin/pandoc
#> ─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#>  package   * version date (UTC) lib source
#>  cli      3.4.1  2022-09-23 [1] CRAN (R 4.2.0)
#>  sessioninfo  1.2.2  2021-12-06 [1] CRAN (R 4.2.0)
#>  [1] /Library/Frameworks/R.framework/Versions/4.2/Resources/library

Desktop Container (please complete the following information):

OS: Debian
gcc 8.3.0-6
cmake 3.24.1
vgonzenbach commented 1 year ago

Hello, I was wondering if anyone has any comments about this issue. Thank you in advance for your time.