Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27418 Discussions

New macOS Big Sur return "ld: library not found for -lSystem"

joesch
Novice
110,260 Views

I update the newest macOS Big Sur version. But the intel fortran does not work.

The version is "ifort version 19.1.3.301".

1 Solution
joesch
Novice
110,104 Views

The problem is solved when the path to the lib is specified:

ifort xxx.f90  -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

It seems the lib is now not under the default path.

@Ron_Green @Steve_Lionel 

View solution in original post

17 Replies
Steve_Lionel
Black Belt Retired Employee
110,207 Views

I would be astonished if it DID work. New MacOS releases tend to break non-Apple software more often than not; it's even worse than Linux for this.  Did you re-add the XCode command line tools?

xcode-select --install

Historically, Intel has had to make adjustments in the installation to accommodate new MacOS releases. I'm sure that Ron, a "Mac guy", will chime in with his own observations.

joesch
Novice
110,141 Views

I reinstall xcode 12.2. It does not solve the problem.

It seems to be a problem with Mac OS, because gfortran returns the same error.

@Ron_Green 

Jose_T_Galvez
Novice
110,137 Views

In my case gfortran does work...

 

joesch
Novice
110,136 Views

It is interesting. I installed gfortran using miniconda. Maybe it is the problem.

Jose_T_Galvez
Novice
110,126 Views

I solved it in my machine (might not be applicable to yours). I had a problem with Xcode.

Once you have installed Xcode, run:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Then accept the license (only if you previously haven't) by:

sudo xcodebuild -license

Then try running the ifort code again, this worked out for me...

Hope it helps you!

 

joesch
Novice
110,114 Views

Thanks, Jose. I did not install Xcode.app, maybe it is a useful solution. 

joesch
Novice
110,105 Views

The problem is solved when the path to the lib is specified:

ifort xxx.f90  -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

It seems the lib is now not under the default path.

@Ron_Green @Steve_Lionel 

RANCHO
Beginner
108,940 Views

I have same problem!

Thanks for your way, it's very effective 。

But how should I change my configuration envirament get it back normal?

joesch
Novice
108,931 Views

I just write an alias in the .zshrc file.

alias ifort = "ifort -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"

It works fine for me.

Alain_F_
Beginner
105,735 Views

I am using Big Sur 11.2 and ifort 19.1.0.166 .

Command line compilation works without the modification you suggest.

Several of posts quote Xcode. Do you compile with ifort through Xcode ? I thought Intel had dropped the Xcode support for long.

I just bought a renewal of my ifort license and the Installer says "Unsupported version" !!!

Steve_Lionel
Black Belt Retired Employee
105,715 Views

As this post says, Big Sur is supported in the 2021 oneAPI compiler, but not earlier versions.

Intel is no longer supporting doing builds from within Xcode, but you still need it installed. See https://software.intel.com/content/www/us/en/develop/articles/oneapi-fortran-compiler-system-require...

 
Tiberiu
Beginner
8,770 Views

This did work for me in the terminal.

 

However, when I put the following in a makefile, it again cannot find -lSystem:

 

ifort -c xxx.f90

ifor -o xxx *.o -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

rm -f *.o *.mod

 

Do you perhaps have a suggestion for how to make it work in a makefile?

 

Thanks

 

 

 

Ron_Green
Moderator
110,196 Views

what version of Xcode is installed?

Jose_T_Galvez
Novice
110,154 Views

I have exactly the same issue and have Xcode 12.2 installed

Ron_Green
Moderator
8,735 Views

did you run this command

 

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

 

if so, you would not need -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

try removing that -L argument from the ifort command

 

Tiberiu
Beginner
8,713 Views

I ran the command you suggested and it returned

xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'

I did previously do a

xcode-select --install

which if I run again returns

xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Ron_Green
Moderator
8,571 Views

OK there is definitely a bug here with the ifort and icc/icpx Intel drivers. 

Bit of legacy - both compilers USED TO require Xcode installation.  Not just Command Line tools but Xcode AND Command Line tools.  Goes back years and years.  SO the driver, ifort (or icc) ASSUME that Xcode is under /Applications.  If Xcode is NOT there, or is in a different directory (which happens if you open the .xip zip file elsewhere and don't move the .app under /Applications manually) then the compiler cannot find the libs.

The fix would be to assume COMMAND LINE TOOLS and make NO assumption about Xcode.  and path lib searches to the command line tool under /Library/Developer/CommandLineTools.  This is because YOU HAVE TO HAVE COMMAND LINE TOOLS for either ifort or icc to work.  

Let me get working on this.  I'll enter a bug report.  For now manually adding the -L path is a workaround.

 

ron

Reply