wheybags / wcp

Experimental file copy tool using io_uring
MIT License
198 stars 7 forks source link

Failed to compile on Termux Android #16

Closed T0MuX closed 5 months ago

T0MuX commented 5 months ago

Hi,

I'm using Termux on Android. I would like to install wcp on it, but the compilation fails at the make step. I just followed the readme instructions. Also, I just noticed the readme says "It should work on any kernel >= 5.6" while my Android is using 5.4 version. Maybe it's just that ?

$ uname -a
Linux localhost 5.4.242-qgki-g3f7ff67280a0 #1 SMP PREEMPT Sun Mar 17 23:13:51 HKT 2024 aarch64 Android

The cmake step worked like a charm btw. And then, the make step with errors :

$ make
[ 26%] Built target Uring
[ 31%] Building CXX object CMakeFiles/wcp_lib.dir/src/CopyRunner.cpp.o
In file included from /data/data/com.termux/files/home/git/wcp/src/CopyRunner.cpp:1:
In file included from /data/data/com.termux/files/home/git/wcp/src/CopyRunner.hpp:7:
In file included from /data/data/com.termux/files/home/git/wcp/src/CopyQueue.hpp:9:
In file included from /data/data/com.termux/files/home/git/wcp/src/QueueFileDescriptor.hpp:5:
/data/data/com.termux/files/home/git/wcp/src/Util.hpp:52:25: warning: flexible array members are a C99 feature [-Wc99-extensions]
   52 |     __extension__ char  d_name[]; /* Filename (null-terminated). __extension__ allows use of flexible array members in g++ (normally only allowed in plain C) */
      |                         ^
In file included from /data/data/com.termux/files/home/git/wcp/src/CopyRunner.cpp:1:
In file included from /data/data/com.termux/files/home/git/wcp/src/CopyRunner.hpp:7:
/data/data/com.termux/files/home/git/wcp/src/CopyQueue.hpp:68:47: error: use of undeclared identifier 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP'
   68 |     pthread_mutex_t copiesPendingStartMutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
      |                                               ^
/data/data/com.termux/files/home/git/wcp/src/CopyQueue.hpp:82:42: error: use of undeclared identifier 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP'
   82 |     pthread_mutex_t errorMessagesMutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
      |                                          ^
1 warning and 2 errors generated.
make[2]: *** [CMakeFiles/wcp_lib.dir/build.make:76: CMakeFiles/wcp_lib.dir/src/CopyRunner.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/wcp_lib.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
T0MuX commented 5 months ago

I don't completly understand, but maybe this topic can help ? https://stackoverflow.com/questions/53075327/use-of-undeclared-identifier-pthread-recursive-mutex-initializer-np

wheybags commented 5 months ago

Sorry, neither your kernel version, nor android in specific are supported.