Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28613 ディスカッション

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

joesch
初心者
126,089件の閲覧回数

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 解決策
joesch
初心者
125,933件の閲覧回数

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 

元の投稿で解決策を見る

17 返答(返信)
Steve_Lionel
名誉コントリビューター III
126,036件の閲覧回数

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
初心者
125,970件の閲覧回数

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
初心者
125,966件の閲覧回数

In my case gfortran does work...

 

joesch
初心者
125,965件の閲覧回数

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

Jose_T_Galvez
初心者
125,955件の閲覧回数

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
初心者
125,943件の閲覧回数

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

joesch
初心者
125,934件の閲覧回数

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
ビギナー
124,769件の閲覧回数

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
初心者
124,760件の閲覧回数

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_
ビギナー
121,564件の閲覧回数

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
名誉コントリビューター III
121,544件の閲覧回数

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

 
Tiberiu
ビギナー
24,599件の閲覧回数

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
モデレーター
126,025件の閲覧回数

what version of Xcode is installed?

Jose_T_Galvez
初心者
125,983件の閲覧回数

I have exactly the same issue and have Xcode 12.2 installed

Ron_Green
モデレーター
24,564件の閲覧回数

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
ビギナー
24,542件の閲覧回数

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
モデレーター
24,400件の閲覧回数

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

返信