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

external libraries #201

Closed
grzavala opened this issue Apr 5, 2021 · 14 comments
Closed

external libraries #201

grzavala opened this issue Apr 5, 2021 · 14 comments

Comments

@grzavala
Copy link

grzavala commented Apr 5, 2021

I cannot link to the project the fmt library+ias and those in the external directory.

@unexploredtest
Copy link
Contributor

Have you set the option KOMPUTE_OPT_REPO_SUBMODULE_BUILD?
Like cmake -Bbuild -DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1 (other options)...?

@grzavala
Copy link
Author

grzavala commented Apr 6, 2021

I try to make my own calculation applications and I see in Kompute a potential for my developments in complex numerical models (hydraulics and hydrology).But I am not familiar with cMake I don't use it. On the other hand I recently have a working 3D Digital Terrain model in Vulkan to which I want to add computational potential.
I have cloned the Kompute repository and I have lifted the project with "Visual Studio 2019 Comunity" in Windows 10. At compile time I get this message:

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error CMake Error at src/CMakeLists.txt:88 (find_package): By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "fmt", but CMake did not find one.

Could not find a package configuration file provided by "fmt" with any of
the following names:

fmtConfig.cmake
fmt-config.cmake

Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
to a directory containing one of the above files. If "fmt" provides a
separate development package or SDK, be sure it has been installed. e:\vulkan-kompute\src/CMakeLists.txt 88

If I comment out the addition of "fmt", the directory not found error goes to the next library "glslang", etc minus the "Vulkan-Header" one. I have tried, but I don't know how to solve this problem.

@axsaucedo
Copy link
Member

@grzavala the easiest way to address this as @unexploredtest suggests is to build with KOMPUTE_OPT_REPO_SUBMODULE_BUILD=1, this is a parameter that you have to add as part of your build configuration in visual studio

@axsaucedo
Copy link
Member

You also need to make sure you clone the repo with the --recursive flag, which ensures that all the sub-repos are cloned as well (including glslang, fmt, etc). Basically this makes it simpler as it ensures all the dependencies are packaged up together with Kompute.

@axsaucedo
Copy link
Member

Best practice would be to change your visual studio parameters, but you can also change this on your file, specifically on this line: https://github.com/EthicalML/vulkan-kompute/blob/3aa2ca79c28aa4eb3a5101dffac3977314f439fd/CMakeLists.txt#L19

@grzavala
Copy link
Author

grzavala commented Apr 6, 2021

The cloning of the Kompute repository is complete on my computer, I checked the directories. I also did it several times.
I have put the suggestions of unexploredtest and axsaucedo:

  1. in vulkan-kompute/src/CMakeLists.txt.
    option(KOMPUTE_OPT_REPO_SUBMODULE_BUILD, "Use the submodule repos instead of external package manager" 0)
  2. as compile argument option: -KOMPUTE_OPT_OPT_REPO_SUBMODULE_BUILD=1

But ... same error.

@axsaucedo
Copy link
Member

You have to use the compile option -DKOMPUTE_OPT_OPT_REPO_SUBMODULE_BUILD=1, with -D at the beginning - you can also just change the 0 to 1 on the cmakelists.txt file. Could you try that?

@grzavala
Copy link
Author

grzavala commented Apr 6, 2021

Resolved !!! Complete compilation.
It worked by setting:-KOMPUTE_OPT_OPT_OPT_REPO_SUBMODULE_BUILD = 1 in CMakeSettings.json in Command Arguments (additional command line options passed to CMake when invoked to generate the cache).
Did not work in Compile Command Arguments: (native build modifiers passed to CMake after --build). Thanks!!!

@grzavala
Copy link
Author

grzavala commented Apr 6, 2021

sorry, I misspelled above. It is: -DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1

@axsaucedo
Copy link
Member

Fantastic news - cmake can always be quite fiddly, but it does simplify complexity in the larger scale. Ok in this case I will close this issue. Please feel free to reopen or open a new one if you run into other issues.

@grzavala
Copy link
Author

Good morning. The CMake project in Visual Studio 2019 Comunity loaded completely and did not throw errors with the addresses of the libraries with the indications provided. But for the next step, when I choose a program to run inside the structure (any *.cpp), I get errors in the #includes <kompute/Kompute.hpp>. (error) Cannot open the source file. How can I fix this?

@axsaucedo
Copy link
Member

@grzavala are you able to run the tests? If so, you would just need to make sure your cmake file has a similar structure to that. Alternatively you can try running one of the examples like the logistic regression as they are semi-independent, as in they import the main project, and use the kompute.hpp header

@grzavala
Copy link
Author

I cannot run the tests. I don't know how to do it. I would need an example of how to modify or adapt CMakeLists.txt
I have tried placing subdirectories and pointing to executables but something must be missing.

@unexploredtest
Copy link
Contributor

unexploredtest commented Apr 19, 2021

@grzavala To enable tests, you have to enable the cmake option KOMPUTE_OPT_BUILD_TESTS(set it to one) just like how you enabled KOMPUTE_OPT_REPO_SUBMODULE_BUILD in CMakeSettings.json

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

No branches or pull requests

3 participants