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

Changes that suggested on #770 #771

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Changes that suggested on #770 #771

merged 1 commit into from
Nov 3, 2024

Conversation

Zaryob
Copy link
Contributor

@Zaryob Zaryob commented Sep 7, 2024

Writing to the python helper script moved to python/volk_modtool/CMakeLists.txt

@jdemel
Copy link
Contributor

jdemel commented Sep 13, 2024

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.

@jdemel jdemel linked an issue Sep 13, 2024 that may be closed by this pull request
@Zaryob
Copy link
Contributor Author

Zaryob commented Sep 13, 2024

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)
  [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.

@jdemel
Copy link
Contributor

jdemel commented Sep 18, 2024

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.

@jdemel
Copy link
Contributor

jdemel commented Sep 18, 2024

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.

@Zaryob
Copy link
Contributor Author

Zaryob commented Sep 25, 2024

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

@jdemel
Copy link
Contributor

jdemel commented Oct 28, 2024

@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.

Writing to the python helper script moved to `python/volk_modtool/CMakeLists.txt`
Revert "Changes that suggested on gnuradio#770" and Added way given on pull req.

This reverts commit d4afa9e partially.

as @jdemel stated:
> 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.

I suspected about is there any upper config deletes CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BUILD_DIR and it overriding on 'CMakeLists.txt'.

Signed-off-by: Suleyman Poyraz <[email protected]>
@jdemel
Copy link
Contributor

jdemel commented Nov 3, 2024

Thanks for the follow-up! Assuming all the tests pass, I'd like to merge your PR.

@jdemel jdemel merged commit 3bc6642 into gnuradio:main Nov 3, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CMAKE] Adding VOLK as submodule is not building
2 participants