Hello! I'm trying to compile some custom code on device which links to libpthread and librt.
Unfortunately, there seems to be no such files in the system, despite opkg says both libpthread and librt are installed.
I checked these packages:
opkg files libpthread
which shows 0 files, same for librt. The only pthread-related file is a header in /usr/include/pthread.h
Is this a limitation of musl libc library? Is it possible to switch to full glibc in a custom build? If not, what will be a compatible linking command for musl?
I'm running OpenWrt 19.07.5 on Xiaomi MIR3G (MediaTek MT7621)
These empty stubs would just take space for no purpose. Since we do not officially support on-target compilation, it makes no sense at all to ship static library stubs. For the same reason we're not shipping header files etc.
Ok, thanks for the help. Is there a thread / some notes on native compilation?
I would need to do it to use some python libraries available through pip, which are
unlikely to be ported to routers. Setting a buildroot with pip seems more pain than
figuring out native compilation
Another issue I'm facing now are correct headers for floating point operations
Here you are mistaken, OpenWrt isn't built with native compilation in mind at all - sure, you could retrofit that, at which point you'd be very intimately familiar with buildroot (packaging up a couple of python packages for buildroot is peanuts in comparison).
Ok, looks like this was easier than I thought. Did not test if the code works, but at least it compiles. Here is an instruction how to compile Numpy 1.19.4 natively
First, you will need to mount large storage instead of the built in (extroot), as described here
This needs testing, I don't know if all fp exceptions work correctly in Numpy
7) set pip temporary locations to your large storage, otherwise it will overflow RAM: