-
Notifications
You must be signed in to change notification settings - Fork 86
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
Clean CMake #19
base: master
Are you sure you want to change the base?
Clean CMake #19
Conversation
Also I don't have a way to test all the machine, but would you be ok for a Github CI workflow ? |
I'm still testing on various platforms (which might take a while), but the changes in the last commit ("avoid using absolute path and introduce copy_to_cpp function") seem like a good idea. I'm not keen on the other commits:
3 and 4. I would prefer to continue supporting versions of cmake as far back as is practical. Is there a benefit in using Thread::Thread now? Or can it wait until new cmakes no longer support v2.8.12 syntax? |
Could we proceed with just your last commit? |
After testing it still doesn't fix my issue, I need to investigate a bit more. Let me finish to understand properly that and I will remove the format and the drop of CMake 2.x |
Ok. Let me know. By the way, while you're changing CMakeLists.txt, would you change the first line to this: I believe that tells cmake it will work with any version in that range, and it stops it from warning about the Thanks. |
a3a75e7
to
5ce7c18
Compare
Previously when I built using cmake, But with this new CMakeLists.txt, it creates a subdirectory called "cpp" in the top-level source directory! Is there some reason why it cannot work to create "cpp" in the build directory? |
Based on how cmake handles yacc, which also generates some C source from other source, |
Looks good. I tested it with an old and a new cmake. Can you confirm that your verified that this latest version fixes the issue you were having with ONNXRuntime with riscv32? |
@m3bm3b no sorry I was busy with other tasks, I hope I could manage this this weekend. |
Hi @m3bm3b,
I'm trying to build onnxruntime with Yocto on RISCV32 arch.
ONNXRuntime use NSYNC and unfortunately it doesn't properly build at the moment:
Due to a QA Check warning on some absolute path.
Error is:
| CMake Error in /home/nobuo/Data/yocto/main/riscv-build/tmp-glibc/work/riscv32-oe-linux/onnxruntime/1.18.0/build/_deps/google_nsync-src/CMakeLists.txt:
| Target "nsync_cpp" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
| "/home/nobuo/Data/yocto/main/riscv-build/tmp-glibc/work/riscv32-oe-linux/onnxruntime/1.18.0/build/_deps/google_nsync-src/public"
|
| which is prefixed in the build directory.
This is not mandatory and I could bypass it but I prefer to clean, to avoid any issue in case I need to build an SDK.
The issue seems to come from ONNXRuntime and how they include nsync in there project.
https://github.com/microsoft/onnxruntime/blob/main/cmake/CMakeLists.txt#L1048
https://github.com/microsoft/onnxruntime/blob/main/cmake/CMakeLists.txt#L1179C10-L1187
This seems to be required because NSYNC use path relative to PROJECT_SOURCE_DIR which regarding how you include this project may fail.
I propose in this MR to clean and drop CMake below 3.5 but only the last commit should be usefull.
I have also used cmake-format to reindent the CMake.
Let me know what you think,
Thanks