[esp-r] Re: Compiling on MacOS 26.5+

Gian Luca Brunetti gianluca.brunetti at polimi.it
Wed Aug 12 11:11:01 BST 2026


Thank you very much Daniel!
Best
Gian Luca


Gian Luca Brunetti
Associate Professor
Arch. PhD
Politecnico di Milano
DAStU - Dipartimento di Architettura e Studi Urbani / Department of Architecture and Urban Studies
via Bonardi 3, edificio 12 / building 12
20133 Milano
tel. (+39) 02 2399 5750
cell. (+39) 3358040808
email: gianluca.brunetti at polimi.it

________________________________
From: Daniel Costola <daniel.costola at strath.ac.uk>
Sent: Wednesday, August 12, 2026 11:34 AM
To: Gian Luca Brunetti <gianluca.brunetti at polimi.it>; achim.geissler <achim.geissler at acatalepsy.ch>; esp-r at lists.strath.ac.uk <esp-r at lists.strath.ac.uk>
Subject: Re: [esp-r] Re: Compiling on MacOS 26.5+

Dear Achim and Gian Luca,

Instructions to compile ESP-r on MacOS were updated ​in the documentation last year for version 13.3.18:
https://appdocs.esru.strath.ac.uk/books/introduction-to-esp-r/page/macos-compile-from-source-on-apple-silicon-processors

I am not a MacOS user myself, but the instructions were checked by a few MSc students and seem to work.

Please you feel free to amend them on the appdocs platform as you see fit.

Thank you in advance
Daniel



________________________________
From: esp-r-bounces at lists.strath.ac.uk <esp-r-bounces at lists.strath.ac.uk> on behalf of Gian Luca Brunetti <gianluca.brunetti at polimi.it>
Sent: Sunday, August 09, 2026 20:12
To: achim.geissler <achim.geissler at acatalepsy.ch>; esp-r at lists.strath.ac.uk <esp-r at lists.strath.ac.uk>; Joe Clarke <joe at esru.strath.ac.uk>
Subject: [esp-r] Re: Compiling on MacOS 26.5+


Dear all,

thank you Professor Clarke for correcting update_notes.txt.

Achim, good to know that the -std=gnu17 workaround also works with 13.3.17 on your M2 Mac.

On Ubuntu, after forcing GNU C17, the X11 part compiled and ESP-r installed successfully. I did not encounter the additional issues you are seeing with 13.3.18 on macOS.

Thanks also for sharing the Mac-specific changes to Install.

Best
Gian Luca




Gian Luca Brunetti
Politecnico di Milano
DAStU- Department of Architecture and Urban Studies / Dipartimento di Architettura e Studi Urbani
via Bonardi 3, building 12
20133 Milano
tel. (+39) 02 2399 5750
cell. (+39) 335 8040808
email: gianluca.brunetti at polimi.it
________________________________
From: achim.geissler <achim.geissler at acatalepsy.ch>
Sent: Sunday, August 9, 2026 4:02 PM
To: Gian Luca Brunetti <gianluca.brunetti at polimi.it>; esp-r at lists.strath.ac.uk <esp-r at lists.strath.ac.uk>
Subject: Re: [esp-r] Compiling on MacOS 26.5+

Hi Gian Luca,

your fix works fine for V13.3.17 on MacOS 26.6 (M2) using (brew installed) gcc-16 which seems to correspond to MacOSX26.sdk (-std=gnu17 does not cause an issue). X is fired up as expected (I haven’t run any test on actual functionality, yet, though).

On MacOS, I need some additional changes to ‘Install' due to the non-editable /usr/ directory on macs (line-numbers refer to modified Install), given here for anybody interested (I use brew for any “Linux” packages):

Approx. line 340 ff:

   else

    xml_libs_found="yes"

    if [ "$machine" = "arm64" ]; then

        LIBXML2_INCLUDE="-I/opt/homebrew/opt/libxml2/include/libxml2 -I/opt/homebrew/opt/libxslt/include/libxslt"

    else

        LIBXML2_INCLUDE="-I/usr/include -I/usr/include/libxml2 -I/usr/local/include/libxml2 -I/usr/include/libxslt -I/local/include/libxslt"

    fi

Approx. line 804 ff:

case $platform in

  mac)

      localinclude="-I/opt/homebrew/include"

      ;;

  *)  localinclude="-I/usr/local/include" ;;

esac


LOCAL_INCLUDES="-I../include -I../shocc ${localinclude} -I../cetc/h3kreports"

Sadly it seems that between V.17 and V.18 changes in the X code break the X-connection for MacOS. During compile, for V.18 the header file mntext.h and others are missing. I found these in package 'brew install emscripten’ (compiler toolchain to WebAssembly) which makes 'mntext.h’, 'bits/alltypes.h' and 'bits/dirent.h’ available. No idea what this is actually necessary for in ESP-r.

For what its worth.

Best
Achim


On 8 Aug 2026, at 23:18, Gian Luca Brunetti <gianluca.brunetti at polimi.it> wrote:

Hi Achim,
I have just encountered a different issue with 13.3.18 on a current Ubuntu system, so I thought I would mention it here in case it is useful to others.
In my case, the installation stopped while building the X11 part of ESP-r, in esru_x.c. With a recent GCC, some old-style C declarations, for example
extern gnwkquery_();
are interpreted differently, which led to errors such as “too many arguments to function”, together with a conflicting declaration of getenv().
I was able to get past this by compiling the C code using GNU C17 semantics, adding
-std=gnu17
to the CFLAGS used by the installer.
The patch I used was:
sed -i '/GNU).*CFLAGS=/ s|";;| -std=gnu17 -Wno-error=implicit-int -Wno-error=implicit-function-declaration";;|' Install
This is a different issue from the update_notes.txt problem you describe, but the workaround might still be worth sharing.
For completeness: I used ChatGPT to formulate the workaround.
Best
Gian Luca


Gian Luca Brunetti
Associate Professor
Arch. PhD
Politecnico di Milano
DAStU - Dipartimento di Architettura e Studi Urbani / Department of Architecture and Urban Studies
via Bonardi 3, edificio 12 / building 12
20133 Milano
tel. (+39) 02 2399 5750
cell. (+39) 3358040808
email: gianluca.brunetti at polimi.it<mailto:gianluca.brunetti at polimi.it>
________________________________
From: esp-r-bounces at lists.strath.ac.uk<mailto:esp-r-bounces at lists.strath.ac.uk> <esp-r-bounces at lists.strath.ac.uk<mailto:esp-r-bounces at lists.strath.ac.uk>> on behalf of achim.geissler <achim.geissler at acatalepsy.ch<mailto:achim.geissler at acatalepsy.ch>>
Sent: Monday, August 3, 2026 9:08 AM
To: esp-r at lists.strath.ac.uk<mailto:esp-r at lists.strath.ac.uk> <esp-r at lists.strath.ac.uk<mailto:esp-r at lists.strath.ac.uk>>
Subject: [esp-r] Compiling on MacOS 26.5+

Hi all,

after some time, I wanted to update my ESP-r version on my M2 Mac w/ MacOS 26.5 (soon .6) to the current latest, 13.3.18 from May 2025.

Compiling was possible after quite a struggle, however, there seems to be a problem with the “update_notes.txt” which is downloaded at startup to check if the most recent version is installed. As far as I could see, an (MacOS) “EOF” or similar is inserted prior to the 13.3.18 changes listing and this leads to an error "EMENU: EOF detected, error in input command.” which itself possibly makes firing up of X broken.

Who - currently - is managing the ESP-r code? I would be interested in getting the 13.3.17 archive (my latest successful installation was 13.3.16) to make sure there is no gap in my source tree.

Also, it would be nice if somebody at ESRU could check the current “update_notes.txt” and make sure no undesired characters inadvertently made their way into it.

Thanks.
Best
Achim

achim.geissler at acatalepsy.ch<mailto:achim.geissler at acatalepsy.ch>


achim.geissler at acatalepsy.ch



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.strath.ac.uk/archives/esp-r/attachments/20260812/684c2848/attachment-0001.html 


More information about the esp-r mailing list