tlemane / kmtricks

modular k-mer count matrix and Bloom filter construction for large read collections
GNU Affero General Public License v3.0
76 stars 7 forks source link

compilation error on EC2 #20

Closed rchikhi closed 2 years ago

rchikhi commented 2 years ago

Error I get when compiling kmtricks on a fresh EC2 server:

In file included from /mnt/1/kmtricks/include/kmtricks/howde_utils.hpp:32,
                 from /mnt/1/kmtricks/include/kmtricks/task.hpp:36,
                 from /mnt/1/kmtricks/include/kmtricks/cmd.hpp:37,
                 from /mnt/1/kmtricks/src/kmtricks.cpp:24:
/mnt/1/kmtricks/thirdparty/cfrcat/include/cfrcat/cfrcat.hpp: In function ‘uint64_t cfr::concat(int, int)’:
/mnt/1/kmtricks/thirdparty/cfrcat/include/cfrcat/cfrcat.hpp:124:10: error: ‘copy_file_range’ was not declared in this scope
   return copy_file_range(in_fd, NULL, out_fd, &offset, size, 0);

system:

$ uname -ar
Linux ip-xxx.us-west-2.compute.internal 5.10.130-118.517.amzn2.x86_64 #1 SMP Wed Jul 13 16:51:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
$ cmake --version
cmake3 version 3.13.1
$ /usr/lib64/libc.so.6
GNU C Library (GNU libc) stable release version 2.26, by Roland McGrath et al.
rchikhi commented 2 years ago

and binaries are also not compatible:

$ kmtricks-v1.2.1-bin-Linux/bin/kmtricks
Illegal instruction
rchikhi commented 2 years ago

Ah, this is possibly a libc issue (for copy_file_range). Amazon Linux's libc is 2.26 and as per https://www.gnu.org/software/gnulib/manual/html_node/copy_005ffile_005frange.html:

This function exists only on Linux and FreeBSD and is therefore missing on many non-glibc platforms: glibc 2.26 [..]

rchikhi commented 2 years ago

Thus, I suspect there is no way to fix (as upgrading libc on EC2 seems.. tricky). Installing using conda worked, and thus seems to be the only way to get kmtricks working on that system. Feel free to close this issue.

tlemane commented 2 years ago

Thank you for reporting that. A workaround is already implemented for macOS, I will make a change in the next release to use the same implementation on non-glibc systems.