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

Installation on ARM server #1804

Closed
Brent-Saylor-Canopy opened this issue Sep 25, 2020 · 6 comments
Closed

Installation on ARM server #1804

Brent-Saylor-Canopy opened this issue Sep 25, 2020 · 6 comments

Comments

@Brent-Saylor-Canopy
Copy link

Hi,

I am trying to install Canu on an ARM system running amazon linux, but I can't get the canu binaries to compile.
I have downloaded the most recent version of Canu from the git repository and tried to use the make file to build the binaries.
I get the following error:

utility/src/utility/align-ssw.C:36:10: fatal error: emmintrin.h: No such file or directory
 #include <emmintrin.h>
          ^~~~~~~~~~~~~

From what I can tell this file is involved in compiling programs for intel systems. Is it possible to install this program on ARM systems?

@skoren
Copy link
Member

skoren commented Sep 26, 2020

No official support for ARM processors and we don't have a system to test on. The code it's complaining about is relatively new, if you use the 2.0 release source it shouldn't have that specific dependency. You can try that but it may hit other ARM incompatibilities. If you do make it compile feel free to open a pull request with the changes.

@simon28li
Copy link

@skoren @Brent-Saylor-Canopy Hi,I also encountered the same problem on the arm machine. It is a pity that I do not have relevant development experience. Will I consider a plan to support arm in the future?

@outpaddling
Copy link

https://pine64.com/product/rockpro64-4gb-single-board-computer/

I actually use a 1 GiB Rock64 with an emmc module to test FreeBSD ports on aarch64. Not a speed demon, but it gets the job done. Canu doesn't take long to build, so should be no problem here. Of course you'll be limited to very small test cases, but that's usually good enough to ensure operation on bigger data.

@outpaddling
Copy link

The patches below are sufficient to build 2.1 on aarch64 and powerpc64, FreeBSD 13.0, clang 11.

2.2 is a more complicated matter. I found that parasail builds separately on amd64, aarch64, and powerpc64 without a hiccup. The parasail configure script detects the CPU architecture and attempts to optimize the build accordingly. If canu could link to a separate parasail installation, the cpuid.c errors mentioned in #2016 would be resolved. However, it looks like a subset of the parasail sources for x86 were integrated into the canu build system instead.

--- stores/libsnappy/snappy.cc.orig     2021-12-17 23:40:42 UTC
+++ stores/libsnappy/snappy.cc
@@ -40,7 +40,8 @@
 #endif
 
 #if SNAPPY_HAVE_SSE2
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include <simde/x86/sse2.h>
 #endif
 #include <stdio.h>
 
--- utgcns/libboost/boost/smart_ptr/detail/sp_counted_impl.hpp.orig     2021-12-18 00:17:43 UTC
+++ utgcns/libboost/boost/smart_ptr/detail/sp_counted_impl.hpp
@@ -26,6 +26,7 @@
 
 #include <boost/checked_delete.hpp>
 #include <boost/smart_ptr/detail/sp_counted_base.hpp>
+#include <boost/detail/sp_typeinfo.hpp>
 
 #if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
 #include <boost/smart_ptr/detail/quick_allocator.hpp>
--- utility/src/utility/align-ssw.C.orig        2021-12-17 23:37:21 UTC
+++ utility/src/utility/align-ssw.C
@@ -33,7 +33,8 @@
  */
 
 //#include <nmmintrin.h>
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include <simde/x86/sse2.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
--- utility/src/utility/align-ssw.H.orig        2021-12-17 23:38:08 UTC
+++ utility/src/utility/align-ssw.H
@@ -33,8 +33,8 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>
-#include <emmintrin.h>
-
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include <simde/x86/sse2.h>
 
 #define MAPSTR "MIDNSHP=X"
 #ifndef BAM_CIGAR_SHIFT

@outpaddling
Copy link

outpaddling commented May 20, 2023

As an alternative, I eliminated the need for SIMDE by hacking cpuid.c as shown below. I've incorporated these into the FreeBSD port and a pkgsrc package, which builds on Apple Silicon. In theory, the pkgsrc package should work on any POSIX OS running on x86, ARM64, or Power64, but I've only tested it on NetBSD x86, Alma x86, macOS x86, and macOS ARM.

The only testing I've done was to run the e-coli data in the quickstart in my Mac M1.
https://canu.readthedocs.io/en/latest/quick-start.html

Users can install pkgsrc on a Mac very easily using auto-pkgsrc-setup:

http://netbsd.org/~bacon/

Then

cd $PREFIX/biology/canu
sbmake install

Pkgsrc also hacks in OpenMP support, which is crippled in Xcode compilers.

// ARM
/**
 * @file
 *
 * @author jeffrey.daily@gmail.com
 *
 * Copyright (c) 2015 Battelle Memorial Institute.
 *
 * For non-intel platforms, stub out the intel feature tests.
 */
#include "config.h"

#include "parasail/cpuid.h"

int parasail_can_use_avx512vbmi()
{
    return 0;
}

int parasail_can_use_avx512bw()
{
    return 0;
}

int parasail_can_use_avx512f()
{
    return 0;
}

int parasail_can_use_avx2()
{
    return 0;
}

int parasail_can_use_sse41()
{
    return 0;
}

int parasail_can_use_sse2()
{
    return 0;
}

int parasail_can_use_altivec()
{
    return 0;
}

int parasail_can_use_neon()
{
#if HAVE_NEON
    return 1;
#else
    return 0;
#endif
}
// PowerPC
/**
 * @file
 *
 * @author jeffrey.daily@gmail.com
 *
 * Copyright (c) 2015 Battelle Memorial Institute.
 *
 * For non-intel platforms, stub out the intel feature tests.
 */
#include "config.h"

#include "parasail/cpuid.h"

int parasail_can_use_avx512vbmi()
{
    return 0;
}

int parasail_can_use_avx512bw()
{
    return 0;
}

int parasail_can_use_avx512f()
{
    return 0;
}

int parasail_can_use_avx2()
{
    return 0;
}

int parasail_can_use_sse41()
{
    return 0;
}

int parasail_can_use_sse2()
{
    return 0;
}

int parasail_can_use_altivec()
{
#if HAVE_ALTIVEC
    return 1;
#else
    return 0;
#endif
}

int parasail_can_use_neon()
{
    return 0;
}

@skoren
Copy link
Member

skoren commented Jan 8, 2024

Redundant with #2271, Canu should build on arm64 systems now.

@skoren skoren closed this as completed Jan 8, 2024
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

4 participants