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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Changes that suggested on #770 #771

wants to merge 2 commits into from

Conversation

Zaryob
Copy link

@Zaryob Zaryob commented Sep 7, 2024

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

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

…n 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'.
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