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 Broken with cmake option onnxruntime_BUILD_UNIT_TESTS=OFF #7571

Closed
ankurvdev opened this issue May 4, 2021 · 5 comments
Closed

Build Broken with cmake option onnxruntime_BUILD_UNIT_TESTS=OFF #7571

ankurvdev opened this issue May 4, 2021 · 5 comments
Labels
contributions welcome lower priority issues for the core ORT teams feature request request for unsupported feature or enhancement training issues related to ONNX Runtime training; typically submitted using template

Comments

@ankurvdev
Copy link
Contributor

Describe the bug
Using the cmake option onnxruntime_BUILD_UNIT_TESTS=OFF results in cmake generate error

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
All

To Reproduce
cmake -Donnxruntime_BUILD_UNIT_TESTS=OFF

Expected behavior
Generates properly

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

@ytaous ytaous added the more info needed issues that cannot be triaged until more information is submitted by the original user label May 5, 2021
@ytaous
Copy link
Contributor

ytaous commented May 5, 2021

Hi, more details please.
which part of the instruction you are trying to follow?
did you try build command (e.g., build.sh) to build instead? If using build cmd, can you try to add --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF at the end of the cmd and see?
what's the full error stack you are getting?

@ankurvdev
Copy link
Contributor Author

I'm mostly using custom build instructions but I had a change to dig into that a little more and here's more details (with perhaps a fix)

The problem happens when you say
-Donnxruntime_BUILD_UNIT_TESTS=OFF
and
-Donnxruntime_ENABLE_TRAINING=ON

What happens is that because because BUILD_UNIT_TESTS is OFF the cmake file onnxruntime_unittest.cmake doesnt get included which defines the variable TEST_SRC_DIR

set(TEST_SRC_DIR ${ONNXRUNTIME_ROOT}/test)

The variable is used in onnxruntime_training.cmake here:

set(onnxruntime_perf_test_src_dir ${TEST_SRC_DIR}/perftest)

The exact error occurs at

source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_training_runner_srcs} ${onnxruntime_perf_test_src})

because TEST_SRC_DIR expands to empty and the paths dont line up.

perhaps the right fix would be to simply not use the variable but
use ${ONNXRUNTIME_ROOT}/test
A better yet fix would probably be to check if we're building UNITTESTS or not in onnxruntime_training.cmake and put them under the right IF

@snnn snnn added training issues related to ONNX Runtime training; typically submitted using template and removed more info needed issues that cannot be triaged until more information is submitted by the original user labels May 5, 2021
@ytaous
Copy link
Contributor

ytaous commented May 5, 2021

@ankurverma85 0 I can repro the issue with:
./build.sh --config RelWithDebInfo --use_cuda --enable_training --skip_tests --parallel --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF

wo/ --enable_training, it will build.

Is there any particular use case for this combination? This sounds like enhancement and welcome to contribute.

@ytaous ytaous added feature request request for unsupported feature or enhancement contributions welcome lower priority issues for the core ORT teams labels May 5, 2021
@ytaous
Copy link
Contributor

ytaous commented May 7, 2021

close it for now

@ytaous ytaous closed this as completed May 7, 2021
@drux007
Copy link

drux007 commented Apr 11, 2022

Hi,

I am also trying to build onnxruntime with -Donnxruntime_BUILD_UNIT_TESTS=OFF option to speed up the build process and it fails when I try to link onnxruntime against other static libraries in my application.

The error I get:

/usr/bin/ld: .../lib/libonnxruntime_session.a(ort_env.cc.o): in function `OrtEnv::GetInstance(OrtEnv::LoggingManagerConstructionInfo const&, onnxruntime::common::Status&, OrtThreadingOptions const*) [clone .cold]':
ort_env.cc:(.text.unlikely._ZN6OrtEnv11GetInstanceERKNS_30LoggingManagerConstructionInfoERN11onnxruntime6common6StatusEPK19OrtThreadingOptions+0x49): undefined reference to `nsync::nsync_mu_unlock(nsync::nsync_mu_s_*)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome lower priority issues for the core ORT teams feature request request for unsupported feature or enhancement training issues related to ONNX Runtime training; typically submitted using template
Projects
None yet
Development

No branches or pull requests

4 participants