Author Topic: x11u.c compile error on new Macs  (Read 11115 times)

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
x11u.c compile error on new Macs
« on: November 11, 2020, 01:27:28 PM »
If you are using the built in Mac gcc on a newer Mac it is likely Apple's clang compiler version 12.0.0 or higher.  This causes an error in compiling x11u.c that does not occur with GNU's gcc compiler.  Something to the effect
Code: [Select]
error: implicit declaration of function 'plstop_' is invalidTo fix the problem you can patch x11u.c.  Go to function gdx11_refresh_digwin( ) and after the declarations, roughly line 253, add the following additional declaration
Code: [Select]
void plstop_();This should fix the error

fethio

  • Jr. Member
  • **
  • Posts: 47
Re: x11u.c compile error on new Macs
« Reply #1 on: April 24, 2022, 04:34:24 PM »
Dear Prof. Govindjee,

I am new to macOS and having difficulty compiling FEAP version 8.6.1k due to a similar issue with x11u.c. The error message during compile on a macbookpro running macos Monterey 12.3.1 is given below.

Quote
x11u.c:69:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.
make[2]: *** [/Users/fethi/oscmw/feap/Feap8_6g.a(x11u.o)] Error 1

The makefiles I used are attached. The symbolic links under /usr/X11 and /usr/X11R6 seem to be empty. Moreover the Xlib.h seems to be located under

Quote
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/Xlib.h

which is an absurd location. When that line is included in the CINCLUDE statement in makefile.in, that does solve the issue but produce additional errors related with some other lines in the x11u.c.

I would appreciate any advise regarding the resolution of this issue,

Fethi
« Last Edit: April 24, 2022, 04:37:50 PM by fethio »

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: x11u.c compile error on new Macs
« Reply #2 on: April 24, 2022, 05:34:07 PM »
I have not tried to install on a machine with Monterey yet but plan to do so this week.  I will let you know what I figure out.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: x11u.c compile error on new Macs
« Reply #3 on: April 24, 2022, 05:34:46 PM »
One quick question however, did you install the developer tools for X?
« Last Edit: April 24, 2022, 09:41:48 PM by Prof. S. Govindjee »

fethio

  • Jr. Member
  • **
  • Posts: 47
Re: x11u.c compile error on new Macs
« Reply #4 on: April 24, 2022, 11:27:04 PM »
I don't think I did that  ;D
you mean developer tools found in Xcode, right?
« Last Edit: April 24, 2022, 11:45:44 PM by fethio »

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: x11u.c compile error on new Macs
« Reply #5 on: April 25, 2022, 12:18:42 AM »
You will want the developer tools, the command line developer tools, and you will also want to install the x11 libraries and headers, for example using brew.

fethio

  • Jr. Member
  • **
  • Posts: 47
Re: x11u.c compile error on new Macs
« Reply #6 on: April 25, 2022, 12:42:25 AM »
Thank you very much for the help. I was able to resolve the issue by loading the X libraries and headers found in the xquartz package using homebrew. (https://www.flagsoft.com/cmswp/en/support/kb/running-x11-applications-on-mac-os-x/)

Note that the Xcode package was not required for the compile to proceed (though I am going to download and install that).
« Last Edit: April 25, 2022, 02:38:35 AM by fethio »