Ale*_*gur 2 c++ xcode cmake apache-arrow pyarrow
我正在尝试遵循在本地进行构建pyarrow的文档。具体来说,使用conda说明:
conda create -y -n pyarrow-dev -c conda-forge \
--file arrow/ci/conda_env_unix.yml \
--file arrow/ci/conda_env_cpp.yml \
--file arrow/ci/conda_env_python.yml \
compilers \
python=3.7
conda activate pyarrow-dev
export ARROW_HOME=$CONDA_PREFIX
git clone https://github.com/apache/arrow.git
mkdir arrow/cpp/build
pushd arrow/cpp/build
cmake -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
-DCMAKE_INSTALL_LIBDIR=lib \
-DARROW_FLIGHT=ON \
-DARROW_GANDIVA=ON \
-DARROW_ORC=ON \
-DARROW_PARQUET=ON \
-DARROW_PYTHON=ON \
-DARROW_PLASMA=ON \
-DARROW_BUILD_TESTS=ON \
..
Run Code Online (Sandbox Code Playgroud)
该cmake指令失败,并显示以下错误消息:
-- Building using CMake version: 3.12.3
-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_63f1f/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_63f1f.dir/build.make CMakeFiles/cmTC_63f1f.dir/build
Building C object CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o
/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -o CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o -c /Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_63f1f
/usr/local/Cellar/cmake/3.12.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_63f1f.dir/link.txt --verbose=1
/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o -o cmTC_63f1f
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_63f1f] Error 1
make: *** [cmTC_63f1f/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:25 (project)
-- Configuring incomplete, errors occurred!
See also "/Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeOutput.log".
See also "/Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeError.log".
Run Code Online (Sandbox Code Playgroud)
特别是,令人反感的行似乎是:
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
Run Code Online (Sandbox Code Playgroud)
我在macOS Mojave 10.14.4上,并已安装Xcode 10.2.1(通过Apple Developer下载列表)。当我跑步时xcode-select -p我出去了/Applications/Xcode.app/Contents/Developer。
搜索此错误消息使我进入了GH评论,该评论指向该SO答案。我按照该答案中的说明进行了操作,特别是运行sudo xcode-select -s /Applications/Xcode.app/Contents/Developer,但并不能解决问题。
的内容libSystem.tbd是:
-- Building using CMake version: 3.12.3
-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_63f1f/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_63f1f.dir/build.make CMakeFiles/cmTC_63f1f.dir/build
Building C object CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o
/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -o CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o -c /Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_63f1f
/usr/local/Cellar/cmake/3.12.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_63f1f.dir/link.txt --verbose=1
/Users/alex/miniconda3/envs/pyarrow-dev/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs CMakeFiles/cmTC_63f1f.dir/testCCompiler.c.o -o cmTC_63f1f
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_63f1f] Error 1
make: *** [cmTC_63f1f/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:25 (project)
-- Configuring incomplete, errors occurred!
See also "/Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeOutput.log".
See also "/Users/alex/Desktop/arrow/cpp/build/CMakeFiles/CMakeError.log".
Run Code Online (Sandbox Code Playgroud)
我在做什么错,如何修复我的环境,以便可以正确构建CMake?
这里的问题是您缺少使用conda-forge提供的编译器构建的正确OSX SDK。
您需要从https://github.com/phracker/MacOSX-SDKs/releases下载10.9 OSX SDK,并将其解压缩到硬盘驱动器上,例如 /opt/MacOSX10.9.sdk。激活conda环境后,请使用设置此SDK的路径export CONDA_BUILD_SYSROOT=/opt/MacOSX10.9.sdk。