Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在apple m2上编译失败, make -j4这一步报错了, matser最新版和3.0.15版本都试了 #280

Open
liaogang opened this issue Jul 4, 2023 · 1 comment

Comments

@liaogang
Copy link

liaogang commented Jul 4, 2023

Tars> cmake --version
cmake version 3.26.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Tars> git clone https://github.com/TarsCloud/TarsCpp.git --recursive
Cloning into 'TarsCpp'...
remote: Enumerating objects: 9129, done.
remote: Counting objects: 100% (864/864), done.
remote: Compressing objects: 100% (380/380), done.
remote: Total 9129 (delta 532), reused 702 (delta 483), pack-reused 8265
Receiving objects: 100% (9129/9129), 21.91 MiB | 543.00 KiB/s, done.
Resolving deltas: 100% (6023/6023), done.
Submodule 'servant/protocol' (https://github.com/TarsCloud/TarsProtocol.git) registered for path 'servant/protocol'
Cloning into '/Users/gang/Tars/TarsCpp/servant/protocol'...
remote: Enumerating objects: 387, done.
remote: Counting objects: 100% (85/85), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 387 (delta 48), reused 55 (delta 24), pack-reused 302
Receiving objects: 100% (387/387), 139.72 KiB | 260.00 KiB/s, done.
Resolving deltas: 100% (215/215), done.
Submodule path 'servant/protocol': checked out 'c1b0f6122921ee01f6660cdd6f2e4ae7d57f879e'
Tars> cd TarsCpp/
TarsCpp> mkdir build;
TarsCpp> cd build;
build> cmake ..
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
----------------------------------------------------
CMAKE_SOURCE_DIR:          /Users/gang/Tars/TarsCpp
CMAKE_BINARY_DIR:          /Users/gang/Tars/TarsCpp/build
PROJECT_SOURCE_DIR:        /Users/gang/Tars/TarsCpp
CMAKE_BUILD_TYPE:          Release
PLATFORM:                  mac
CMAKE_INSTALL_PREFIX:      /usr/local/tars/cpp
BIN:                       /Users/gang/Tars/TarsCpp/build/bin
TARS2CPP:                  /Users/gang/Tars/TarsCpp/build/bin/tars2cpp
ONLY_LIB:                  ON
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:3091 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:4208 (_ep_add_download_command)
  cmake/Thirdparty.cmake:139 (ExternalProject_Add)
  CMakeLists.txt:17 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:3091 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.4/share/cmake/Modules/ExternalProject.cmake:4208 (_ep_add_download_command)
  cmake/Thirdparty.cmake:277 (ExternalProject_Add)
  CMakeLists.txt:17 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

----------------------------------------------------
TARS_MYSQL:                ON
TARS_HTTP2:                OFF
TARS_SSL:                  OFF
TARS_PROTOBUF:             OFF
TARS_GPERF:                OFF
TARS_VERSION:              3.0.15
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
----------------------------------------------------
CMAKE_SYSTEM_NAME:         Darwin
CMAKE_SYSTEM_PROCESSOR:    arm64
CMAKE_CXX_COMPILER_ID:     AppleClang
ABI_STR:                   sysv
BF_STR:                    macho
CPU_STR:                   combined
JUMP_SRC:                  asm/jump_combined_sysv_macho_gas.S
MAKE_SRC:                  asm/make_combined_sysv_macho_gas.S
CMAKE_C_SIZEOF_DATA_PTR:   8
----------------------------------------------------
-- Configuring done (0.6s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/gang/Tars/TarsCpp/build

最后make -j4一步就报这个:

/Users/gang/TarsCpp/build/src/gtest-lib/googlemock/include/gmock/gmock-matchers.h:891:3: error: definition of implicit copy constructor for 'EndsWithMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
  ^
/Users/gang/TarsCpp/build/src/gtest-lib/googletest/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/gang/TarsCpp/build/src/gtest-lib/googletest/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::EndsWithMatcher<std::wstring>' first required here
class PolymorphicMatcher {
      ^
/Users/gang/TarsCpp/build/src/gtest-lib/googlemock/include/gmock/gmock-matchers.h:3908:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::EndsWithMatcher<std::wstring>>' first required here
  return MakePolymorphicMatcher(
         ^
[ 62%] Linking CXX static library ../lib/libgtest_main.a
[ 62%] Built target gtest_main
12 errors generated.
make[5]: *** [googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[4]: *** [googlemock/CMakeFiles/gmock.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [src/ADD_gtest-stamp/ADD_gtest-build] Error 2
make[1]: *** [CMakeFiles/ADD_gtest.dir/all] Error 2
make: *** [all] Error 2
@ruanshudong
Copy link
Contributor

看起来是编译gtest出问题了, 没机器也没法测试, gtest版本兼容gcc方面是有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants