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

Building on M1 Mac from source #56

Open
jonathan-bravo opened this issue Apr 20, 2023 · 2 comments
Open

Building on M1 Mac from source #56

jonathan-bravo opened this issue Apr 20, 2023 · 2 comments

Comments

@jonathan-bravo
Copy link

This took me almost all night to figure out so I just wanted to post this as info for anyone else trying to do this.

Use homebrew to install the required libraries

brew install xz zlib bzip2 icu4c
brew link icu4c --force

  • cd EpansionHunterDenovo direcotry
  • mkdir build
  • cd into the build directory
  • run cmake ../source

Modify the line in ExpansionHunterDenovo/source/thirdparty/catch2/catch.hpp:

change line 6014 from:

#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */

To:

#if defined(__i386__) || defined(__x86_64__)
    #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
#elif defined(__aarch64__)
    #define CATCH_TRAP()  __asm__(".inst 0xd4200000")
#endif

Modify the line in build/thirdparty/htslib-1.9-source/cram/cram_io.c

changed the #include <lzma.h> to #include "/opt/homebrew/opt/xz/include/lzma.h"

THEN in the build directory you can run make and the build should complete!

@BenjaminDEMAILLE
Copy link

Thanks a lot

@BenjaminDEMAILLE
Copy link

BenjaminDEMAILLE commented Jan 5, 2025

This took me almost all night to figure out so I just wanted to post this as info for anyone else trying to do this.

Use homebrew to install the required libraries

brew install xz zlib bzip2 icu4c brew link icu4c --force

  • cd EpansionHunterDenovo direcotry
  • mkdir build
  • cd into the build directory
  • run cmake ../source

Modify the line in ExpansionHunterDenovo/source/thirdparty/catch2/catch.hpp:

change line 6014 from:

#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */

To:

#if defined(__i386__) || defined(__x86_64__)
    #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
#elif defined(__aarch64__)
    #define CATCH_TRAP()  __asm__(".inst 0xd4200000")
#endif

Modify the line in build/thirdparty/htslib-1.9-source/cram/cram_io.c

changed the #include <lzma.h> to #include "/opt/homebrew/opt/xz/include/lzma.h"

THEN in the build directory you can run make and the build should complete!

Hi

I tried but got :

benjamin@MacBook-Pro-de-Benjamin build % cmake ../source
CMake Deprecation Warning at thirdparty/boost-cmake-1.67.0/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Warning (dev) at thirdparty/boost-cmake-1.67.0/CMakeLists.txt:7 (set):
  implicitly converting 'DIRECTORY' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Downloading Boost from https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2
-- [download 0% complete]
CMake Error at thirdparty/boost-cmake-1.67.0/cmake/Modules/DownloadBoost.cmake:66 (file):
  file DOWNLOAD cannot compute hash on failed download

    status: [22;"HTTP response code said error"]
Call Stack (most recent call first):
  thirdparty/boost-cmake-1.67.0/CMakeLists.txt:11 (include)


CMake Error at thirdparty/boost-cmake-1.67.0/cmake/Modules/DownloadBoost.cmake:76 (message):
  Download failed.  Status: 22 "HTTP response code said error"

  Log: Host dl.bintray.com:443 was resolved.

  IPv6: (none)

  IPv4: 18.214.194.113, 3.95.117.170, 18.232.172.199

    Trying 18.214.194.113:443...

  Connected to dl.bintray.com (18.214.194.113) port 443

  ALPN: curl offers http/1.1

  (304) (OUT), TLS handshake, Client hello (1):

  [312 bytes data]

   CAfile: /etc/ssl/cert.pem
   CApath: none

  (304) (IN), TLS handshake, Server hello (2):

  [108 bytes data]

  TLSv1.2 (IN), TLS handshake, Certificate (11):

  [3680 bytes data]

  TLSv1.2 (IN), TLS handshake, Server key exchange (12):

  [300 bytes data]

  TLSv1.2 (IN), TLS handshake, Server finished (14):

  [4 bytes data]

  TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

  [37 bytes data]

  TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):

  [1 bytes data]

  TLSv1.2 (OUT), TLS handshake, Finished (20):

  [16 bytes data]

  TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):

  [1 bytes data]

  TLSv1.2 (IN), TLS handshake, Finished (20):

  [16 bytes data]

  SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 / [blank] /
  UNDEF

  ALPN: server accepted http/1.1

  Server certificate:

   subject: CN=*.bintray.com
   start date: Nov 14 00:00:00 2024 GMT
   expire date: Nov  8 23:59:59 2025 GMT
   subjectAltName: host "dl.bintray.com" matched cert's "*.bintray.com"
   issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=GeoTrust TLS RSA CA G1
   SSL certificate verify ok.

  using HTTP/1.x

  GET /boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2 HTTP/1.1

  Host: dl.bintray.com

  User-Agent: curl/8.7.1

  Accept: */*

  

  Request completely sent off

  HTTP/1.1 404 Not Found

  Date: Sun, 05 Jan 2025 09:18:55 GMT

  Content-Type: text/html

  Content-Length: 146

  Connection: keep-alive

  Strict-Transport-Security: max-age=31536000; includeSubDomains

  

  The requested URL returned error: 404

  Closing connection

  TLSv1.2 (OUT), TLS alert, close notify (256):

  [2 bytes data]

Call Stack (most recent call first):
  thirdparty/boost-cmake-1.67.0/CMakeLists.txt:11 (include)


-- Configuring incomplete, errors occurred!
benjamin@MacBook-Pro-de-Benjamin build % 

at = run cmake ../source
Can you help me ?

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

2 participants