【问题标题】:What is the proper way to build archived intel tbb on Mac m1在 Mac m1 上构建存档英特尔 tbb 的正确方法是什么
【发布时间】:2021-12-06 18:15:46
【问题描述】:

最近我一直在尝试为 Mac M1 编译一个较旧的应用程序,到目前为止,我已经成功地编译和链接了除最后一个 TBB 之外的所有要求。

应用程序使用旧版本的 TBB,2019_U9 11009。

这是我在 Mac M1 上使用 gmake 进行的尝试:

oneTBB-2019_U9 ❯ gmake --debug=v
GNU Make 4.3
Built for arm-apple-darwin20.2.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Reading makefile 'build/common.inc' (search path) (no ~ expansion)...
Reading makefile 'build/macos.inc' (search path) (no ~ expansion)...
Updating makefiles....
Updating goal targets....
Considering target file 'default'.
 File 'default' does not exist.
  Considering target file 'tbb'.
   File 'tbb' does not exist.
    Considering target file 'mkdir'.
     File 'mkdir' does not exist.
     Finished prerequisites of target file 'mkdir'.
    Must remake target 'mkdir'.
Created ./build/macos_ia32_clang_cc_os11.3.1_release and ..._debug directories
    Successfully remade target file 'mkdir'.
   Finished prerequisites of target file 'tbb'.
  Must remake target 'tbb'.
gmake -C "./build/macos_ia32_clang_cc_os11.3.1_debug"  -r -f ../../build/Makefile.tbb cfg=debug
GNU Make 4.3
Built for arm-apple-darwin20.2.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile '../../build/Makefile.tbb'...
Reading makefile '../../build/common.inc' (search path) (no ~ expansion)...
Reading makefile '../../build/macos.inc' (search path) (no ~ expansion)...
Reading makefile '../../build/macos.clang.inc' (search path) (no ~ expansion)...
gmake[1]: Entering directory '/Users/trisimix/Hacking/ikos/tbb/oneTBB-2019_U9/build/macos_ia32_clang_cc_os11.3.1_debug'

此时它将挂起几个小时。

这是我使用 make 时发生的情况:

oneTBB-2019_U9 ❯ make
Created ./build/macos_ia32_clang_cc_os11.3.1_release and ..._debug directories
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C "./build/macos_ia32_clang_cc_os11.3.1_debug"  -r -f ../../build/Makefile.tbb cfg=debug
../../build/Makefile.tbb:28: CONFIG: cfg=debug arch=ia32 compiler=clang target=macos runtime=cc_os11.3.1
clang++ -fPIC -o libtbb_debug.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 concurrent_vector_v2.o concurrent_queue_v2.o spin_rw_mutex_v2.o task_v2.o   -ldl -lpthread -dynamiclib -install_name @rpath/libtbb_debug.dylib -stdlib=libc++ -m32 -mmacosx-version-min=10.11  -Wl,-exported_symbols_list,tbb.def
ld: unknown/unsupported architecture name for: -arch armv4t
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libtbb_debug.dylib] Error 1
make: *** [tbb] Error 2

【问题讨论】:

  • 你可以搜索how to build TBB for other ARM architectures (v7, 64?) - 这个错误很可能是因为你的macos不支持armv4t

标签: c gnu-make tbb


【解决方案1】:

你可以试试下面的命令:

make arch=arm64 compiler=clang -j 16 

-->可以通过命令获取“arch”值:

/usr/bin/arch

另外请注意,您需要满足如下所述的系统要求:

使用 OS X* 或 macOS* 操作系统的系统 OS X* 10.11 macOS* 10.12、10.13 仅支持使用 oneTBB2019u9。

【讨论】:

    猜你喜欢
    • 2023-03-25
    • 2021-08-22
    • 2011-10-31
    • 1970-01-01
    • 2021-12-16
    • 2015-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多