Add "-Wredundant-decls" to cblas_interface.cpp to fix build on Kubuntu 24.04. #3460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this change:
[667/849] Compiling C++ object nntrainer/libnntrainer.so.p/_home_michal_code_nntrainer-mw_nntrainer_tensor_cpu_backend_cblas_interface_cblas_interface.cpp.o FAILED: nntrainer/libnntrainer.so.p/_home_michal_code_nntrainer-mw_nntrainer_tensor_cpu_backend_cblas_interface_cblas_interface.cpp.o ccache c++ -Inntrainer/libnntrainer.so.p -Inntrainer -I../nntrainer -Iapi -I../api -I../api/ccapi/include -Inntrainer/compiler -I../nntrainer/compiler -Inntrainer/schema -I../nntrainer/schema -Inntrainer/dataset -I../nntrainer/dataset -Inntrainer/layers/loss -I../nntrainer/layers/loss -Inntrainer/layers -I../nntrainer/layers -Inntrainer/models -I../nntrainer/models -Inntrainer/optimizers -I../nntrainer/optimizers -Inntrainer/tensor/cpu_backend/fallback -I../nntrainer/tensor/cpu_backend/fallback -Inntrainer/tensor/cpu_backend/cblas_interface -I../nntrainer/tensor/cpu_backend/cblas_interface -Inntrainer/tensor/cpu_backend/x86 -I../nntrainer/tensor/cpu_backend/x86 -Inntrainer/tensor/cpu_backend -I../nntrainer/tensor/cpu_backend -Inntrainer/tensor/cl_operations -I../nntrainer/tensor/cl_operations -Inntrainer/tensor -I../nntrainer/tensor -Inntrainer/utils -I../nntrainer/utils -Inntrainer/graph -I../nntrainer/graph -Inntrainer/opencl -I../nntrainer/opencl -Inntrainer/layers/cl_layers -I../nntrainer/layers/cl_layers -I../subprojects/OpenBLAS -I../subprojects/OpenBLAS/build -Isubprojects/ruy -I../subprojects/ruy -I../subprojects/ruy/third_party/cpuinfo/include -I../subprojects/ruy/third_party/cpuinfo/deps/clog/include -I../subprojects/CLBlast/include -I../subprojects/CLBlast/src -I/usr/include -Isubprojects/CLBlast -I../subprojects/CLBlast -I/usr/include/tensorflow2/ -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O3 '-DVERSION="0.6.0"' -DVERSION_MAJOR=0 -DVERSION_MINOR=6 -DVERSION_MICRO=0 -march=native -mavx2 -mfma -Wredundant-decls -Wwrite-strings -Wformat -Wformat-nonliteral -Wformat-security -Winit-self -Waddress -Wvla -Wpointer-arith -Wno-error=varargs -Wno-error=ignored-attributes -Wno-error=sign-compare -ftree-vectorize -Wno-unused-variable -Wno-comment -Wno-ignored-attributes -Wno-sign-compare -Wno-maybe-uninitialized -DMIN_CPP_VERSION=201703L -DENABLE_FP16=1 -DUSE_MMAP=1 -DENABLE_OPENCL=1 -DCL_TARGET_OPENCL_VERSION=200 -DOPENCL_KERNEL_PATH=nntrainer_opencl_kernels -DML_API_COMMON=0 -DUSE_BLAS=1 -DHGEMM_EXPERIMENTAL_KERNEL=false -DNNTR_NUM_THREADS=1 -DOMP_NUM_THREADS=6 -D__LOGGING__=1 -DENABLE_TEST=1 -DREDUCE_TOLERANCE=1 -DENABLE_TFLITE_BACKBONE=1 -DENABLE_TFLITE_INTERPRETER=1 '-DNNTRAINER_CONF_PATH="/usr/local/etc/nntrainer.ini"' -fPIC -pthread -fopenmp -MD -MQ nntrainer/libnntrainer.so.p/_home_michal_code_nntrainer-mw_nntrainer_tensor_cpu_backend_cblas_interface_cblas_interface.cpp.o -MF nntrainer/libnntrainer.so.p/_home_michal_code_nntrainer-mw_nntrainer_tensor_cpu_backend_cblas_interface_cblas_interface.cpp.o.d -o nntrainer/libnntrainer.so.p/_home_michal_code_nntrainer-mw_nntrainer_tensor_cpu_backend_cblas_interface_cblas_interface.cpp.o -c /home/michal/code/nntrainer-mw/nntrainer/tensor/cpu_backend/cblas_interface/cblas_interface.cpp In file included from ../subprojects/OpenBLAS/common.h:543, from ../subprojects/OpenBLAS/cblas.h:5, from /home/michal/code/nntrainer-mw/nntrainer/tensor/cpu_backend/cblas_interface/cblas_interface.cpp:16: ../subprojects/OpenBLAS/common_linux.h:46:17: error: redundant redeclaration of ‘long int syscall(long int, ...)’ in same scope [-Werror=redundant-decls] 46 | extern long int syscall (long int __sysno, ...); | ^~~~~~~ In file included from ../subprojects/OpenBLAS/common.h:87: /usr/include/unistd.h:1091:17: note: previous declaration of ‘long int syscall(long int, ...)’ 1091 | extern long int syscall (long int __sysno, ...) __THROW; | ^~~~~~~ ../subprojects/OpenBLAS/cblas.h:14:6: error: redundant redeclaration of ‘void goto_set_num_threads(int)’ in same scope [-Werror=redundant-decls] 14 | void goto_set_num_threads(int num_threads); | ^~~~~~~~~~~~~~~~~~~~ ../subprojects/OpenBLAS/common.h:695:6: note: previous declaration of ‘void goto_set_num_threads(int)’ 695 | void goto_set_num_threads(int); | ^~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ninja: build stopped: subcommand failed.Self evaluation:
Signed-off-by: mwlasiuk [email protected]