# Garfield++ arm64 architecture problem

**URL:** <https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023>\
**Category:** Garfield++\
**Created:** [April 16, 2024, 3:17pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023 "2024-04-16T15:17:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![elisa\_gabbrielli](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/elisa_gabbrielli/32/36227_2.png) [@elisa\_gabbrielli](https://root-forum.cern.ch/u/elisa_gabbrielli)\
**Post date:** [April 16, 2024, 3:17pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/1 "2024-04-16T15:17:59Z")

</div>

Hello everyone,

I am trying to install Garfield++ on my M1 MacBook Air running MacOS version Sonoma 14.4.1.  
I followed the Cern guide and, after the download, when the terminal processes the command ’ make -j 4 ’ in the Garfield build directory I eventually get a very long warning which can be summarized with the lines:

[59%] **Linking CXX shared library libGarfield.dylib**

ld: warning: ignoring file ‘/Users/Elisa/Applications/Garfield/build/Magboltz/libmagboltz.11.dylib’: found architecture ‘arm64’, required architecture ‘x86\_64’

ld: warning: ignoring file ‘/Users/Elisa/Applications/Garfield/build/Degrade/libdegrade.3.dylib’: found architecture ‘arm64’, required architecture ‘x86\_64’

Undefined symbols for architecture x86\_64:

[…]

ld: symbol(s) not found for architecture x86\_64

clang: **error:** **linker command failed with exit code 1 (use -v to see invocation)**

make[2]: \*\*\* [libGarfield.0.3.0.dylib] Error 1

make[1]: \*\*\* [CMakeFiles/Garfield.dir/all] Error 2

make: \*\*\* [all] Error 2

Am I doing something wrong? How can I fix this?

Thank you.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [April 16, 2024, 3:23pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/2 "2024-04-16T15:23:10Z")

</div>

Adding @hschindl in the loop.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [April 16, 2024, 4:14pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/3 "2024-04-16T16:14:52Z")

</div>

Hi,  
not sure… What compiler are you using and from where/how did you get ROOT?

---

<div class="post-metadata">

**Author:** ![elisa\_gabbrielli](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/elisa_gabbrielli/32/36227_2.png) [@elisa\_gabbrielli](https://root-forum.cern.ch/u/elisa_gabbrielli)\
**Post date:** [April 16, 2024, 4:46pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/4 "2024-04-16T16:46:01Z")

</div>

For the compiler, the clang version is clang-1500.3.9.4.  
I am not sure about ROOT but I can find it in the homebrew directory so I guess I used homebrew.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [April 17, 2024, 8:10am UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/5 "2024-04-17T08:10:25Z")

</div>

Hm, no idea why the linker expects x86. @mato do you have any idea?

---

<div class="post-metadata">

**Author:** ![elisa\_gabbrielli](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/elisa_gabbrielli/32/36227_2.png) [@elisa\_gabbrielli](https://root-forum.cern.ch/u/elisa_gabbrielli)\
**Post date:** [April 20, 2024, 2:48pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/6 "2024-04-20T14:48:21Z")

</div>

In the end I managed to solve the problem. It was related to the gfortran compiler: it was trying to use a compiler compatible with the architecture arm64 while all root libraries are built for x86-64 architecture. So I just had to use the correct fortran compiler.

Thank you anyway!

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [April 20, 2024, 3:03pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/7 "2024-04-20T15:03:13Z")

</div>

Great! Out of curiosity: from where did you get gfortran? Homebrew?

---

<div class="post-metadata">

**Author:** ![elisa\_gabbrielli](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/elisa_gabbrielli/32/36227_2.png) [@elisa\_gabbrielli](https://root-forum.cern.ch/u/elisa_gabbrielli)\
**Post date:** [April 20, 2024, 3:52pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/8 "2024-04-20T15:52:20Z")

</div>

I am not sure, since my computer happened to actually have three different gfortran compiler and only one of those was of the correct architecture. It is called x86\_64-apple-darwin23-gfortran-13 don’t know if this can help

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 4, 2024, 3:52pm UTC](https://root-forum.cern.ch/t/garfield-arm64-architecture-problem/59023/9 "2024-05-04T15:52:41Z")

</div>

Closed on May 4, 2024, 3:52pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
