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

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

joesch
Novice
122,454 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
122,298 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
Honored Contributor III
122,401 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
122,335 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 

0 Kudos
Jose_T_Galvez
Novice
122,331 Views

In my case gfortran does work...

 

0 Kudos
joesch
Novice
122,330 Views

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

0 Kudos
Jose_T_Galvez
Novice
122,320 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
122,308 Views

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

0 Kudos
joesch
Novice
122,299 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
121,134 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?

0 Kudos
joesch
Novice
121,125 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
117,929 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" !!!

0 Kudos
Steve_Lionel
Honored Contributor III
117,909 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-requirements.html#inpage-nav-2-2

 
0 Kudos
Tiberiu
Beginner
20,964 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

 

 

 

0 Kudos
Ron_Green
Moderator
122,390 Views

what version of Xcode is installed?

0 Kudos
Jose_T_Galvez
Novice
122,348 Views

I have exactly the same issue and have Xcode 12.2 installed

0 Kudos
Ron_Green
Moderator
20,929 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

 

0 Kudos
Tiberiu
Beginner
20,907 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
0 Kudos
Ron_Green
Moderator
20,765 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