-
Notifications
You must be signed in to change notification settings - Fork 738
cmake build, configurable from env #2115
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
Conversation
Next, could someone look into the setuptools and cmake code ? I tried to build with custom config:
I am building with:
so cmake build logs are visible on the screen. The build fails as the Similar problems arise also from other non-default options:
|
please add after sherpa-onnx/cmake/cmake_extension.py Lines 216 to 217 in 95ba6b4
if not src_file.is_file():
continue |
Okay, added those two lines, now getting:
|
it seems like something in but it can be also somewhere else, there is also one |
I see the problem. You need to change two places.
You can add something like: def get_binaries_to_install():
cmake_args = os.environ.get("SHERPA_ONNX_CMAKE_ARGS", "")
if '-DSHERPA_ONNX_ENABLE_BINARY=OFF' in cmake_args:
return None
data_files=[("bin", get_binaries_to_install())] if get_binaries_to_install() else [], or data_files=[("bin", get_binaries_to_install())] if get_binaries_to_install() else None, |
Thank you for the suggestions! PR is updated. |
Is it ready to merge? |
sherpa-onnx/csrc/parse-options.cc
Outdated
@@ -262,7 +262,7 @@ static bool MustBeQuoted(const std::string &str, ShellType st) { | |||
// will get passed to the program in the same way. | |||
static std::string QuoteAndEscape(const std::string &str, ShellType /*st*/) { | |||
// Only Bash is supported (for the moment). | |||
SHERPA_ONNX_CHECK_EQ(st, kBash) << "Invalid shell type."; | |||
// SHERPA_ONNX_CHECK_EQ(st, kBash) << "Invalid shell type."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you call exit() after printing a log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returned to it. i don't understand the context now... there seems to be no logprint...
here the compilation was crashing when -DSHERPA_ONNX_ENABLE_CHECK=ON
was set.
the variable st
was already commented in the header of the function QuoteAndEscape
,
and it was used in the macro SHERPA_ONNX_CHECK_EQ
, being an undefined variable.
so I commented out the line 265 fix it... there is no other use of variable st
in that function...
should there be done something more ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then please just remove it instead of commenting it out. Removing it leads to less code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, good, done !
Left a comment above on the |
- make sure the defaults in `cmake/cmake_extension.py` variable `extra_cmake_args` can be overriden by `cmake_args` from `SHERPA_ONNX_CMAKE_ARGS` env variable - fix a bug in `sherpa-onnx/csrc/parse-options.cc` which appears when using `-DSHERPA_ONNX_ENABLE_CHECK=ON` - avoid copying binaries when these are disabled
2cd87f7
to
b61e0e7
Compare
Ok, the commented line is removed. The PR was squashed to be a single commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
cmake/cmake_extension.py
variableextra_cmake_args
can be overriden bycmake_args
from${SHERPA_ONNX_CMAKE_ARGS}
env variablesherpa-onnx/csrc/parse-options.cc
which appears when using-DSHERPA_ONNX_ENABLE_CHECK=ON