gcclll / cheng92-comments

comments for https://www.cheng92.com
0 stars 0 forks source link

#error architecture not supported #4

Open BH1SCW opened 3 years ago

BH1SCW commented 3 years ago

Xcode 11.2 Build version 11B52 我的macpro还是Mojave 是版本太老导致的?

> -------- 开始构建 librime.so --------
> 1. installing cmake & git dependencies...
> export RIME_PATH="$LIB"
> 2. begin make -> xcode/thirdparty/boost
make -f xcode.mk thirdparty/boost
./install-boost.sh

RIME_ROOT="$(cd "$(dirname "$0")"; pwd)"
cd "$(dirname "$0")"; pwd
dirname "$0"

boost_version="${boost_version=1.75.0}"
boost_x_y_z="${boost_version//./_}"

BOOST_ROOT="${BOOST_ROOT=${RIME_ROOT}/thirdparty/src/boost_${boost_x_y_z}}"

boost_tarball="boost_${boost_x_y_z}.tar.bz2"
download_url="https://boostorg.jfrog.io/artifactory/main/release/${boost_version}/source/${boost_tarball}"
boost_tarball_sha256sum_1_75_0='953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb  boost_1_75_0.tar.bz2'
boost_tarball_sha256sum="${boost_tarball_sha256sum=${boost_tarball_sha256sum_1_75_0}}"

download_boost_source() {
    cd "${RIME_ROOT}/thirdparty/src"
    if ! [[ -f "${boost_tarball}" ]]; then
        curl -LO "${download_url}"
    fi
    echo "${boost_tarball_sha256sum}" | shasum -a 256 -c
    tar --bzip2 -xf "${boost_tarball}"
    [[ -f "${BOOST_ROOT}/bootstrap.sh" ]]
}

boost_libs="${boost_libs=filesystem,regex,system}"
boost_cxxflags='-arch arm64 -arch x86_64'

build_boost_macos() {
    cd "${BOOST_ROOT}"
    ./bootstrap.sh --with-toolset=clang-darwin --with-libraries="${boost_libs}"
    ./b2 -q -a link=static architecture=combined cxxflags="${boost_cxxflags}" stage
}

if [[ "$OSTYPE" =~ 'darwin' ]]; then
   if ! [[ -f "${BOOST_ROOT}/bootstrap.sh" ]]; then
       download_boost_source
   fi
   build_boost_macos
fi
Building B2 engine..

###
###
### Using 'clang' toolset.
###
###

> clang++ --version
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

###
###

> clang++ -x c++ -std=c++11 -O3 -s -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp filesys.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathsys.cpp regexp.cpp rules.cpp scan.cpp search.cpp jam_strings.cpp startup.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp execunix.cpp fileunix.cpp pathunix.cpp -o b2
ld: warning: option -s is obsolete and being ignored
> cp b2 bjam
tools/build/src/engine/b2
Unicode/ICU support for Boost.Regex?... not found.
Backing up existing B2 configuration in project-config.jam.2
Generating B2 configuration in project-config.jam for clang-darwin...

Bootstrapping is done. To build, run:

    ./b2

To generate header files, run:

    ./b2 headers

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html

   - B2 documentation:
     http://www.boost.org/build/

Performing configuration checks

    - default address-model    : 64-bit
    - default architecture     : none
    - has stat::st_mtim        : no
    - has stat::st_mtimensec   : no
    - has stat::st_mtimespec   : no
    - has stat::st_birthtim    : no
    - has stat::st_birthtimensec : no
    - has stat::st_birthtimespec : no
    - has statx                : no
    - has statx syscall        : no
    - has_icu builds           : no

Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - contract                 : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - fiber                    : not building
    - filesystem               : building
    - graph                    : not building
    - graph_parallel           : not building
    - headers                  : not building
    - iostreams                : not building
    - json                     : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - nowide                   : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : building
    - serialization            : not building
    - stacktrace               : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building

...found 1338 targets...
...updating 63 targets...
boost-install.generate-cmake-config- bin.v2/libs/filesystem/build/stage/boost_filesystem-config.cmake
boost-install.generate-cmake-config-version- bin.v2/libs/filesystem/build/stage/boost_filesystem-config-version.cmake
common.copy /Users/kong/.doom.d/extensions/librime/thirdparty/src/boost_1_75_0/stage/lib/cmake/boost_filesystem-1.75.0/boost_filesystem-config.cmake
common.copy /Users/kong/.doom.d/extensions/librime/thirdparty/src/boost_1_75_0/stage/lib/cmake/boost_filesystem-1.75.0/boost_filesystem-config-version.cmake
common.copy /Users/kong/.doom.d/extensions/librime/thirdparty/src/boost_1_75_0/stage/lib/cmake/BoostDetectToolset-1.75.0.cmake
common.copy /Users/kong/.doom.d/extensions/librime/thirdparty/src/boost_1_75_0/stage/lib/cmake/Boost-1.75.0/BoostConfig.cmake
boost-install.generate-cmake-config-version- bin.v2/tools/boost_install/BoostConfigVersion.cmake
boost-install.generate-cmake-config- bin.v2/libs/headers/build/stage/boost_headers-config.cmake
clang-darwin.compile.c++ bin.v2/libs/filesystem/build/clang-darwin-11.0/release/architecture-combined/link-static/threading-multi/visibility-hidden/windows_file_codecvt.o
In file included from libs/filesystem/src/windows_file_codecvt.cpp:12:
In file included from libs/filesystem/src/platform_config.hpp:81:
In file included from ./boost/filesystem/config.hpp:28:
In file included from ./boost/config.hpp:57:
In file included from ./boost/config/platform/macos.hpp:28:
In file included from ./boost/config/detail/posix_features.hpp:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:32:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from libs/filesystem/src/windows_file_codecvt.cpp:12:
In file included from libs/filesystem/src/platform_config.hpp:81:
In file included from ./boost/filesystem/config.hpp:28:
In file included from ./boost/config.hpp:57:
In file included from ./boost/config/platform/macos.hpp:28:
In file included from ./boost/config/detail/posix_features.hpp:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/unistd.h:71:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported

^

BH1SCW commented 3 years ago

boost_libs="${boost_libs=filesystem,regex,system}" boost_cxxflags='-arch arm64 -arch x86_64'

这个-arch arm64看起来有问题

BH1SCW commented 3 years ago

去掉已经编译过了 不过接下来的配置还是不太明白 eggcaker仓库里的extension 和module直接拷贝过来? 还有一个liberime.so是也需要吗 还是没太搞明白这几个的关系, pyim能调用系统的rime的所有设置和词库吗