Closed Zaryob closed 3 weeks ago
I'm trying to understand, why you want to move this code to another file. I'm not against moving it. It just seems to be unnecessary and I want to make sure we're not breaking anything.
UPDATE: I'm looking at the issue #770 . I'm still wondering what the issue might be here? Is the CMake variable set incorrectly? That might imply that smth in our CMake logic is broken and needs to be fixed.
Mainly I make this:
I added volk as submodule in my project with git submodule. (To avoid deal with compiling volk outside each time and be sure about version of volk for every iteration in my code)
I added it on my CMakeLists.txt:
add_submodule(volk)
After that I linked it in my library:
target_link_libraries(mylib PRIVATE volk)
It gives me following error as I write it to issue #770
[51/739] Generating __init__.pyo, cfg.pyo, volk_modtool_generate.pyo
FAILED: core/submodules/volk/python/volk_modtool/__init__.pyo core/submodules/volk/python/volk_modtool/cfg.pyo core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyo C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/__init__.pyo C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/cfg.pyo C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyo
C:\Windows\system32\cmd.exe /C "cd /D C:\Users\suley\source\repos\GSR\out\build\x64-Debug\core\submodules\volk\python\volk_modtool && "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" -O C:/Users/suley/source/repos/GSR/out/build/x64-Debug/python_compile_helper.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/__init__.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/cfg.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/volk_modtool_generate.py C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/__init__.pyo C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/cfg.pyo C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyo"
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe: can't open file 'C:\Users\suley\source\repos\GSR\out\build\x64-Debug\python_compile_helper.py': [Errno 2] No such file or directory
[52/739] Generating __init__.pyc, cfg.pyc, volk_modtool_generate.pyc
FAILED: core/submodules/volk/python/volk_modtool/__init__.pyc core/submodules/volk/python/volk_modtool/cfg.pyc core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyc C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/GSR/volk_modtool/__init__.pyc C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/cfg.pyc C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyc
C:\Windows\system32\cmd.exe /C "cd /D C:\Users\suley\source\repos\GSR\out\build\x64-Debug\core\submodules\volk\python\volk_modtool && "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" C:/Users/suley/source/repos/GSR/out/build/x64-Debug/python_compile_helper.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/__init__.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/cfg.py C:/Users/suley/source/repos/GSR/core/submodules/volk/python/volk_modtool/volk_modtool_generate.py C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/__init__.pyc C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/cfg.pyc C:/Users/suley/source/repos/GSR/out/build/x64-Debug/core/submodules/volk/python/volk_modtool/volk_modtool_generate.pyc"
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe: can't open file 'C:\Users\suley\source\repos\GSR\out\build\x64-Debug\python_compile_helper.py': [Errno 2] No such file or directory
This is my project structure:
/myProject
|__ submodules
| |__ volk
|__ include
| |__ various_headers.h
|__ src
| |__ various_sources.cpp
|_ CMakeLists.txt
As I see that when I try to build this structured project to out/build/x64-Debug
directory (also tried on Linux) python script that generated via submodules/volk/cmake/Modules/VolkPython.cmake
will expected to state in out/build/x64-Debug
but it generated in out/build/x64-Debug/submodules/volk
It seems that CMAKE_BINARY_DIR
will differ while compiling. And this change fixed this problem.
If any other suggestions we can try.
CMAKE_CURRENT_BINARY_DIR would possibly be the preferred way to use. I'd suspect changing this variable in the original location would already fix your issue. That'd be great. That way we can keep the code in a more generic place that makes it easier to re-use. Also, thanks for your patience.
About our CI. The "flyci" part needs to be removed and will be soon, but the DCO checker should be satisfied. If you click on it, it will give you tailored instructions on how to fix it.
It wouldn't worked to use CMAKE_CURRENT_BINARY_DIR
1> [CMake] Project Source Directory: C:/Users/Zaryob/source/repos/XXXXX/core/submodules/volk 1> [CMake] Build Directory: C:/Users/Zaryob/source/repos/XXXXX/out/build/x64-Release/core/submodules/volk 1> [CMake] Current Source Directory: C:/Users/Zaryob/source/repos/XXXXX/core/submodules/volk 1> [CMake] Current Binary Directory: C:/Users/Zaryob/source/repos/XXXXX/out/build/x64-Release/core/submodules/volk
Main problem is directories stated above gives same time with "file(WRITE ..." runs. But other functions on VolkPython.cmake run time. and their CMAKE_CURRENT_BUILD_DIR and CMAKE_BUILD_DIR prespective is totally different
@Zaryob I'd like to merge your PR as is but I can't because of the DCO. We adopted the DCO where every commit is signed off to verify that contributors are not blocked by anything.
In general this is achieved with git commit -s
. The DCO check comes with a tailored message on how to fix it:
To add your Signed-off-by line to every commit in this branch:
Ensure you have a local copy of your branch by [checking out the pull request locally via command line](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally).
In your local branch, run: git rebase HEAD~2 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin main
The last line assumes that origin
is the name of your remote github repository.
Thanks for the follow-up! Assuming all the tests pass, I'd like to merge your PR.
Writing to the python helper script moved to
python/volk_modtool/CMakeLists.txt