Skip to content

Conversation

mwlasiuk
Copy link
Contributor

@mwlasiuk mwlasiuk commented Sep 5, 2025

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:

  1. Build test: [X]Passed [ ]Failed [ ]Skipped
  2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: mwlasiuk [email protected]

@mwlasiuk mwlasiuk marked this pull request as draft September 5, 2025 06:52
@mwlasiuk mwlasiuk marked this pull request as ready for review September 8, 2025 05:24
@mwlasiuk mwlasiuk changed the title Add "-Wredundant-decls" to cblas_interface.cpp to fix build on Kubuntu 24.04 Add "-Wredundant-decls" to cblas_interface.cpp to fix build on Kubuntu 24.04. Sep 9, 2025
@mwlasiuk mwlasiuk force-pushed the mw/fix/kubuntu branch 3 times, most recently from e8d1f6c to 753b4cc Compare September 16, 2025 08:16
Copy link
Contributor

@EunjuYang EunjuYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- fix build on kubuntu-24.04

Signed-off-by: mwlasiuk <[email protected]>
Copy link
Member

@skykongkong8 skykongkong8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants