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

Android sample is not compiling #305

Closed
mukovozov opened this issue Sep 18, 2022 · 7 comments
Closed

Android sample is not compiling #305

mukovozov opened this issue Sep 18, 2022 · 7 comments

Comments

@mukovozov
Copy link

I'm really excited about your project, cause it may help us to overcome CPU restrictions, but, unfortunately, I'm not able to build the Android sample.

I'm getting an error message like this:

.../android-simple/app/src/main/cpp/CMakeLists.txt : C/C++ arm8Debug|arm64-v8a : CMake Error at 
...kompute/examples/android/android-simple/app/src/main/cpp/../../../../../../../src/CMakeLists.txt:73 (add_subdirectory):
  The source directory

.../kompute/external/Vulkan-Headers

  does not contain a CMakeLists.txt file.

I assume the problem is in this line: add_subdirectory(../../../../../../../ ${CMAKE_CURRENT_BINARY_DIR}/kompute_build).
I've tried to replace it with includeDirectories(absolute path to kompute directory), but then I see many other compilation errors.

I'm not very experienced in NDK and building C libraries in general, so maybe you could advise me something because I've seen that you have tested the Android sample recently and it worked for you.

@axsaucedo
Copy link
Member

axsaucedo commented Sep 18, 2022

Great to hear about the interest on the project. There may be a couple of things to set up to get up and running.

@mukovozov you will need to make sure to initialise all the git submodules, you can do so through git submodule update --init --recursive

@mukovozov
Copy link
Author

thanks for a quick reply!
Yeah, I did it manually before, but now I can see other issues as:

kompute/VERSION:1:1: error: expected unqualified-id
sdk/ndk/21.2.6472646/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/cstddef:49:9: error: no member named 'ptrdiff_t' in the global namespace

and more.
I use the NDK version that is defined in build.gradle file.

@axsaucedo
Copy link
Member

Ok I see, another thing that I can think about looking at the issue, it may be potentially a couple of things to consider. Indeed as you suggested the first most important things are to ensrue that the version of NDK is the correct one, as well as the version of the android development setup. Further to that it may be worth ensuing that the vulkan headers / packages are of the correct version.

@axsaucedo
Copy link
Member

Having said that, I'm not sure why the VERSION file is appearing as an error, that should not really be a file that would be compiled / processed

@mukovozov
Copy link
Author

I've managed to fix those issues, that was my fault most likely.
Regarding Vulkan headers version, I see sources, but I cannot find any version file there. Anyway, I think I cloned versions that you specified (fmt, vulkan, etc.).
It seems like I need to specify c++14 features, but I see it's done in CMakeLists.txt

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 \
                     -DVK_USE_PLATFORM_ANDROID_KHR=1 \
                     -DKOMPUTE_DISABLE_VK_DEBUG_LAYERS=1")

Screen Shot 2022-09-19 at 9 41 40

@mukovozov
Copy link
Author

Oh, I've launched the app! I've changed type from auto to std::string and removed value from vk::Pipeline pipeline = this->mDevice->createComputePipeline(*this->mPipelineCache, pipelineInfo).value;

@mukovozov
Copy link
Author

I'm closing the issue due to I've managed to build the app and the errors were probably specific and there is no need to fix anything from your side. Thanks for the response anyway!

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

2 participants