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

Problem building Android example - unable to find library -lVulkan-Headers #356

Open
math10 opened this issue Feb 10, 2024 · 4 comments
Open

Comments

@math10
Copy link

math10 commented Feb 10, 2024

Environment:
OS: macOS 13.3
Android Studio: Android Studio Hedgehog | 2023.1.1 Patch
NDK: 25.1.8937393
cmake: 3.22.1
Branch: #v0.9.0

Error:

What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.
com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/.cxx/Debug/w4f86y3s/arm64-v8a'
[1/23] Generating ShaderLogisticRegression.hpp
[2/23] Generating ShaderOpMult.hpp
[3/23] Compile vulkan compute shader from file '/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/src/main/cpp/shader/my_shader.comp' to '/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/.cxx/Debug/w4f86y3s/arm64-v8a/shader/my_shader.comp.spv'.
/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/src/main/cpp/shader/my_shader.comp
[4/23] Building CXX object kompute_build/src/logger/CMakeFiles/kp_logger.dir/Logger.cpp.o
[5/23] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.o
[6/23] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o
[7/23] Linking CXX static library _deps/fmt-build/libfmtd.a
[8/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/OpTensorSyncLocal.cpp.o
[9/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/OpMemoryBarrier.cpp.o
[10/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/OpAlgoDispatch.cpp.o
[11/23] Converting compiled shader '/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/.cxx/Debug/w4f86y3s/arm64-v8a/shader/my_shader.comp.spv' to header file '/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/.cxx/Debug/w4f86y3s/arm64-v8a/shader/my_shader.hpp'.
-- Interpreting shader in little endian...
[12/23] Linking CXX static library kompute_build/src/logger/libkp_logger.a
[13/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/OpTensorSyncDevice.cpp.o
[14/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/OpTensorCopy.cpp.o
[15/23] Building CXX object CMakeFiles/kompute-jni.dir/KomputeJniNative.cpp.o
[16/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/Sequence.cpp.o
[17/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/Tensor.cpp.o
[18/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/Algorithm.cpp.o
[19/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/Core.cpp.o
[20/23] Building CXX object kompute_build/src/CMakeFiles/kompute.dir/Manager.cpp.o
[21/23] Linking CXX static library kompute_build/src/libkompute.a
[22/23] Building CXX object CMakeFiles/kompute-jni.dir/KomputeModelML.cpp.o
[23/23] Linking CXX shared library /Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/build/intermediates/cxx/Debug/w4f86y3s/obj/arm64-v8a/libkompute-jni.so
FAILED: /Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/build/intermediates/cxx/Debug/w4f86y3s/obj/arm64-v8a/libkompute-jni.so
: && /Users/sanim/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/sanim/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libkompute-jni.so -o /Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/build/intermediates/cxx/Debug/w4f86y3s/obj/arm64-v8a/libkompute-jni.so CMakeFiles/kompute-jni.dir/KomputeJniNative.cpp.o CMakeFiles/kompute-jni.dir/KomputeModelML.cpp.o kompute_build/src/libkompute.a -llog -landroid -lVulkan-Headers kompute_build/src/logger/libkp_logger.a _deps/fmt-build/libfmtd.a -lVulkan-Headers -latomic -lm && :
ld: error: unable to find library -lVulkan-Headers
ld: error: unable to find library -lVulkan-Headers
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
C++ build system [build] failed while executing:
/Users/sanim/Library/Android/sdk/cmake/3.22.1/bin/ninja
-C
/Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app/.cxx/Debug/w4f86y3s/arm64-v8a
kompute-jni
from /Users/sanim/Documents/UGA/Labwork/kompute/examples/android/android-simple/app

@axsaucedo
Copy link
Member

This library is included as part of the build and fetched using github as part of the cmake build. This has not been tested in mac, but has been tested in windows, can you check your build/_deps folder to confirm that vulkan-headers is located there?

@math10
Copy link
Author

math10 commented Feb 11, 2024

I didn't see any vulkan-headers in _deps folder and its subfolders. Please see the attached image those are the things that are available in the _deps folder. Could you please let me know, Is there any cmake configs which are specific to windows?

FYI, I have also tested on ubuntu same error found.
Screenshot 2024-02-11 at 1 27 00 PM

@math10
Copy link
Author

math10 commented Feb 22, 2024

@axsaucedo Do you have any idea seeing the attached picture from the previous comment?

@axsaucedo
Copy link
Member

Thank you for the followup message @math10, it seems I missed the notification - looking at the picture I can see that indeed there are dependencies missing - as you should see something more like the following:

image

Looking at the logs provided I don't see anything incorrect so far - could you run a clean and then a rerun to see if that helps? Having a verbose CMAKE could also help to understand what may be the issue when fetching the dependencies. It would be useful if you can also share the logs that show the variables set on the cmake build.

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