Closed verbus closed 4 years ago
Can you provide more context? Please correct your issue and follow our template. We have no idea what platform you are trying to compile on.
I run into the same issue when trying to build the project in a docker container. I found the compiler is /usr/bin/c++ (it is /usr/local/bin/c++ in your issue) but not clang++ (provided by llvm-8). So, change the compiler to clang++ resolves the problem.
export CC=`which clang-8`
export CXX=`which clang++-8`
// or set them in CMakeLists.txt
set(CMAKE_C_COMPILER "/usr/bin/clang-8")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-8")
[27/116] Building CXX object CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx.o FAILED: CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx.o /usr/local/bin/c++ -DGFLAGS_IS_A_DLL=0 -DNDEBUG -DNOISEPAGE_USE_LOGGING -I../src/include -I_deps/src/count/count/../include -I_deps/src/cppzmq -I_deps/build/gflags/include -I_deps/src/ips4o/ips4o -I_deps/src/ips4o -I_deps/src/madoka -I_deps/src/nlohmann_json/include -I_deps/src/xbyak -isystem /usr/lib/llvm-8/include -isystem _deps/src -isystem _deps/src/spdlog/include -isystem _deps/src/fast_float/include -isystem /usr/include/pgm-5.2 -isystem ../third_party/libpg_query/../src/postgres/include -isystem ../third_party/libpg_query/.. -O3 -DNDEBUG -fPIC -Werror -Wall -march=native -mcx16 -O3 -fdiagnostics-color=always -std=c++17 -MD -MT CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx.o -MF CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx.o.d -o CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx.o -c CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx In file included from ../src/include/common/shared_latch.h:3, from ../src/include/storage/data_table.h:11, from ../src/include/storage/index/index.h:9, from ../src/include/execution/sql/index_iterator.h:9, from ../src/include/execution/vm/bytecode_handlers.h:19, from /tmp/noisepage/src/execution/vm/vm.cpp:9, from CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx:5: /usr/include/tbb/reader_writer_lock.h:21:153: note: ‘#pragma message: TBB Warning: tbb/reader_writer_lock.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’ 21 | #pragma message("TBB Warning: tbb/reader_writer_lock.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.") | ^ In file included from ../src/include/storage/storage_util.h:9, from ../src/include/storage/projected_row.h:8, from ../src/include/execution/sql/storage_interface.h:7, from ../src/include/execution/ast/type.h:10, from /tmp/noisepage/src/execution/vm/llvm_engine.cpp:31, from CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx:3: ../src/include/storage/storage_defs.h: In static member function ‘static noisepage::storage::VarlenEntry noisepage::execution::sql::StringVal::CreateVarlen(const noisepage::execution::sql::StringVal&, bool)’: ../src/include/storage/storage_defs.h:297:12: error: ‘((void)& result +8)’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 297 | return result; | ^
~In file included from /usr/include/stdlib.h:568, from /usr/local/include/c++/10.2.0/bits/std_abs.h:38, from /usr/local/include/c++/10.2.0/cmath:47, from /usr/include/llvm-c-8/llvm-c/DataTypes.h:28, from /usr/include/llvm-c-8/llvm-c/Types.h:17, from /usr/include/llvm-8/llvm/Support/MemoryBuffer.h:17, from ../src/include/execution/vm/llvm_engine.h:3, from /tmp/noisepage/src/execution/vm/llvm_engine.cpp:1, from CMakeFiles/noisepage_objlib.dir/Unity/unity_18_cxx.cxx:3: /tmp/noisepage/src/execution/vm/vm.cpp: In static member function ‘static void noisepage::execution::vm::VM::InvokeFunction(const noisepage::execution::vm::Module, noisepage::execution::vm::FunctionId, const uint8_t)’: /tmp/noisepage/src/execution/vm/vm.cpp:101:40: error: argument to ‘alloca’ may be too large [-Werror=alloca-larger-than=] 101 | raw_frame = static_cast<uint8_t >(alloca(frame_size)); | ^~/tmp/noisepage/src/execution/vm/vm.cpp: In member function ‘const uint8_t noisepage::execution::vm::VM::ExecuteCall(const uint8_t, noisepage::execution::vm::VM::Frame)’: /tmp/noisepage/src/execution/vm/vm.cpp:2600:40: error: argument to ‘alloca’ may be too large [-Werror=alloca-larger-than=] 2600 | raw_frame = static_cast<uint8_t *>(alloca(frame_size)); | ^~cc1plus: all warnings being treated as errors [29/116] Building CXX object CMakeFiles/noisepage_objlib.dir/Unity/unity_16_cxx.cxx.o ninja: build stopped: subcommand failed