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] Building onnxruntime with version v1.18.2 is successful but gives an error with v1.20.1, cannot understand what I am doing wrong #23150

Open
SaqibAkram-Doit opened this issue Dec 19, 2024 · 3 comments
Labels
build build issues; typically submitted using template

Comments

@SaqibAkram-Doit
Copy link

Describe the issue

I am using the following command on a linux machine to build onnxruntime.

 ./build.sh \
  --config=Release \
  --build_shared_lib \
  --disable_ml_ops --build_wheel \
  --include_ops_by_config  <my system path to the .required_operators.config file> \
  --enable_reduced_operator_type_support \
  --skip_tests --parallel --use_xnnpack

When I build with version v1.20.1 it gives the following error and cannot build:

/usr/bin/ld: cannot find -lclog: No such file or directory

But when I build with version v1.18.2, the build is successful. I am not sure what I am doing wrong, need help. Thanks in advance.

Urgency

Not much urgent.

Target platform

CPU

Build script

./build.sh
--config=Release
--build_shared_lib
--disable_ml_ops --build_wheel
--include_ops_by_config <my system path to the .required_operators.config file>
--enable_reduced_operator_type_support
--skip_tests --parallel --use_xnnpack

Error / output

/usr/bin/ld: cannot find -lclog: No such file or directory

Visual Studio Version

No response

GCC / Compiler Version

No response

@SaqibAkram-Doit SaqibAkram-Doit added the build build issues; typically submitted using template label Dec 19, 2024
@xadupre
Copy link
Member

xadupre commented Dec 23, 2024

It seems a linux package is missing, maybe clog? The full trace would be better then we can see where it happens during the build.

@SaqibAkram-Doit
Copy link
Author

Yes, it seems that clog is missing; do we need to add into the automatic installation list?
The trace is as follows:

[ 21%] Built target absl_time_zone
[ 22%] Built target absl_debugging_internal
[ 22%] Built target absl_stacktrace
[ 23%] Built target absl_strings_internal
[ 23%] Built target absl_utf8_for_code_point
[ 23%] Built target absl_decode_rust_punycode
[ 23%] Built target absl_demangle_rust
[ 23%] Built target absl_demangle_internal
[ 24%] Built target absl_int128
[ 24%] Built target absl_string_view
[ 25%] Built target absl_strings
[ 25%] Built target absl_symbolize
[ 25%] Built target absl_exponential_biased
[ 25%] Built target absl_graphcycles_internal
[ 26%] Built target absl_civil_time
[ 26%] Built target absl_time
[ 26%] Built target absl_kernel_timeout_internal
[ 27%] Built target absl_synchronization
[ 27%] Built target absl_hashtablez_sampler
[ 27%] Built target absl_bad_variant_access
[ 27%] Built target absl_city
[ 27%] Built target absl_low_level_hash
[ 27%] Built target absl_bad_optional_access
[ 27%] Built target absl_hash
[ 27%] Built target absl_raw_hash_set
[ 27%] Built target absl_crc_cpu_detect
[ 27%] Built target absl_crc_internal
[ 27%] Built target absl_str_format_internal
[ 27%] Built target absl_crc32c
[ 27%] Built target absl_crc_cord_state
[ 27%] Built target absl_examine_stack
[ 27%] Built target absl_flags_program_name
[ 27%] Built target absl_flags_config
[ 27%] Built target absl_flags_marshalling
[ 27%] Built target absl_flags_commandlineflag_internal
[ 27%] Built target absl_flags_commandlineflag
[ 28%] Built target absl_flags_private_handle_accessor
[ 28%] Built target absl_cord_internal
[ 28%] Built target absl_cordz_functions
[ 28%] Built target absl_cordz_handle
[ 29%] Built target absl_cordz_info
[ 29%] Built target absl_cord
[ 29%] Built target absl_flags_reflection
[ 29%] Built target absl_flags_internal
[ 29%] Built target absl_log_internal_globals
[ 29%] Built target absl_log_internal_format
[ 29%] Built target absl_log_internal_proto
[ 29%] Built target absl_log_internal_fnmatch
[ 29%] Built target absl_vlog_config_internal
[ 29%] Built target absl_log_globals
[ 29%] Built target absl_log_entry
[ 29%] Built target absl_log_sink
[ 29%] Built target absl_log_internal_log_sink_set
[ 29%] Built target absl_log_internal_nullguard
[ 29%] Built target absl_log_internal_message
[ 29%] Built target absl_log_internal_check_op
[ 30%] Built target absl_log_internal_conditions
[ 31%] Built target onnxruntime_common
[ 37%] Built target onnxruntime_mlas
[ 39%] Built target nsync_cpp
[ 39%] Built target onnxruntime_mlas_q4dq
[ 41%] Built target onnxruntime_graph
[ 45%] Built target onnxruntime_framework
[ 45%] Built target onnxruntime_lora
[ 45%] Built target onnxruntime_util
[ 48%] Built target onnx
[ 62%] Built target onnxruntime_providers
[ 62%] Built target onnxruntime_providers_shared
[ 69%] Built target onnxruntime_optimizer
[ 70%] Built target onnxruntime_session
[ 71%] Built target onnxruntime_test_utils
[ 71%] Built target onnx_test_data_proto
[ 72%] Built target onnx_test_runner_common
[ 74%] Built target re2
[ 74%] Linking CXX executable onnxruntime_test_all
/usr/bin/ld: cannot find -lclog: No such file or directory
/usr/bin/ld: cannot find -lclog: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/onnxruntime_test_all.dir/build.make:5209: onnxruntime_test_all] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2704: CMakeFiles/onnxruntime_test_all.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Traceback (most recent call last):
  File "Local_Path/GitHub/onnxruntime/tools/ci_build/build.py", line 2998, in <module>
    sys.exit(main())
             ^^^^^^
  File "Local_Path/GitHub/onnxruntime/tools/ci_build/build.py", line 2888, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "Local_Path/GitHub/onnxruntime/tools/ci_build/build.py", line 1739, in build_targets
    run_subprocess(cmd_args, env=env)
  File "Local_Path/GitHub/onnxruntime/tools/ci_build/build.py", line 867, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Local_Path/GitHub/onnxruntime/tools/python/util/run.py", line 49, in run
    completed_process = subprocess.run(
                        ^^^^^^^^^^^^^^^
  File "/~/miniconda3/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/~/.local/bin/cmake', '--build', 'Local_Path/GitHub/onnxruntime/build/Linux/Debug', '--config', 'Debug']' returned non-zero exit status 2.
--config=Release: command not found
--build_shared_lib: command not found
--disable_ml_ops: command not found
bash: syntax error near unexpected token `newline'
--enable_reduced_operator_type_support: command not found
--skip_tests: command not found

@xadupre
Copy link
Member

xadupre commented Dec 23, 2024

You should be able to remove that depdency by changing one cmake option:

option(onnxruntime_ENABLE_CPUINFO "Enable cpuinfo" ON)

This option sets CPUINFO_SUPPORTED to TRUE. In another place of the cmake file, you find:

if ((CPUINFO_SUPPORTED OR onnxruntime_USE_XNNPACK) AND NOT ANDROID)
  set(CLOG_BUILD_TESTS OFF CACHE BOOL "" FORCE)
  FetchContent_Declare(
    pytorch_clog
    URL ${DEP_URL_pytorch_cpuinfo}
    URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
    SOURCE_SUBDIR deps/clog
    FIND_PACKAGE_ARGS NAMES cpuinfo
  )
  set(ONNXRUNTIME_CLOG_PROJ pytorch_clog)
  onnxruntime_fetchcontent_makeavailable(${ONNXRUNTIME_CLOG_PROJ})
  set(ONNXRUNTIME_CLOG_TARGET_NAME clog)
...

The default settings for these values may have changed.

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

2 participants