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] Build error after version v1.17.0. #22213

Closed
Tc511 opened this issue Sep 25, 2024 · 3 comments
Closed

[Build] Build error after version v1.17.0. #22213

Tc511 opened this issue Sep 25, 2024 · 3 comments
Labels
build build issues; typically submitted using template

Comments

@Tc511
Copy link

Tc511 commented Sep 25, 2024

Describe the issue

When i try to build onnxruntime after v1.17.0, i meet two bugs.
The first is
"error C1189: #error: The C++ Standard Library forbids macroizing the keyword "bool"."
I solved this problem by adding "add_definitions(-D_XKEYCHECK_H)" to cmakelist.txt;

The second one is here.
No information was given as to where the problem was.

It is worth noting that this bug will not be encountered when building before the version v1.17.0. But there is another bug, which is the same in issue #18077.

Urgency

No response

Target platform

Windows 10

Build script

.\build.bat --config Release --parallel --skip_tests --skip_submodule_sync

Error / output


>  utils.cc
>   activations.cc
>   utils.cc
>   element_wise_ops.cc
>   layer_norm.cc
>   grid_sample.cc
>   unique.cc
>   activations.cc
>   element_wise_ops.cc
>   grid_sample.cc
>   layer_norm.cc
>   unique.cc
>   onnxruntime_providers.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\onnxruntime_providers.lib
> Traceback (most recent call last):
>   File "D:\onnxruntime_1_17_0\onnxruntime\\tools\ci_build\build.py", line 2887, in <module>
>     sys.exit(main())
>              ^^^^^^
>   File "D:\onnxruntime_1_17_0\onnxruntime\\tools\ci_build\build.py", line 2779, in main
>     build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
>   File "D:\onnxruntime_1_17_0\onnxruntime\\tools\ci_build\build.py", line 1659, in build_targets
>     run_subprocess(cmd_args, env=env)
>   File "D:\onnxruntime_1_17_0\onnxruntime\\tools\ci_build\build.py", line 839, in run_subprocess
>     return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "D:\onnxruntime_1_17_0\onnxruntime\tools\python\util\run.py", line 49, in run
>     completed_process = subprocess.run(
>                         ^^^^^^^^^^^^^^^
>   File "D:\Anaconda\Lib\subprocess.py", line 571, in run
>     raise CalledProcessError(retcode, process.args,
> subprocess.CalledProcessError: Command '['C:\\Users\\HP\\AppData\\Roaming\\Python\\Python311\\Scripts\\cmake.EXE', '--build', 'D:\\onnxruntime_1_17_0\\onnxruntime\\\\build\\Windows\\Release', '--config', 'Release', '--', '/maxcpucount:20', '/nodeReuse:False', '/p:CL_MPCount=20']' returned non-zero exit status 1.

Visual Studio Version

2022

GCC / Compiler Version

C++ compiler version: 19.40.33811.0

@Tc511 Tc511 added the build build issues; typically submitted using template label Sep 25, 2024
@Tc511
Copy link
Author

Tc511 commented Sep 25, 2024

running
git submodule update --init --recursive
.\build.bat --config Release --parallel 1 --skip_tests --cmake_extra_defines onnxruntime_VERBOSE_BUILD=ON
I fix this problem.
But another bug emerged...

onnxruntime_providers.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\onnxruntime_providers.lib
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/cmake/CMakeLists.txt
IOBinding.cc
abi_session_options.cc
allocator_adapters.cc
api_utils.cc
custom_ops.cc
default_cpu_allocator_c_api.cc
environment.cc
inference_session.cc
inference_session_utils.cc
onnxruntime_c_api.cc
ort_env.cc
provider_bridge_ort.cc
provider_registration.cc
standalone_op_invoker.cc
onnxruntime_session.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\onnxruntime_session.lib
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/cmake/CMakeLists.txt
compare_ortvalue.cc
default_providers.cc
file_util.cc
scoped_env_vars.cc
temp_dir.cc
tensors_from_file.cc
test_allocator.cc
test_environment.cc
test_random_seed.cc
test_utils.cc
D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-src\googletest\include\gtest\gtest-message.h(62,10): error C1083: 无法打开包括文件: “absl/strings/has_absl_stringify.h”: No
such file or directory [D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\onnxruntime_test_utils.vcxproj]
D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-src\googletest\include\gtest\gtest-message.h(62,10): error C1083: 无法打开包括文件: “absl/strings/has_absl_stringify.h”: No
such file or directory [D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\onnxruntime_test_utils.vcxproj]
D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-src\googletest\include\gtest\gtest-message.h(62,10): error C1083: 无法打开包括文件: “absl/strings/has_absl_stringify.h”: No
such file or directory [D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\onnxruntime_test_utils.vcxproj]
D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-src\googletest\include\gtest\gtest-message.h(62,10): error C1083: 无法打开包括文件: “absl/strings/has_absl_stringify.h”: No
such file or directory [D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\onnxruntime_test_utils.vcxproj]
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/cmake/CMakeLists.txt
math_cpu.cc
thread_utils.cc
onnxruntime_util.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\onnxruntime_util.lib
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/cmake/CMakeLists.txt
getopt.cc
win_getopt_wide.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\win_getopt_wide.lib
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/cmake/CMakeLists.txt
q4_dq_cli.cpp
onnxruntime_mlas_q4dq.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\Release\onnxruntime_mlas_q4dq.exe
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/build/Windows/Release/_deps/googletest-src/googlemock/CMakeLists.txt
gtest-all.cc
gmock-all.cc
gmock.vcxproj -> D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release\lib\Release\gmock.lib
Building Custom Rule D:/onnxruntime_1_17_0/onnxruntime/build/Windows/Release/_deps/googletest-src/googletest/CMakeLists.txt
gtest-all.cc
D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-src\googletest\include\gtest\gtest-message.h(62,10): error C1083: 无法打开包括文件: “absl/strings/has_absl_stringify.h”: No
such file or directory [D:\onnxruntime_1_17_0\onnxruntime\build\Windows\Release_deps\googletest-build\googletest\gtest.vcxproj]
Traceback (most recent call last):
File "D:\onnxruntime_1_17_0\onnxruntime\tools\ci_build\build.py", line 2887, in
sys.exit(main())
^^^^^^
File "D:\onnxruntime_1_17_0\onnxruntime\tools\ci_build\build.py", line 2779, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "D:\onnxruntime_1_17_0\onnxruntime\tools\ci_build\build.py", line 1659, in build_targets
run_subprocess(cmd_args, env=env)
File "D:\onnxruntime_1_17_0\onnxruntime\tools\ci_build\build.py", line 839, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\onnxruntime_1_17_0\onnxruntime\tools\python\util\run.py", line 49, in run
completed_process = subprocess.run(
^^^^^^^^^^^^^^^
File "D:\Anaconda\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\Users\HP\AppData\Roaming\Python\Python311\Scripts\cmake.EXE', '--build', 'D:\onnxruntime_1_17_0\onnxruntime\\build\Windows\Release', '--config', 'Release']' returned non-zero exit status 1.

@Tc511
Copy link
Author

Tc511 commented Sep 25, 2024

following the issue #18036
i fix the bug by the code:
.\build.bat --config Release --parallel 1 --skip_tests --cmake_extra_defines FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER

2024-09-25 16:12:18,609 build [INFO] - Build complete

@Tc511 Tc511 closed this as completed Sep 25, 2024
@Tc511
Copy link
Author

Tc511 commented Sep 25, 2024

some useful issues for build static lib:
#1472

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
Projects
None yet
Development

No branches or pull requests

1 participant