Skip to content

symbol(s) not found for architecture arm64 #218

Closed
@joshua-zh

Description

@joshua-zh

Hi, anybody could help me dealt with these errors?
I have installed RcppParelle from github previously. However, perhaps after I upgrade the llvm, the issue appeared.

remotes::install_github("RcppCore/RcppParallel")
Downloading GitHub repo RcppCore/RcppParallel@HEAD
── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/RtmpHcmCE0/remotes36e41d717cf/RcppCore-RcppParallel-3756f5b/DESCRIPTION’ ...
─  preparing ‘RcppParallel’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts (1.1s)
─  checking for empty or unneeded directories
─  building ‘RcppParallel_5.1.7-9001.tar.gz’
   
* installing *source* package ‘RcppParallel’ ...
** using staged installation
** preparing to configure package 'RcppParallel' ...
*** configured file: 'R/tbb-autodetected.R.in' => 'R/tbb-autodetected.R'
*** configured file: 'src/Makevars.in' => 'src/Makevars'
*** configured file: 'src/install.libs.R.in' => 'src/install.libs.R'
** finished configure for package 'RcppParallel'
** libs
using C++ compiler: ‘Homebrew clang version 18.1.6’
using SDK: ‘MacOSX14.4.sdk’
(tbb) Building TBB using bundled sources ...
OS: macos
arch=arm64
compiler=clang
runtime=ccHomebrew clang version 18.1.6_os14.5
tbb_build_prefix=macos_arm64_clang_ccHomebrew clang version 18.1.6_os14.5
work_dir=/private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/RtmpGMLICG/R.INSTALL44c57b5f424/RcppParallel/src/build/macos_arm64_clang_ccHomebrew /private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/RtmpGMLICG/R.INSTALL44c57b5f424/RcppParallel/src/tbb/src/clang /private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/RtmpGMLICG/R.INSTALL44c57b5f424/RcppParallel/src/tbb/src/version /private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/RtmpGMLICG/R.INSTALL44c57b5f424/RcppParallel/src/tbb/src/18.1.6_os14.5_release
Created ../build/lib_release directory
make -C "../build/lib_release"  -r -f ../../build/Makefile.tbb cfg=release
../../build/Makefile.tbb:28: CONFIG: cfg=release arch=arm64 compiler=clang target=macos runtime=ccHomebrew clang version 18.1.6_os14.5
clang++ -arch arm64 -I../inst/include  -o concurrent_hash_map.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
clang++ -arch arm64 -I../inst/include  -o concurrent_queue.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
clang++ -arch arm64 -I../inst/include  -o concurrent_vector.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_vector.cpp
clang++ -arch arm64 -I../inst/include  -o dynamic_link.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/dynamic_link.cpp
clang++ -arch arm64 -I../inst/include  -o itt_notify.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify.cpp
clang++ -arch arm64 -I../inst/include  -o cache_aligned_allocator.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/cache_aligned_allocator.cpp
clang++ -arch arm64 -I../inst/include  -o pipeline.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/pipeline.cpp
clang++ -arch arm64 -I../inst/include  -o queuing_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o queuing_rw_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_rw_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o reader_writer_lock.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/reader_writer_lock.cpp
clang++ -arch arm64 -I../inst/include  -o spin_rw_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_rw_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o x86_rtm_rw_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/x86_rtm_rw_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o spin_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o critical_section.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/critical_section.cpp
clang++ -arch arm64 -I../inst/include  -o mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/mutex.cpp
clang++ -arch arm64 -I../inst/include  -o recursive_mutex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/recursive_mutex.cpp
clang++ -arch arm64 -I../inst/include  -o condition_variable.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/condition_variable.cpp
clang++ -arch arm64 -I../inst/include  -o tbb_thread.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_thread.cpp
clang++ -arch arm64 -I../inst/include  -o concurrent_monitor.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_monitor.cpp
clang++ -arch arm64 -I../inst/include  -o semaphore.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/semaphore.cpp
clang++ -arch arm64 -I../inst/include  -o private_server.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/private_server.cpp
clang++ -arch arm64 -I../inst/include  -o rml_tbb.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/rml/client/rml_tbb.cpp
sh ../../build/version_info_macos.sh clang++ -arch arm64 -I../inst/include  -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1  -I../../src -I../../src/rml/include -I../../include -I. >version_string.ver
clang++ -arch arm64 -I../inst/include  -o tbb_misc_ex.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc_ex.cpp
clang++ -arch arm64 -I../inst/include  -o task.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task.cpp
clang++ -arch arm64 -I../inst/include  -o task_group_context.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/task_group_context.cpp
clang++ -arch arm64 -I../inst/include  -o governor.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/governor.cpp
clang++ -arch arm64 -I../inst/include  -o market.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/market.cpp
clang++ -arch arm64 -I../inst/include  -o arena.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/arena.cpp
clang++ -arch arm64 -I../inst/include  -o scheduler.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/scheduler.cpp
clang++ -arch arm64 -I../inst/include  -o observer_proxy.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/observer_proxy.cpp
clang++ -arch arm64 -I../inst/include  -o tbb_statistics.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_statistics.cpp
clang++ -arch arm64 -I../inst/include  -o tbb_main.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_main.cpp
sh ../../build/generate_tbbvars.sh DY
clang++ -arch arm64 -I../inst/include  -E -x c++ ../../src/tbb/mac64-tbb-export.def -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1 -I../../src -I../../src/rml/include -I../../include > tbb.def
../../src/tbb/arena.cpp:261:14: warning: variable 'drained' set but not used [-Wunused-but-set-variable]
  261 |     intptr_t drained = 0;
      |              ^
clang++ -arch arm64 -I../inst/include  -o tbb_misc.o -c -MMD -O2 -DUSE_PTHREAD  -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -falign-functions=64 -Wall -g -O2 -DTBB_NO_LEGACY=1   -I../../src -I../../src/rml/include -I../../include -I. ../../src/tbb/tbb_misc.cpp
1 warning generated.
clang++ -arch arm64 -I../inst/include  -fPIC -o libtbb.dylib concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o x86_rtm_rw_mutex.o spin_mutex.o critical_section.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o semaphore.o private_server.o rml_tbb.o tbb_misc.o tbb_misc_ex.o task.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o    -ldl -lpthread -dynamiclib -install_name @rpath/libtbb.dylib -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -Wl,-exported_symbols_list,tbb.def
Undefined symbols for architecture arm64:
  "std::exception_ptr::__from_native_exception_pointer(void*)", referenced from:
      tbb::internal::tbb_exception_ptr::tbb_exception_ptr(tbb::captured_exception const&) in task_group_context.o
  "___cxa_init_primary_exception", referenced from:
      tbb::internal::tbb_exception_ptr::tbb_exception_ptr(tbb::captured_exception const&) in task_group_context.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libtbb.dylib] Error 1
make[1]: *** [tbb_release] Error 2
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include  -I/opt/homebrew/include   -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fPIC  -falign-functions=64 -Wall -g -O2  -c init.cpp -o init.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include  -I/opt/homebrew/include   -std=gnu++11 -DRCPP_PARALLEL_USE_TBB=1 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fPIC  -falign-functions=64 -Wall -g -O2  -c options.cpp -o options.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/homebrew/lib -o RcppParallel.so init.o options.o -Ltbb/build/lib_release -ltbb -Wl,-rpath,@loader_path/../lib -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: reexported library with install name '/opt/homebrew/opt/llvm/lib/libunwind.1.dylib' found at '/opt/homebrew/Cellar/llvm/18.1.6/lib/libunwind.1.0.dylib' couldn't be matched with any parent library and will be linked directly
installing via 'install.libs.R' to /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/00LOCK-RcppParallel/00new/RcppParallel
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RcppParallel’:
 .onLoad failed in loadNamespace() for 'RcppParallel', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/00LOCK-RcppParallel/00new/RcppParallel/libs/RcppParallel.so, 0x0006): symbol not found in flat namespace '__ZN3tbb10interface78internal15task_arena_base24internal_max_concurrencyEPKNS0_10task_arenaE'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppParallel’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppParallel’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T//RtmpHcmCE0/file36e30d4d9a6/RcppParallel_5.1.7-9001.tar.gz’ had non-zero exit status

Activity

kevinushey

kevinushey commented on May 28, 2024

@kevinushey
Contributor

It works for me using the default macOS toolchain. How have you configured R to use your custom LLVM toolchain?

joshua-zh

joshua-zh commented on May 29, 2024

@joshua-zh
Author

This is my zprofile file:

##Run these two commands in your terminal to add Homebrew to your PATH:
  eval "$(/opt/homebrew/bin/brew shellenv)"
  eval "$(/usr/libexec/path_helper)"

##If you need to have llvm first in your PATH, run:
  export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

##For compilers to find homebrew installation
  export LDFLAGS="-L/opt/homebrew/lib"
  export CPPFLAGS="-I/opt/homebrew/include"


##To use the bundled libc++ please add the following LDFLAGS:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++"


##For compilers to find llvm you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"

and the makeconf file:

## C++ compilers
CXX = clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp
CXXFLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXXPICFLAGS = -fPIC
CXX11 = clang++ -arch arm64
CXX11FLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXX11PICFLAGS = -fPIC
CXX11STD = -std=gnu++11
CXX14 = clang++ -arch arm64
CXX14FLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXX14PICFLAGS = -fPIC
CXX14STD = -std=gnu++14
CXX17 = clang++ -arch arm64
CXX17FLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXX17PICFLAGS = -fPIC
CXX17STD = -std=gnu++17
CXX20 = clang++ -arch arm64
CXX20FLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXX20PICFLAGS = -fPIC
CXX20STD = -std=gnu++20
CXX23 = clang++ -arch arm64
CXX23FLAGS = -falign-functions=64 -Wall -g -O2 $(LTO)
CXX23PICFLAGS = -fPIC
CXX23STD = -std=gnu++2b
CXX_VISIBILITY =
kevinushey

kevinushey commented on May 29, 2024

@kevinushey
Contributor
clang++ -arch arm64 -I../inst/include  -fPIC -o libtbb.dylib concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o x86_rtm_rw_mutex.o spin_mutex.o critical_section.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o semaphore.o private_server.o rml_tbb.o tbb_misc.o tbb_misc_ex.o task.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o    -ldl -lpthread -dynamiclib -install_name @rpath/libtbb.dylib -stdlib=libc++ -arch arm64 -mmacosx-version-min=10.11  -Wl,-exported_symbols_list,tbb.def
Undefined symbols for architecture arm64:
  "std::exception_ptr::__from_native_exception_pointer(void*)", referenced from:
      tbb::internal::tbb_exception_ptr::tbb_exception_ptr(tbb::captured_exception const&) in task_group_context.o
  "___cxa_init_primary_exception", referenced from:
      tbb::internal::tbb_exception_ptr::tbb_exception_ptr(tbb::captured_exception const&) in task_group_context.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libtbb.dylib] Error 1
make[1]: *** [tbb_release] Error 2

Sounds like this is could be an issue with your LLVM installation. See e.g.

llvm/llvm-project#86077
llvm/llvm-project#77653

And also:

Homebrew/homebrew-core#169820 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      symbol(s) not found for architecture arm64 · Issue #218 · RcppCore/RcppParallel