Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] ADD_LIBRARY cannot create target "memory" because another target with the same name already exists between xnnpack and absl #21441

Open
OAHLSTM opened this issue Jul 22, 2024 · 2 comments
Labels
build build issues; typically submitted using template ep:Xnnpack issues related to XNNPACK EP stale issues that have not been addressed in a while; categorized by a bot

Comments

@OAHLSTM
Copy link

OAHLSTM commented Jul 22, 2024

Describe the issue

I am trying to build onnxruntime 1.18.0 for a Linux distribution using Yocto Bitbake but conflicts arise due to duplication of target memory from XNNPACK and ABSEIL. It says that CMAKE is unable to create a target called "memory" for the XNNPACK dependency since there is another target with the same name for ABSL.

Urgency

I am unable to cross-compile Onnxruntime 1.18.0 for my target, so this is blocking. Any help would be appreciated !

Target platform

aarch64

Build script

Here are the options that I'm


EXTRA_OECMAKE += "    -DCMAKE_BUILD_TYPE=Release \
		      -DCMAKE_INSTALL_PREFIX="${prefix}" \
		      -DABSL_ENABLE_INSTALL=ON \
		      -DFETCHCONTENT_FULLY_DISCONNECTED=OFF \
		      -Donnxruntime_BUILD_SHARED_LIB=ON \
		      -Donnxruntime_BUILD_BENCHMARKS=ON \
		      -DCMAKE_PREFIX_PATH="${STAGING_LIBDIR};${STAGING_INCDIR};${STAGING_INCDIR}/${PYTHON_DIR}" \
		      -DONNX_CUSTOM_PROTOC_EXECUTABLE="${WORKDIR}/protoc-${PROTOC_VERSION}/bin/protoc" \
		      -Donnxruntime_PREFER_SYSTEM_LIB=OFF \
		      -Donnxruntime_ENABLE_PYTHON=ON \
		      -DPYTHON_EXECUTABLE="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" \
		      -DPython_EXECUTABLE="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" \
		      -DPYTHON_LIBRARY="${STAGING_LIBDIR}" \
		      -DPython_NumPy_INCLUDE_DIR="${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include" \
		      -Dpybind11_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}/pybind11" \
		      -DONNXRUNTIME_VERSION_MAJOR=${MAJOR}  \
		      -DBENCHMARK_ENABLE_GTEST_TESTS=OFF \
		      -Donnxruntime_USE_XNNPACK=ON \
		      -Donnxruntime_BUILD_UNIT_TESTS=OFF \
"

Error / output

| -- ******** Summary ********
| --   CMake version                     : 3.26.4
| --   CMake command                     :  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native/usr/bin/cmake
| --   System                            : Linux
| --   C++ compiler                      :  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native/usr/bin/aarch64-ostl-linux/aarch64-ostl-linux-g++
| --   C++ compiler version              : 12.3.0
| --   CXX flags                         :  -mcpu=cortex-a35 -march=armv8-a+crc -mbranch-protection=standard  --sysroot= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -Wno-restrict  -DCPUINFO_SUPPORTED -Wnon-virtual-dtor
| --   Build type                        : Release
| --   Compile definitions               : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;_GNU_SOURCE;__STDC_FORMAT_MACROS
| --   CMAKE_PREFIX_PATH                 :  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/lib; onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/include; onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/include/python3.11
| --   CMAKE_INSTALL_PREFIX              : /usr
| --   CMAKE_MODULE_PATH                 :  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/share/cmake/Modules/; onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/share/cmake/Modules/; onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git/cmake/external
| --
| --   ONNX version                      : 1.16.0
| --   ONNX NAMESPACE                    : onnx
| --   ONNX_USE_LITE_PROTO               : ON
| --   USE_PROTOBUF_SHARED_LIBS          : OFF
| --   Protobuf_USE_STATIC_LIBS          : ON
| --   ONNX_DISABLE_EXCEPTIONS           : OFF
| --   ONNX_DISABLE_STATIC_REGISTRATION  : OFF
| --   ONNX_WERROR                       : OFF
| --   ONNX_BUILD_TESTS                  : OFF
| --   ONNX_BUILD_BENCHMARKS             : OFF
| --   ONNX_BUILD_SHARED_LIBS            :
| --   BUILD_SHARED_LIBS                 : OFF
| --
| --   Protobuf compiler                 :
| --   Protobuf includes                 :
| --   Protobuf libraries                :
| --   BUILD_ONNX_PYTHON                 : OFF
| CMake Error at  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/googlexnnpack-src/CMakeLists.txt:508 (ADD_LIBRARY):
|   ADD_LIBRARY cannot create target "memory" because another target with the
|   same name already exists.  The existing target is an interface library
|   created in source directory
|   " onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/abseil_cpp-src/absl/memory".
|   See documentation for policy CMP0002 for more details.
| 
| 
| CMake Error at  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/googlexnnpack-src/CMakeLists.txt:530 (TARGET_LINK_LIBRARIES):
|   INTERFACE library can only be used with the INTERFACE keyword of
|   target_link_libraries
| 
| 
| CMake Error at  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/googlexnnpack-src/CMakeLists.txt:733 (TARGET_COMPILE_DEFINITIONS):
|   TARGET_COMPILE_DEFINITIONS may only set INTERFACE properties on INTERFACE
|   targets
| 
| 
| CMake Error at  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/googlexnnpack-src/CMakeLists.txt:818 (TARGET_INCLUDE_DIRECTORIES):
|   TARGET_INCLUDE_DIRECTORIES may only set INTERFACE properties on INTERFACE
|   targets
| 
| 
| CMake Error at  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build/_deps/googlexnnpack-src/CMakeLists.txt:903 (TARGET_LINK_LIBRARIES):
|   INTERFACE library can only be used with the INTERFACE keyword of
|   target_link_libraries
| 
| 
| Finished fetching external dependencies
| -- Performing Test HAS_AMBIGUOUS_REVERSED_OPERATOR
| -- Performing Test HAS_AMBIGUOUS_REVERSED_OPERATOR - Failed
| -- Performing Test HAS_BITWISE_INSTEAD_OF_LOGICAL
| -- Performing Test HAS_BITWISE_INSTEAD_OF_LOGICAL - Failed
| -- Performing Test HAS_CAST_FUNCTION_TYPE
| -- Performing Test HAS_CAST_FUNCTION_TYPE - Success
| -- Performing Test HAS_CATCH_VALUE
| -- Performing Test HAS_CATCH_VALUE - Success
| -- Performing Test HAS_CLASS_MEMACCESS
| -- Performing Test HAS_CLASS_MEMACCESS - Success
| -- Performing Test HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION
| -- Performing Test HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION - Failed
| -- Performing Test HAS_DEPRECATED_BUILTINS
| -- Performing Test HAS_DEPRECATED_BUILTINS - Failed
| -- Performing Test HAS_DEPRECATED_COPY
| -- Performing Test HAS_DEPRECATED_COPY - Success
| -- Performing Test HAS_DEPRECATED_DECLARATIONS
| -- Performing Test HAS_DEPRECATED_DECLARATIONS - Success
| -- Performing Test HAS_ENUM_CONSTEXPR_CONVERSION
| -- Performing Test HAS_ENUM_CONSTEXPR_CONVERSION - Failed
| -- Performing Test HAS_FORMAT_TRUNCATION
| -- Performing Test HAS_FORMAT_TRUNCATION - Success
| -- Performing Test HAS_IGNORED_ATTRIBUTES
| -- Performing Test HAS_IGNORED_ATTRIBUTES - Success
| -- Performing Test HAS_MAYBE_UNINITIALIZED
| -- Performing Test HAS_MAYBE_UNINITIALIZED - Success
| -- Performing Test HAS_MISSING_BRACES
| -- Performing Test HAS_MISSING_BRACES - Success
| -- Performing Test HAS_NONNULL_COMPARE
| -- Performing Test HAS_NONNULL_COMPARE - Success
| -- Performing Test HAS_PARENTHESES
| -- Performing Test HAS_PARENTHESES - Success
| -- Performing Test HAS_SHORTEN_64_TO_32
| -- Performing Test HAS_SHORTEN_64_TO_32 - Failed
| -- Performing Test HAS_STRICT_ALIASING
| -- Performing Test HAS_STRICT_ALIASING - Success
| NVCC_ERROR =
| NVCC_OUT = No such file or directory
| -- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE
| -- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE - Failed
| -- Performing Test HAS_UNDEFINED_VAR_TEMPLATE
| -- Performing Test HAS_UNDEFINED_VAR_TEMPLATE - Failed
| -- Performing Test HAS_UNUSED_BUT_SET_PARAMETER
| -- Performing Test HAS_UNUSED_BUT_SET_PARAMETER - Success
| -- Performing Test HAS_UNUSED_BUT_SET_VARIABLE
| -- Performing Test HAS_UNUSED_BUT_SET_VARIABLE - Success
| -- Performing Test HAS_UNUSED_VARIABLE
| -- Performing Test HAS_UNUSED_VARIABLE - Success
| -- Performing Test HAS_USELESS_CAST
| -- Performing Test HAS_USELESS_CAST - Success
| -- Performing Test HAS_STRINGOP_OVERFLOW
| -- Performing Test HAS_STRINGOP_OVERFLOW - Success
| -- Looking for reallocarray
| -- Looking for reallocarray - found
| -- Performing Test HAS_ARM64_BFLOAT16
| -- Performing Test HAS_ARM64_BFLOAT16 - Success
| -- Performing Test HAS_ARM64_FLOAT16
| -- Performing Test HAS_ARM64_FLOAT16 - Success
| CMake Warning at CMakeLists.txt:1620 (message):
|   MPI and NCCL are disabled because build is on Windows or USE_NCCL is set to
|   OFF.
| 
| 
| -- Looking for clock_gettime in rt
| -- Looking for clock_gettime in rt - found
| -- Python Build is enabled
| CMAKE_C_FLAGS:   -march=armv8-a+crc -mbranch-protection=standard  --sysroot= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native=  -ffunction-sections -fdata-sections -Wno-restrict
| CMAKE_ASM_FLAGS:   -march=armv8-a+crc -mbranch-protection=standard  --sysroot= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native=
| CMAKE_CXX_FLAGS:   -march=armv8-a+crc -mbranch-protection=standard  --sysroot= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/git=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/build=/usr/src/debug/onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fmacro-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot=  -fdebug-prefix-map= onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -Wno-restrict  -DCPUINFO_SUPPORTED
| -- Performing Test HAS_FLTO
| -- Performing Test HAS_FLTO - Success
| -- Found pybind11:  onnxruntime/1.18.0+gitAUTOINC+45737400a2-r0/recipe-sysroot/usr/include (found version "")
| ONNXRUNTIME_VERSION_MAJOR=1
| -- Configuring incomplete, errors occurred!

Visual Studio Version

No response

GCC / Compiler Version

No response

@OAHLSTM OAHLSTM added the build build issues; typically submitted using template label Jul 22, 2024
@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Jul 22, 2024
@skottmckay
Copy link
Contributor

Does the build work when run directly using build.sh? That uses tools/ci_build/build.py which sets and validates the build parameters.

We build on Linux in many CIs without an issue, so first step would be to demonstrate that 'Yocto Bitbake' is not the problem.

@sophies927 sophies927 added ep:Xnnpack issues related to XNNPACK EP and removed platform:windows issues related to the Windows platform labels Jul 25, 2024
Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template ep:Xnnpack issues related to XNNPACK EP stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants