<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><b class="">SOLVED! Why it is using x86_64 not arm64</b><div class=""><br class=""></div><div class="">I had, for the first time since using my M1, started the day using cool-retro-term, having just installed it...., during the course of diving into my problem, I did this in the console:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">    $ arch</font></div><div class=""><font face="Menlo" class="">    i386</font></div><div class=""><br class=""></div><div class="">Whaaaaaaaaaat?</div><div class=""><br class=""></div><div class="">Turns out that the brew install is running an intel build using Rosetta and this is of course picked up by the build system, excitedly I ran iTerm2 (M1 version)...</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">    $ arch</font></div><div class=""><font face="Menlo" class="">    arm64</font></div><div class=""><br class=""></div><div class="">Phew! And yes my code now builds again.... so the lesson learned is make sure you aren't running Rosetta code when using compiler tools, unless you --want-- to be in i86 mode I guess!</div><div class=""><br class=""></div><div class="">Thanks all.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 18 Jun 2022, at 12:44, Sean Charles (emacstheviking) <<a href="mailto:objitsu@gmail.com" class="">objitsu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Rebuilding from scratch is exactly how the problem manifested itself in the first place.<div class="">The distribution of mercury on my machine was built from source on M1, without issue.</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">Mercury Compiler, version 22.01.1, on aarch64-apple-darwin21.4.0</font></div><div class=""><font face="Menlo" class="">Copyright (C) 1993-2012 The University of Melbourne</font></div><div class=""><font face="Menlo" class="">Copyright (C) 2013-2022 The Mercury team</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I am not sure why you suggest to install Pandoc using intel architecture as I am using an M1 ARM processor, Pandoc installed fine but since then Mercury will not link.</div><div class=""><br class=""></div><div class="">It's almost as though some setting somewhere has changed such that the linker thinks the default machine architecture is intel not arm64. </div><div class=""><br class=""></div><div class="">Very annoying, a complete blocker for me, but as always with times like this... a learning opportunity!</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Sean.</div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 18 Jun 2022, at 10:06, Volker Wysk <<a href="mailto:post@volker-wysk.de" class="">post@volker-wysk.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Am Samstag, dem 18.06.2022 um 08:43 +0100 schrieb Sean Charles (emacstheviking):</div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; margin: 0px 0px 0px 0.8ex; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(114, 159, 207); padding-left: 1ex;" class="">Hi,<div class=""><br class=""></div><div class="">I wondered if anybody had seen this and knew how to deal with it... for weeks I've been happily developing my program with Mercury on my new M1 macMini, but this morning I needed to install Pandoc using brew, but in order for it to work I had to use this command line, found from googling it:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">    $ arch -arm64 brew install pandoc</font></div><div class=""><br class=""></div><div class="">I tested pandoc with a small markdown to pdf run and it was fine, then I attempted to rebuild my application and for the first time ever I got this error:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">ld: warning: ignoring file /usr/local/mercury-22.01.1/lib/mercury/lib/libgc.dylib, building for macOS-x86_64 but attempting to link</font></div><div class=""><font face="Menlo" class=""> with file built for macOS-arm64</font></div><div class=""><font face="Menlo" class="">ld: warning: ignoring file /usr/local/mercury-22.01.1/lib/mercury/lib/hlc.gc/libmer_std.dylib, building for macOS-x86_64 but attemp</font></div><div class=""><font face="Menlo" class="">ting to link with file built for macOS-arm64</font></div><div class=""><font face="Menlo" class="">ld: warning: ignoring file /usr/local/mercury-22.01.1/lib/mercury/lib/hlc.gc/libmer_rt.dylib, building for macOS-x86_64 but attempt</font></div><div class=""><font face="Menlo" class="">ing to link with file built for macOS-arm64</font></div><div class=""><font face="Menlo" class="">Undefined symbols for architecture x86_64:</font></div><div class=""><font face="Menlo" class="">  "_GC_init", referenced from:</font></div><div class=""><font face="Menlo" class="">      _init_gc in mlpt_init.o</font></div><div class=""><font face="Menlo" class="">  "_GC_malloc", referenced from:</font></div><div class=""><font face="Menlo" class="">      <predicate 'classifier.classify_line'/3 mode 0> in classifier.o</font></div><div class=""><font face="Menlo" class="">      <predicate 'classifier.classify_file'/4 mode 0> in classifier.o</font></div><div class=""><font face="Menlo" class="">      _cleaner__markdown_out_3_p_0_1 in cleaner.o</font></div><div class=""><font face="Menlo" class="">      <predicate 'splitter.lines_to_blocks'/2 mode 0> in splitter.o</font></div><div class=""><font face="Menlo" class="">      _splitter__lines_to_blocks_2_p_0_1 in splitter.o</font></div><div class=""><font face="Menlo" class="">      <predicate 'weaver.UnusedArgs__pred__code_out__[1]_0'/4 mode 0> in weaver.o</font></div><div class=""><font face="Menlo" class="">      _weaver__duplicate_check_2_p_0_1 in weaver.o</font></div><div class="">      ...</div></div><div class=""><br class=""></div><div class="">The full file is very very long but it seems to somehow think that the default build architecture is intel not arm64. I have tried googling but so far to no avail, it has affected all of my Mercury projects on my machine, the same issue during linking.</div></blockquote><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">This may be a stupid question, but have you tried to rebuild your application from scratch? Something like "make clean; make depend" and then make the application.</div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Or, maybe, try to install pandoc with "<span style="font-family: Menlo;" class="">arch </span><span style="font-family: Menlo;" class="">-x86_64</span><span style="font-family: Menlo;" class=""> brew install pandoc". (That's just guesswork by me.)</span></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Good luck,</div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Volker</div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>