c0mm4nd / GxMiner

GxMiner is a highly optimized miner for random-x series algorithm
23 stars 12 forks source link

Cross compilation, make linker recognize hwloc #12

Open 0xffffa opened 6 days ago

0xffffa commented 6 days ago

First I would like to start off by starting thank you for spending your free time in improving and helping others in this library. People like you are the reason why I do the same and wish to continue to grow open source code.

That being said, I do have one issue that I'm having trouble fixing due to me being inexperienced with cross compilation toolchains.

Currently I get the error below, even though for the architecture I'm trying to compile for (android arm64) I have built the hwloc library for. 'hwloc.h' file not found

How can I make golang recognize hwloc libraries I've built for the specific architecture? I've tried using CFLAGS and LDFlags with no affect

c0mm4nd commented 2 days ago

Cross-compilation with CGO is a complex task. Besides golang, you need a target-platform compatible GCC and static-lib (like hwloc) compiled with the compatible GCC.

image

image (Or compile from github source code by yourself)

Another simpler solution is to try to finish go build on your Android device with terminal software like Termux.