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

Including built hwloc in linker for cross toolchain compilation #672

Open
0xffffa opened this issue Jun 30, 2024 · 1 comment
Open

Including built hwloc in linker for cross toolchain compilation #672

0xffffa opened this issue Jun 30, 2024 · 1 comment

Comments

@0xffffa
Copy link

0xffffa commented Jun 30, 2024

I'm currently on ubuntu trying to cross compile for android on golang. I'm able to successfully build the hwloc libraries for each android architecture using https://github.com/XMRig-for-Android/xmrig-for-android/tree/main/xmrig/lib-builder

However when trying to compile this library in a golang project using the same android tool chain I get the error

fatal error: 'hwloc.h' file not found

How can I make the compiler recognize the built hwloc libraries? Sorry if this is a dumb question but I'm not very good with understanding cross compilation or where the libraries are gotten from

@bgoglin
Copy link
Contributor

bgoglin commented Jul 1, 2024

Hello

(spoiler: I know nothing about golang)

I see that hwloc gets installed in TARGET_DIR=$EXTERNAL_LIBS_ROOT/hwloc/$ANDROID_ABI hence the lib is under "lib" there while hwloc.h is under "include" there. Can you check that hwloc.h is indeed there? It should since you call "make install".

Then I see -DHWLOC_INCLUDE_DIR="$EXTERNAL_LIBS_ROOT/hwloc/$ANDROID_ABI/include " in xmrig-build.sh. But that variable isn't used anywhere else? Or is cmake clever enough to understand where it has be passed to the compiler? In the end, you should run a "verbose" build to see entire compile lines and check whether there's a -I parameter with the hwloc include dir.

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