Author Topic: problem with -lSystem in MAC Catalina  (Read 8161 times)

Roberto

  • New Member
  • *
  • Posts: 2
problem with -lSystem in MAC Catalina
« on: April 09, 2020, 01:35:21 PM »
Hello,

I am trying to set up FEAP 8.4 in my new Mac with Catalina 10.15.3. I am using gfortran 8.2.0 and Xcode 11.4. The loader option is:

LDOPTIONS = -L/usr/X11R6/lib   -lX11 -lm

However, I have the following error:

   -L/usr/X11R6/lib   -lX11 -lm
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status


Has anyone had this problem?

Thanks in advance!
Roberto

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: problem with -lSystem in MAC Catalina
« Reply #1 on: April 09, 2020, 05:49:16 PM »
I don't have catalina on my computer yet but I do know that we do not explicitly load -lSystem so I am at a loss.   One possible thought is there is a conflict with the X11 library and the one in /usr/X11R6/lib is not the one you want.  Maybe first look to see what is in /usr/X11R6/lib?  Also look for /usr/X11/lib that may be the correct path.

Hopefully another user is already using the code on Catalina and give better help.

I assume that you can compile and run simple fortran programs already; i.e. independent of FEAP?  What about ones with -lm on the link line?  Ones with -lX11 on the link line?


Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1160
Re: problem with -lSystem in MAC Catalina
« Reply #3 on: April 09, 2020, 11:44:52 PM »
It seems -lSystem is the standard C library on the mac.

Quote
libSystem (-lSystem)  Standard C library functions.  When using the C
                           compiler cc(1), it is not necessary to supply the
                           loader flag -lSystem for these functions.  There
                           are several `libraries' or groups of functions
                           included inside of libSystem: the standard I/O rou-tines, routines,
                           tines, database routines, bit operators, string
                           operators, character tests and character operators,
                           des encryption routines, storage allocation, time
                           functions, signal handling and more.

                           For compatibility with other systems, which provide
                           these capabilities in separate libraries (such as
                           libc), symbolic links are provided for -lc, -ldbm,
                           -ldl, -linfo, -lm, -lpoll, -lpthread and -lrpcsvc;
                           they all point to libSystem.


 Some other posts that I have seen say that it is necessary to re-install your compilers, so for example 'brew rebuild gcc' (not brew upgrade gcc but rebuild).

Roberto

  • New Member
  • *
  • Posts: 2
Re: problem with -lSystem in MAC Catalina
« Reply #4 on: April 10, 2020, 01:18:27 AM »
What about this post that I found?

----
Adding "-L/usr/lib" solves the problem.

Also downgrading from Xcode 11.0 to Xcode 10.3 solves the problem! Note: I also checked Xcode 11.1 which just came out but the problem still exists with 11.1.

Note added: Another programmer informs me that upgrading to OSX 10.15 solves the problem. So this is an incompatibility between OSX 10.14 and Xcode 11.
----

I have tried with -L/usr/lib but doesn't work. Maybe I have to downgrading to Xcode 10.3