Open j-paulus opened 4 years ago
can you provide full logs? don't interrupt the build. (can you not use --use_openmp option? dnnl already uses its own openmp library) and also can you build from latest master. the dnnl ep was updated very recently.
@jywu-msft Sure. Made a fresh clone from git and run the build, now without --use_openmp
.
This is still an issue with the recent v1.6.0 release.
Building with ./build.sh --use_dnnl --build_shared_lib
fails to create the dynamic library libonnxruntime_providers_shared.dylib
[ 34%] Linking CXX shared library libonnxruntime_providers_shared.dylib
Undefined symbols for architecture x86_64:
"Provider_GetHost", referenced from:
-exported_symbol[s_list] command line option
(maybe you meant: _Provider_GetHost)
"Provider_SetHost", referenced from:
-exported_symbol[s_list] command line option
(maybe you meant: _Provider_SetHost)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libonnxruntime_providers_shared.dylib] Error 1
make[1]: *** [CMakeFiles/onnxruntime_providers_shared.dir/all] Error 2
make: *** [all] Error 2
Trying to build static libraries with ./build.sh --use_dnnl
also fails:
[ 75%] Linking CXX executable onnx_test_runner
Undefined symbols for architecture x86_64:
"onnx::AttributeProto_AttributeType_descriptor()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& onnx::AttributeProto_AttributeType_Name<int>(int) in libonnxruntime_framework.a(op_node_proto_helper.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& onnx::AttributeProto_AttributeType_Name<onnx::AttributeProto_AttributeType>(onnx::AttributeProto_AttributeType) in libonnxruntime_framework.a(op_node_proto_helper.cc.o)
"google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& onnx::AttributeProto_AttributeType_Name<int>(int) in libonnxruntime_framework.a(op_node_proto_helper.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& onnx::AttributeProto_AttributeType_Name<onnx::AttributeProto_AttributeType>(onnx::AttributeProto_AttributeType) in libonnxruntime_framework.a(op_node_proto_helper.cc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [onnx_test_runner] Error 1
make[1]: *** [CMakeFiles/onnx_test_runner.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 2088, in <module>
sys.exit(main())
File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 2023, in main
build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 1060, in build_targets
run_subprocess(cmd_args, env=env)
File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 523, in run_subprocess
return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
File "/Users/name/code/c/onnxruntime/tools/python/util/run.py", line 39, in run
completed_process = subprocess.run(
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Applications/CMake.app/Contents/bin/cmake', '--build', '/Users/name/code/c/onnxruntime/build/MacOS/Debug', '--config', 'Debug']' returned non-zero exit status 2.
I'm using this patch here to work around this issue, and DNNL is working just fine for me on Mac as well: https://github.com/bytedeco/javacpp-presets/blob/master/onnxruntime/onnxruntime.patch
Checking the current status from the repository and it seems that the build scripts are still failing out-of-the-box.
% git clone --recursive https://github.com/microsoft/onnxruntime.git
% cd onnxruntime
% ./build.sh --config Release --build_shared_lib --use_dnnl
This runs for a while until failing with the same issue:
ld: warning: directory not found for option '-L/Users/name/code/c/onnxruntime/build/MacOS/Release/dnnl/install/lib' Undefined symbols for architecture x86_64: "Provider_GetHost", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Provider_GetHost) "Provider_SetHost", referenced from: -exported_symbol[s_list] command line option (maybe you meant: _Provider_SetHost) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [libonnxruntime_providers_shared.dylib] Error 1 make[1]: [CMakeFiles/onnxruntime_providers_shared.dir/all] Error 2 make: ** [all] Error 2 Traceback (most recent call last): File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 2003, in
sys.exit(main()) File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 1938, in main build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target) File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 1017, in build_targets run_subprocess(cmd_args, env=env) File "/Users/name/code/c/onnxruntime/tools/ci_build/build.py", line 536, in run_subprocess return run( args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env) File "/Users/name/code/c/onnxruntime/tools/python/util/run.py", line 41, in run completed_process = subprocess.run( File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/Applications/CMake.app/Contents/bin/cmake', '--build', '/Users/name/code/c/onnxruntime/build/MacOS/Release', '--config', 'Release']' returned non-zero exit status 2.
This is not a critical thing in our project, but it would be nice to be able to benchmark DNNL at some point.
I have the same problem as shown by j-paulus above. Do I need to install some DNNL package first?
Yeah, same error ocurring in version 1.7.0.
I believe that, even feasible in theory (as DNNL-CPU for mac exists), building in OSX with DNNL is not supported for now...
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.
Describe the bug Building the shared ORT library including the DNNL execution provider fails under macOS, but the same build command works properly under Linux.
It appears as if the DNNL sources do not get fetched during the macOS build and that is (partly?) causing the problem.
See below for the steps involved.
Under Ubuntu 18.04, the build runs properly through without issues. Under macOS, the output is:
At this point I interrupt the build, since there is already an error occurring.
The directory
build/MacOS/Release/dnnl/install
does not exist, nor are the DNNL sources downloaded tobuild/MacOS/Release/dnnl/src
. Under Linux these both are populated.Urgency If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.
System information
To Reproduce
The commands run on both systems are the same:
Expected behavior A succesfull build of the library.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.