Last active
November 24, 2018 05:50
-
-
Save yutannihilation/ff3bbdf9de37ccb59963792cbd741eae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 参考: | |
# - https://github.com/rwinlib/arrow | |
# - https://github.com/apache/arrow/blob/master/cpp/apidoc/Windows.md#building-using-visual-studio-msvc-solution-files | |
# Update packages | |
pacman -Syu | |
pacman -Su | |
# Use Rtools | |
export CC=/c/Rtools/mingw_64/bin/gcc | |
export CXX=/c/Rtools/mingw_64/bin/g++ | |
# Build Boost --------------------------------------------- | |
# Install ICU | |
pacman -Sy mingw-w64-x86_64-icu | |
# Get source | |
mkdir /tmp/boost && cd /tmp/boost | |
wget -O - https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz | tar -x -z -f - | |
cd boost_1_68_0/ | |
# NOTE: "prefix" is not a path inside MSYS, but the one prefixed w/ "C:". | |
# "--prefix=/msys64/mingw64" will install to C:/msys64/mimgw64 | |
./bootstrap.sh --prefix=/msys64/mingw64 --with-libraries=regex,filesystem,system | |
# -a: to disable cache | |
# ICU_LINK: pacman's ICU doesn't match the Boost.build's expectation, so we need to specify this by ourselves | |
./b2 \ | |
-a \ | |
-j4 \ | |
define=_GLIBCXX_USE_CXX11_ABI=0 \ | |
include=/msys64/mingw64/include \ | |
-sICU_LINK="-licuuc -licudt -licuin" \ | |
link=shared \ | |
variant=release \ | |
address-model=64 \ | |
install headers | |
# Build Apache Arrow -------------------------------- | |
# install cmake | |
pacman -Sy mingw-w64-x86_64-cmake | |
# Get the source | |
mkdir /tmp/arrow && cd /tmp/arrow | |
wget -O - http://archive.apache.org/dist/arrow/arrow-0.11.0/apache-arrow-0.11.0.tar.gz | tar -x -z -f - | |
cd ./apache-arrow-0.11.0/cpp | |
vim cmake_modules/SetupCxxFlags.cmake | |
# Insert these lines (c.f. https://github.com/rwinlib/arrow/blob/be4a2cf133fea1b4649e77b872f22508b3d89939/arrow.patch#L22-L24) | |
# | |
# if(WIN32) | |
# add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) | |
# set_target_properties(your_target PROPERTIES POSITION_INDEPENDENT_CODE OFF) | |
# endif(WIN32) | |
mkdir build && cd build | |
# Specify the full path of cmake to make sure the MINGW's cmake will be used | |
/c/msys64/mingw64/bin/cmake.exe -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. \ | |
-DARROW_BUILD_TESTS=FALSE \ | |
-DARROW_WITH_SNAPPY=FALSE \ | |
-DARROW_WITH_ZSTD=FALSE \ | |
-DARROW_WITH_LZ4=FALSE \ | |
-DARROW_JEMALLOC=FALSE \ | |
-DARROW_BUILD_STATIC=TRUE \ | |
-DARROW_BOOST_VENDORED=FALSE \ | |
-DARROW_BOOST_USE_SHARED=FALSE \ | |
-DARROW_WITH_ZLIB=FALSE \ | |
-DARROW_WITH_BROTLI=FALSE \ | |
-DCMAKE_GENERATOR_PLATFORM=x64 | |
/c/msys64/mingw64/bin/cmake.exe --build . --config Release |
$ grep -R -- -Werror .
./flatbuffers_ep-prefix/src/flatbuffers_ep/CMakeLists.txt: set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Wno-unused-parameter")
./flatbuffers_ep-prefix/src/flatbuffers_ep/CMakeLists.txt: "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
./flatbuffers_ep-prefix/src/flatbuffers_ep/CMakeLists.txt: "${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter")
./flatbuffers_ep-prefix/src/flatbuffers_ep/CMakeLists.txt: "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Wno-unused-parameter")
./flatbuffers_ep-prefix/src/flatbuffers_ep-build/CMakeFiles/flatbuffers.dir/flags.make:CXX_FLAGS = -fPIC -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter -fsigned-char -O3 -DNDEBUG -O3 -DNDEBUG -fPIC
./flatbuffers_ep-prefix/src/flatbuffers_ep-build/CMakeFiles/flatc.dir/build.make: /C/Rtools/mingw_64/bin/g++.exe -fPIC -std=c++0x -Wall -pedantic -Werror-Wextra -Werror=shadow -Wunused-result -Werror=unused-result -Wunused-parameter-Werror=unused-parameter -fsigned-char -O3 -DNDEBUG -O3 -DNDEBUG -fPIC -Wl,--whole-archive CMakeFiles/flatc.dir/objects.a -Wl,--no-whole-archive -o flatc.exe -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
./flatbuffers_ep-prefix/src/flatbuffers_ep-build/CMakeFiles/flatc.dir/flags.make:CXX_FLAGS = -fPIC -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter -fsigned-char -O3 -DNDEBUG -O3 -DNDEBUG -fPIC
./flatbuffers_ep-prefix/src/flatbuffers_ep-build/CMakeFiles/flathash.dir/build.make: /C/Rtools/mingw_64/bin/g++.exe -fPIC -std=c++0x -Wall -pedantic -Werror-Wextra -Werror=shadow -Wunused-result -Werror=unused-result -Wunused-parameter-Werror=unused-parameter -fsigned-char -O3 -DNDEBUG -O3 -DNDEBUG -fPIC -Wl,--whole-archive CMakeFiles/flathash.dir/objects.a -Wl,--no-whole-archive -o flathash.exe -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32-lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
./flatbuffers_ep-prefix/src/flatbuffers_ep-build/CMakeFiles/flathash.dir/flags.make:CXX_FLAGS = -fPIC -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow-Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter -fsigned-char -O3 -DNDEBUG -O3 -DNDEBUG -fPIC
./flatbuffers_ep-prefix/src/flatbuffers_ep-stamp/flatbuffers_ep-build-err.log:C:/msys64/tmp/arrow/apache-arrow-0.11.0/cpp/build/flatbuffers_ep-prefix/src/flatbuffers_ep/src/code_generators.cpp:1:0: error: -fPIC ignored for target (all codeis position independent) [-Werror]
$ grep failed build.log
...failed gcc.link.dll bin.v2\libs\system\build\gcc-8.2.0\release\address-model-32\threading-multi\libboost_system-mgw82-mt-x32-1_68.dll.a bin.v2\libs\system\build\gcc-8.2.0\release\address-model-32\threading-multi\libboost_system-mgw82-mt-x32-1_68.dll...
...failed gcc.link.dll bin.v2\libs\regex\build\gcc-8.2.0\release\address-model-32\threading-multi\libboost_regex-mgw82-mt-x32-1_68.dll.a bin.v2\libs\regex\build\gcc-8.2.0\release\address-model-32\threading-multi\libboost_regex-mgw82-mt-x32-1_68.dll...
...failed updating 4 targets...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
g++.exe: error: unrecognized command line option '-maltivec'