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

Config.h not found when building for android x86-64 #5105

Open
DavidVentura opened this issue Jan 31, 2025 · 5 comments
Open

Config.h not found when building for android x86-64 #5105

DavidVentura opened this issue Jan 31, 2025 · 5 comments

Comments

@DavidVentura
Copy link

Hi
I'm trying to build OpenBLAS for Android on x86-64, using CMake, but config.h cannot be included:

common.h:62:10: fatal error: 'config.h' file not found
   62 | #include "config.h"
      |          ^~~~~~~~~~

gen_config_h.c looks suspiciously useful, but I can't figure out which 2 files it wants as parameters -- I'd assumed openblas_config_template.h but no idea for the second one

I tried commenting out the include to see what should come from there, and so far I've only needed to #define ARCH_X86_64, but this feels wrong.

I have not tried building for other targets.

@martin-frbg
Copy link
Collaborator

Can you please describe in more detail what you are trying to do - are you cross-compiling on x86_64 to some ARM target running Android, or to an x86_64 device with Android, or are you compiling on the Android device itself ? The config.h file would normally be generated by the getarch helper, or in cross-compilation situations by the script cmake/prebuild.cmake
(using a long list of predefined configurations, which may be missing some cpu targets)

@DavidVentura
Copy link
Author

This is an x86_64 linux host, building for an x86_64 android target.

I'm using OpenBLAS as a backend for marian-dev, and including it in my project with

add_subdirectory(third_party/OpenBLAS)

The only value I'm setting is TARGET, to ZEN; I'm not sure why, but the build is considered cross-compilation by cmake

@martin-frbg
Copy link
Collaborator

Target ZEN should be supported by prebuild.cmake (you could try the almost-equivalent HASWELL but I doubt it will make a difference). Which compiler, and with Android I assume you are using the ndk ?

@DavidVentura
Copy link
Author

Yeah, I'm using the NDK, compiler is the one which comes prebuilt with the NDK: Clang 18. Haswell doesn't make a difference.

I'm 99% sure it's a me problem, but not sure what I can try with this

@martin-frbg
Copy link
Collaborator

Maybe the build script from #4952 (comment)
has a few cmake options that you haven't tried ? (Obviously you'd want to use TARGET=ZEN rather than the ATOM in that config, if this is what your Android hardware has)

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