clang8.0及以上编译rocks问题
升级了MacOS 10.15 Beta版,结果编译 CockroachDB 遇到了问题。
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/builder.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/column_family.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o
[ %] Building CXX object CMakeFiles/rocksdb.dir/db/compaction.cc.o
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.cc::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compacted_db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/db_impl.h::
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/compaction_job.h::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_BYTES,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_BYTES, // Number of bytes written to WAL
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WAL_FILE_SYNCED,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WAL_FILE_SYNCED, // Number of times WAL sync is done
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
BYTES_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
BYTES_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
NUMBER_KEYS_WRITTEN,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
NUMBER_KEYS_WRITTEN,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_OTHER,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_OTHER, // Equivalent to writes done for others
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_DONE_BY_SELF,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_DONE_BY_SELF,
^
In file included from /usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/builder.cc::
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/internal_stats.h::: error: declaration shadows a variable in namespace 'rocksdb' [-Werror,-Wshadow]
WRITE_WITH_WAL,
^
/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/include/rocksdb/statistics.h::: note: previous declaration is here
WRITE_WITH_WAL, // Number of Write calls that request WAL
^
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/builder.cc.o] Error
gmake[]: *** Waiting for unfinished jobs....
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o] Error
errors generated.
gmake[]: *** [CMakeFiles/rocksdb.dir/build.make:: CMakeFiles/rocksdb.dir/db/column_family.cc.o] Error
gmake[]: *** [CMakeFiles/Makefile2:: CMakeFiles/rocksdb.dir/all] Error
gmake[]: *** [CMakeFiles/Makefile2:: CMakeFiles/rocksdb.dir/rule] Error
gmake[]: *** [Makefile:: rocksdb] Error
gmake[]: *** [Makefile:: /usr/ports/databases/cockroach/work/cockroach-v19.1.1/native/x86_64-unknown-freebsd12./rocksdb/librocksdb.a] Error
gmake[]: Leaving directory '/usr/ports/databases/cockroach/work/cockroach-v19.1.1/src/github.com/cockroachdb/cockroach'
gmake: *** [Makefile:: buildoss] Error
gmake: Leaving directory '/usr/ports/databases/cockroach/work/cockroach-v19.1.1'
*** Error code Stop.
make: stopped in /usr/ports/databases/cockroach
MacOS 使用的 C 语言编译器是 llvm 下的 clang,所有的 gcc 的使用都会被链接到 clang 的使用上。
比如检查 gcc 版本
$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.
Apple clang version 11.0. (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
显示的就是 clang 的版本了。目前我的机器上的 clang 是 11.0.0
出现上面问题的原因是 clang 在8.0版本后对于代码的要求更为严格,有一种特殊的情况被判定为错误,无法正常编译。
报错信息中的 shadow 指的是函数内定义了和传入参数同名的变量,这就是 clang 拒绝的情况。
仔细看报错信息,可以看到这些错误都发生在 rocksdb 文件夹下。到目前为止,rocksdb 都没有要改一下代码的意思,因为又不是不能用。
编译的时候可以加上标签 -Wno-error= 让包含特定信息的错误强行不报错。
更改 /rocksdb/CMakeLists.txt 文件,diff 形式(如果是 CockroachDB 的工程,该文件在 /cockroach/c-deps/ 文件夹下):
option(FAIL_ON_WARNINGS "Treat compile warnings as errors" ON)
if(FAIL_ON_WARNINGS)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
else() # assume GCC
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
endif()
endif()
修改 /rocksdb/Makefile 文件:
ifndef DISABLE_WARNING_AS_ERROR
- WARNING_FLAGS += -Werror
+ WARNING_FLAGS += # -Werror
endif
参考:
Problems building on FreeBSD (with clang 8)
build: compile RocksDB with -Wno-error-shadow
clang8.0及以上编译rocks问题的更多相关文章
- hadoop-1.2.0源码编译
以下为在CentOS-6.4下hadoop-1.2.0源码编译步骤. 1. 安装并且配置ant 下载ant,将ant目录下的bin文件夹加入到PATH变量中. 2. 安装git,安装autoconf, ...
- WebStorm 8.0安装LESS编译环境的教程
WebStorm是一个非常棒的Web前端开发编辑器,被程序猿们成为“最智能的JavaScript IDE”.对HTML5.Bootstrap框架.Node.js等都有完美支持.目前最新版本为WebSt ...
- Hadoop系列(一)hadoop2.2.0源码编译
操作系统:Centos 所需条件:能上网 编译所需工具: apache-ant-1.9.2-bin.tar.gz apache-maven-3.0.5-bin.tar.gz findbugs-2.0. ...
- Qt for Windows:Qt 5.4.0 MinGW 静态编译版本制作 (转)
大致流程: 1.安装Qt(源码版)以及其他必要的环境 2.编译/安装 3.配置 4.使用 ----------正文分割线---------- 1.安装Qt(源码版) 1.1 下载Qt(两个地址二选一即 ...
- Android5.0 Gallery2上编译Gallery模块出错
Android5.0 Gallery2上编译Gallery模块出错 时间:2015-05-05 19:32:57 阅读:105 评论:0 收藏:0 [点我收藏+ ...
- hadoop-2.6.0源码编译问题汇总
在上一篇文章中,介绍了hadoop-2.6.0源码编译的一般流程,因个人计算机环境的不同, 编译过程中难免会出现一些错误,下面是我编译过程中遇到的错误. 列举出来并附上我解决此错误的方法,希望对大家有 ...
- Spark1.0.0 源码编译和部署包生成
问题导读:1.如何对Spark1.0.0源码编译?2.如何生成Spark1.0的部署包?3.如何获取包资源? Spark1.0.0的源码编译和部署包生成,其本质只有两种:Maven和SBT,只不过针对 ...
- Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32'
Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32' 在编译Thrift的时候,无论是Apache官网tar包,还是Github ...
- Spark2.0.0源码编译
Hive默认使用MapReduce作为执行引擎,即Hive on mr,Hive还可以使用Tez和Spark作为其执行引擎,分别为Hive on Tez和Hive on Spark.由于MapRedu ...
随机推荐
- numpy basic sheatsheet
NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库.NumPy 通常与 SciPy(Scien ...
- Bug Bash in Personal Photo Experience 1/11/2016
In the process of our Personal Photo Experience Project, There are some bugs which hinder our forwar ...
- 将函数作为返回值的方法 - Python
有的时候,我们需要将函数作为返回值,以下为代码: def superfunc(): i = 0 def wrapper(): nonlocal i i +=1 return i return wrap ...
- Mac os Pycharm 中使用Stanza进行实体识别(自然语言处理nlp)
stanza 是斯坦福开源Python版nlp库,对自然语言处理有好大的提升,具体好在哪里,官网里面都有介绍,这里就不翻译了.下面放上对应的官网和仓库地址. stanza 官网地址:点击我进入 sta ...
- 高级数据结构---赫(哈)夫曼树及java代码实现
我们经常会用到文件压缩,压缩之后文件会变小,便于传输,使用的时候又将其解压出来.为什么压缩之后会变小,而且压缩和解压也不会出错.赫夫曼编码和赫夫曼树了解一下. 赫夫曼树: 它是一种的叶子结点带有权重的 ...
- 【mybatis annotation】数据层框架应用--Mybatis(二) 基于注解实现数据的CRUD
使用MyBatis框架进行持久层开发 MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架. MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及对结果集的检索. MyBa ...
- shell脚本之awk(一)
运维必备技能 概述: 1.awk是一种编程语言,用于linux/unix下对文本和数据进行扫描.处理数据来源:标准输入.文件.管道. 2.linux中常用的awk编译器版本有mawk,gawk.R ...
- Win10 及 Google 浏览器显示界面异常
win10 和 google 界面显示异常 win10 个别 ui 组件花屏,google 界面直接黑屏 解决方式 更新集成显卡或者重装显卡驱动,最好使用 驱动人生 !!!
- Linux系统管理第三次作业 账号管理 权限及归属管理
1.创建/guanli 目录,在/guanli下创建zonghe 和 jishu 两个目录(一条命令) [root@localhost ~]# mkdir /guanli [root@localhos ...
- jQuery里面click、this事件遇到(Django模型里for)相同的id名和class名想获取值
遇到的原型是这样的!下面我把它简化一下; click事件: 在浏览器里面只能获取横线上面的值,和下面的第一个值!! 这是因为id等级比class高,而且js要求id不能重复! 当 转载于:https: ...