Tencent / mars

Mars is a cross-platform network component developed by WeChat.
Other
17.31k stars 3.63k forks source link

win10 本地编译xlog报错,有很多同样的问题,望解决下 #998

Open nimingangle520 opened 2 years ago

nimingangle520 commented 2 years ago

D:\huang\projects\mars-master\mars>Python build_android.py Enter menu:

  1. Clean && build mars.
  2. Build incrementally mars.
  3. Clean && build xlog.
  4. Exit 3 ndk path:D:\Sdk\ndk\22.0.7026061 [[==BUILD_DESCRIPTION==]]Revision:                   
    PublicComponent
    KEYVALUE
    Branch
    BuildTag
    BuildTime2021-12-22 14:01:32
    Revision
    build cmd:cmake "D:\huang\projects\mars-master\mars" -G "Unix Makefiles" -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=D:\Sdk\ndk\22.0.7026061/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DANDROID_NDK=D:\Sdk\ndk\22.0.7026061 -DANDROID_PLATFORM=android-21 -DANDROID_STL="c++_shared" && cmake --build . --target libzstd_static marsxlog --config Release -- -j8 -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- The C compiler identification is Clang 11.0.5 -- The CXX compiler identification is Clang 11.0.5 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: D:/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - 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: D:/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- ==============config comm==================== -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config mars-boost==================== -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: D:/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config app==================== -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config baseevent==================== -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config xlog==================== -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config sdt==================== -- CMAKE_INSTALL_PREFIX=D:/huang/projects/mars-master/mars/cmake_build/Android -- ==============config stn==================== CMake Warning (dev) at D:/CMake/share/cmake-3.22/Modules/GNUInstallDirs.cmake:239 (message): Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. Please enable at least one language before including GNUInstallDirs. Call Stack (most recent call first): CMakeLists.txt:21 (include) This warning is for project developers. Use -Wno-dev to suppress it.

-- ==============config mars==================== -- Configuring done -- Generating done -- Build files have been written to: D:/huang/projects/mars-master/mars/cmake_build/Android [ 0%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/debug.c.o [ 6%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/entropy_common.c.o [ 6%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/error_private.c.o [ 12%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/fse_decompress.c.o [ 12%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/pool.c.o [ 18%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/threading.c.o [ 18%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/xxhash.c.o [ 25%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/common/zstd_common.c.o [ 25%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/fse_compress.c.o [ 31%] Building C object zstd/CMakeFiles/libzstd_static.dir///__/lib/compress/hist.c.o [ 31%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/huf_compress.c.o [ 37%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_compress.c.o [ 37%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_compress_literals.c.o [ 43%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_compress_sequences.c.o [ 43%] Building C object zstd/CMakeFiles/libzstd_static.dir///__/lib/compress/zstd_double_fast.c.o [ 50%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_fast.c.o [ 50%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_lazy.c.o [ 56%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_ldm.c.o [ 56%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstd_opt.c.o [ 62%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/compress/zstdmt_compress.c.o [ 62%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/decompress/huf_decompress.c.o [ 68%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/decompress/zstd_ddict.c.o [ 68%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/decompress/zstd_decompress.c.o [ 75%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/decompress/zstd_decompress_block.c.o [ 75%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/dictBuilder/cover.c.o [ 81%] Building C object zstd/CMakeFiles/libzstd_static.dir///__/lib/dictBuilder/divsufsort.c.o [ 81%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/dictBuilder/fastcover.c.o [ 87%] Building C object zstd/CMakeFiles/libzstd_static.dir///__/lib/dictBuilder/zdict.c.o [ 87%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/deprecated/zbuff_common.c.o [ 93%] Building C object zstd/CMakeFiles/libzstd_static.dir////lib/deprecated/zbuff_compress.c.o [ 93%] Building C object zstd/CMakeFiles/libzstd_static.dir///__/lib/deprecated/zbuff_decompress.c.o [100%] Linking C static library libzstd.a [100%] Built target libzstd_static Scanning dependencies of target mars-boost Consolidate compiler generated dependencies of target libzstd_static [ 0%] Building C object comm/CMakeFiles/comm.dir/adler32.c.o [ 1%] Building CXX object comm/CMakeFiles/comm.dir/alarm.cc.o [ 1%] Building CXX object comm/CMakeFiles/comm.dir/anr.cc.o [ 1%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/atomic/src/lockpool.cpp.o [ 2%] Building CXX object comm/CMakeFiles/comm.dir/autobuffer.cc.o [ 4%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/date_time/src/gregorian/date_generators.cpp.o [ 5%] Building CXX object xlog/CMakeFiles/xlog.dir/src/appender.cc.o [ 29%] Built target libzstd_static [ 29%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/date_time/src/gregorian/gregorian_types.cpp.o [ 29%] Building CXX object xlog/CMakeFiles/xlog.dir/src/formater.cc.o [ 31%] Building CXX object xlog/CMakeFiles/xlog.dir/src/log_base_buffer.cc.o [ 31%] Building CXX object comm/CMakeFiles/comm.dir/basepacker.cc.o [ 31%] Building CXX object xlog/CMakeFiles/xlog.dir/src/log_zlib_buffer.cc.o [ 32%] Building CXX object comm/CMakeFiles/comm.dir/boost_exception.cc.o [ 34%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/date_time/src/gregorian/greg_month.cpp.o In file included from D:/huang/projects/mars-master/mars/log/src/appender.cc:52: In file included from D:/huang/projects/mars-master/mars/log/..\boost/iostreams/device/mapped_file.hpp:20: In file included from D:/huang/projects/mars-master/mars/log/..\boost/iostreams/close.hpp:19: In file included from D:/huang/projects/mars-master/mars/log/..\boost/iostreams/detail/adapter/non_blocking_adapter.hpp:13: D:/huang/projects/mars-master/mars/log/..\boost/iostreams/seek.hpp:86:20: error: result of comparison 'mars_boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-type-limit-compare] off > integer_traits::const_max ) )


D:/huang/projects/mars-master/mars/log/..\boost/iostreams/seek.hpp:85:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false
      [-Werror,-Wtautological-type-limit-compare]
             ( off < integer_traits<std::streamoff>::const_min ||
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/huang/projects/mars-master/mars/log/..\boost/iostreams/seek.hpp:113:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false
      [-Werror,-Wtautological-type-limit-compare]
               off > integer_traits<std::streamoff>::const_max ) )
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/huang/projects/mars-master/mars/log/..\boost/iostreams/seek.hpp:112:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false
      [-Werror,-Wtautological-type-limit-compare]
             ( off < integer_traits<std::streamoff>::const_min ||
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 34%] Building CXX object comm/CMakeFiles/comm.dir/comm_frequency_limit.cc.o
[ 34%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/date_time/src/gregorian/greg_weekday.cpp.o
[ 35%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/date_time/src/posix_time/posix_time_types.cpp.o
[ 35%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/exception/src/clone_current_exception_non_intrusive.cpp.o
4 errors generated.
make[3]: *** [xlog/CMakeFiles/xlog.dir/build.make:76: xlog/CMakeFiles/xlog.dir/src/appender.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 37%] Building CXX object xlog/CMakeFiles/xlog.dir/src/log_zstd_buffer.cc.o
[ 38%] Building CXX object comm/CMakeFiles/comm.dir/http.cc.o
[ 40%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/codecvt_error_category.cpp.o
[ 40%] Building CXX object comm/CMakeFiles/comm.dir/memdbg.cc.o
[ 40%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/operations.cpp.o
[ 41%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/path.cpp.o
[ 43%] Building CXX object comm/CMakeFiles/comm.dir/mmap_util.cc.o
make[2]: *** [CMakeFiles/Makefile2:398: xlog/CMakeFiles/xlog.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 43%] Building CXX object comm/CMakeFiles/comm.dir/ptrbuffer.cc.o
[ 43%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/path_traits.cpp.o
[ 44%] Building CXX object comm/CMakeFiles/comm.dir/singleton.cc.o
[ 44%] Building CXX object comm/CMakeFiles/comm.dir/strutil.cc.o
D:/huang/projects/mars-master/mars/boost/libs/filesystem/src/operations.cpp:2081:18: warning: 'readdir_r' is deprecated:
      readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations]
      { return ::readdir_r(dirp, entry, result); }
                 ^
D:/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include\dirent.h:132:92: note: 'readdir_r'
      has been explicitly marked deprecated here
int readdir_r(DIR* __dir, struct dirent* __entry, struct dirent** __buffer) __attribute__((__deprecated__("readd...
                                                                                           ^
In file included from D:/huang/projects/mars-master/mars/comm/mmap_util.cc:20:
In file included from D:/huang/projects/mars-master/mars/comm/./mmap_util.h:23:
In file included from D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/device/mapped_file.hpp:20:
In file included from D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/close.hpp:19:
In file included from D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/detail/adapter/non_blocking_adapter.hpp:13:
D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/seek.hpp:86:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false
      [-Werror,-Wtautological-type-limit-compare]
               off > integer_traits<std::streamoff>::const_max ) )
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/seek.hpp:85:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false
      [-Werror,-Wtautological-type-limit-compare]
             ( off < integer_traits<std::streamoff>::const_min ||
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/seek.hpp:113:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false
      [-Werror,-Wtautological-type-limit-compare]
               off > integer_traits<std::streamoff>::const_max ) )
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/huang/projects/mars-master/mars/comm/..\boost/iostreams/seek.hpp:112:20: error: result of comparison
      'mars_boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false
      [-Werror,-Wtautological-type-limit-compare]
             ( off < integer_traits<std::streamoff>::const_min ||
               ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 46%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/portability.cpp.o
[ 46%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/unique_path.cpp.o
4 errors generated.
make[3]: *** [comm/CMakeFiles/comm.dir/build.make:202: comm/CMakeFiles/comm.dir/mmap_util.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 47%] Building CXX object comm/CMakeFiles/comm.dir/tickcount.cc.o
[ 49%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/utf8_codecvt_facet.cpp.o
[ 49%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/filesystem/src/windows_file_codecvt.cpp.o
1 warning generated.
[ 50%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/iostreams/src/file_descriptor.cpp.o
[ 50%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/iostreams/src/mapped_file.cpp.o
[ 52%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/smart_ptr/src/sp_collector.cpp.o
[ 52%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/smart_ptr/src/sp_debug_hooks.cpp.o
[ 53%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/system/src/error_code.cpp.o
[ 53%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/thread/src/future.cpp.o
[ 55%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/context/src/execution_context.cpp.o
[ 55%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/context/src/posix/stack_traits.cpp.o
make[2]: *** [CMakeFiles/Makefile2:294: comm/CMakeFiles/comm.dir/all] Error 2
[ 56%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/coroutine/src/detail/coroutine_context.cpp.o
[ 56%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/coroutine/src/exceptions.cpp.o
[ 58%] Building CXX object boost/CMakeFiles/mars-boost.dir/libs/coroutine/src/posix/stack_traits.cpp.o
[ 58%] Building ASM object boost/CMakeFiles/mars-boost.dir/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S.o
[ 59%] Building ASM object boost/CMakeFiles/mars-boost.dir/libs/context/src/asm/make_arm64_aapcs_elf_gas.S.o
[ 59%] Linking CXX static library libmars-boost.a
[ 59%] Built target mars-boost
make[1]: *** [CMakeFiles/Makefile2:241: CMakeFiles/marsxlog.dir/rule] Error 2
make: *** [Makefile:169: marsxlog] Error 2
!!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!
nimingangle520 commented 2 years ago

Tags v1.3.0 可以编译通过 master分支不行

Dovar66 commented 2 years ago

ndk换成r20b版本

sunchun2zzf commented 11 months ago

D:\GDC\mars\mars(master -> origin) λ python3 build_android.py Enter menu:

  1. Clean && build mars.
  2. Build incrementally mars.
  3. Clean && build xlog.
  4. Exit 3 ndk path:C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\android-ndk-r20b [[==BUILD_DESCRIPTION==]]Revision: 8dd8b01e                   
    PublicComponent
    KEYVALUE
    Branchmaster
    BuildTag
    BuildTime2023-11-30 15:43:05
    Revision8dd8b01e
    build cmd:cmake "D:\GDC\mars\mars" -G "Unix Makefiles" -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\android-ndk-r20b/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DANDROID_NDK=C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\android-ndk-r20b -DANDROID_PLATFORM=android-21 -DANDROID_STL="c++_shared" && cmake --build . --target libzstd_static marsxlog --config Release -- -j8 -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- Check for working C compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- Check for working CXX compiler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- ==============config comm==================== -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config mars-boost==================== -- The ASM compiler identification is Clang -- Found assembler: C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config app==================== -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config baseevent==================== -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config xlog==================== -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config sdt==================== -- CMAKE_INSTALL_PREFIX=D:/GDC/mars/mars/cmake_build/Android -- ==============config stn==================== -- ==============config mars==================== CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: log-lib linked by target "marsxlog" in directory D:/GDC/mars/mars linked by target "marsstn" in directory D:/GDC/mars/mars

-- Configuring incomplete, errors occurred! See also "D:/GDC/mars/mars/cmake_build/Android/CMakeFiles/CMakeOutput.log". !!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!

大佬们,我这个报错是啥原因了?