Upgrade ffmpeg (or rust) on OSX 10.12 cannot find make - macos

Trying to brew upgrade ffmpeg on OSX 10.12 Sierra but when it arrived to install rust I had the following error:
make: error: unable to find utility "make", not a developer tool or in PATH
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk" cannot be located.
clang: error: unable to find utility "clang", not a developer tool or in PATH
But which make gives /usr/bin/make and xcrun make is recognized and
ls -l /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk gives
lrwxr-xr-x 1 root wheel 10 Dec 21 2017 /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -> MacOSX.sdk
How can I force the rust install to use /usr/bin/make instead of the XTools one? Or something else.
EDIT
I have rustc 1.46.0 which is the dependency that Homebrew wants ./configure --prefix=/usr/local/Cellar/rust/1.46.0 --release-channel=stable

Edit the Homebrew formulae
brew edit rust
and comment the line
ENV["SDKROOT"] = MacOS.sdk_path
then Rust can be installed (it's quite long).

Related

Why my Make file doesn't compiling in Mac and display ld: library not found for -lSystem? [duplicate]

I am getting a strange error when trying to compile a simple fortran-90 file using gfortran. I am working on a macOS mojave system. I have gfortran 8.2.0 installed and I checked to be sure of this by doing the following:
Input: gfortran --version
Output: GNU Fortran (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Which indicates that gfortran installed correctly and I also confirmed this by typing simply: gfortran, into the terminal, which returns:
gfortran: fatal error: no input files
compilation terminated.
However, when I try to compile my file like so:
gfortran hello.f90 -o hello.x
I get an error which reads:
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
I've tried compiling in different ways and I also tried setting the LD_LIBRARY_PATH in .bash_profile as described by https://gcc.gnu.org/wiki/GFortranBinaries32Linux but I still get the same error. The gfortran directory has the pathname: /usr/local/gfortran, however another gfortran which is not a directory can be found in /usr/local/bin
Typing:
which gfortran
Outputs:
/usr/local/bin/gfortran
And a long list search of this directory:
Input: ls -l /usr/local/bin/gfortran
Output: lrwxr-xr-x 1 root wheel 32 15 May 14:07
/usr/local/bin/gfortran -> /usr/local/gfortran/bin/gfortran
How can I fix this where everything seems to be correctly installed?
Any help would be greatly appreciated!
On macOS Big Sur v11.1:
Relevant SO post: https://apple.stackexchange.com/questions/408999/gfortran-compiler-error-on-mac-os-big-sur
The fix is to add the stdlib to your $LIBRARY_PATH. For some reason or another it isn't in your standard $PATH anymore on 11.1.
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
(or add it to login file and restart terminal).
I added this to my ~/.profile:
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
And it works.
I'll also chime in (19 Dec 2020) that I just updated from MacOS Mojave to Catalina and suddenly got this error.
It resolved itself with
brew reinstall gcc
brew reinstall gfortran
Update: I tried what was suggested and installed the gfortran build from the gcc package using homebrew which gave me a newer version of gfortran and my problem was fixed!
I had the same problem, but installing gfortran build from the gcc package using homebrew did not help. Instead, I installed the whole gcc using homebrew:
brew install gcc
and that solved the problem.
For those using MacPorts.
# Installed `gcc8` and `gcc_select`
sudo port install gcc_select gcc8
# then to create "gfortran" softlink to "gfortran-mp-8"
sudo port select --set gcc gcc8
# and added to my .profile
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
I did ls -l /Library/Developer/CommandLineTools/SDKs/ and found that Xcode had installed one SDK for Catalina and one for Big Sur. I changed the soft link for MacOSX.sdk to point to the Catalina version.
Just placed this line at the end of .zshrc:
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
and ran my Fortran code again to compile – success! The issue with -lSystem has been solved in my macOS system.
I had this problem, and I'd tried lots of thing to solve the problem, but only using these "both" commands solved it:
brew reinstall gcc
brew reinstall gfortran
I recently had this
ld: library not found for -lSystem
problem after upgrading Mac OS from v10 to v11 (Big Sur). I am using Xcode 12.3 and I used brew install gcc to install gfortran 10.2.0. I still saw the error after trying brew reinstall gcc. I was able to solve the problem using:
brew install gfortran
but I do not know why this works.

library not found for -lSystem - M1 MacBook - Radmc3d [duplicate]

I am getting a strange error when trying to compile a simple fortran-90 file using gfortran. I am working on a macOS mojave system. I have gfortran 8.2.0 installed and I checked to be sure of this by doing the following:
Input: gfortran --version
Output: GNU Fortran (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Which indicates that gfortran installed correctly and I also confirmed this by typing simply: gfortran, into the terminal, which returns:
gfortran: fatal error: no input files
compilation terminated.
However, when I try to compile my file like so:
gfortran hello.f90 -o hello.x
I get an error which reads:
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
I've tried compiling in different ways and I also tried setting the LD_LIBRARY_PATH in .bash_profile as described by https://gcc.gnu.org/wiki/GFortranBinaries32Linux but I still get the same error. The gfortran directory has the pathname: /usr/local/gfortran, however another gfortran which is not a directory can be found in /usr/local/bin
Typing:
which gfortran
Outputs:
/usr/local/bin/gfortran
And a long list search of this directory:
Input: ls -l /usr/local/bin/gfortran
Output: lrwxr-xr-x 1 root wheel 32 15 May 14:07
/usr/local/bin/gfortran -> /usr/local/gfortran/bin/gfortran
How can I fix this where everything seems to be correctly installed?
Any help would be greatly appreciated!
On macOS Big Sur v11.1:
Relevant SO post: https://apple.stackexchange.com/questions/408999/gfortran-compiler-error-on-mac-os-big-sur
The fix is to add the stdlib to your $LIBRARY_PATH. For some reason or another it isn't in your standard $PATH anymore on 11.1.
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
(or add it to login file and restart terminal).
I added this to my ~/.profile:
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
And it works.
I'll also chime in (19 Dec 2020) that I just updated from MacOS Mojave to Catalina and suddenly got this error.
It resolved itself with
brew reinstall gcc
brew reinstall gfortran
Update: I tried what was suggested and installed the gfortran build from the gcc package using homebrew which gave me a newer version of gfortran and my problem was fixed!
I had the same problem, but installing gfortran build from the gcc package using homebrew did not help. Instead, I installed the whole gcc using homebrew:
brew install gcc
and that solved the problem.
For those using MacPorts.
# Installed `gcc8` and `gcc_select`
sudo port install gcc_select gcc8
# then to create "gfortran" softlink to "gfortran-mp-8"
sudo port select --set gcc gcc8
# and added to my .profile
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
I did ls -l /Library/Developer/CommandLineTools/SDKs/ and found that Xcode had installed one SDK for Catalina and one for Big Sur. I changed the soft link for MacOSX.sdk to point to the Catalina version.
Just placed this line at the end of .zshrc:
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
and ran my Fortran code again to compile – success! The issue with -lSystem has been solved in my macOS system.
I had this problem, and I'd tried lots of thing to solve the problem, but only using these "both" commands solved it:
brew reinstall gcc
brew reinstall gfortran
I recently had this
ld: library not found for -lSystem
problem after upgrading Mac OS from v10 to v11 (Big Sur). I am using Xcode 12.3 and I used brew install gcc to install gfortran 10.2.0. I still saw the error after trying brew reinstall gcc. I was able to solve the problem using:
brew install gfortran
but I do not know why this works.

compiling F90 code on mac osx catalina: library issues [duplicate]

I am getting a strange error when trying to compile a simple fortran-90 file using gfortran. I am working on a macOS mojave system. I have gfortran 8.2.0 installed and I checked to be sure of this by doing the following:
Input: gfortran --version
Output: GNU Fortran (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Which indicates that gfortran installed correctly and I also confirmed this by typing simply: gfortran, into the terminal, which returns:
gfortran: fatal error: no input files
compilation terminated.
However, when I try to compile my file like so:
gfortran hello.f90 -o hello.x
I get an error which reads:
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
I've tried compiling in different ways and I also tried setting the LD_LIBRARY_PATH in .bash_profile as described by https://gcc.gnu.org/wiki/GFortranBinaries32Linux but I still get the same error. The gfortran directory has the pathname: /usr/local/gfortran, however another gfortran which is not a directory can be found in /usr/local/bin
Typing:
which gfortran
Outputs:
/usr/local/bin/gfortran
And a long list search of this directory:
Input: ls -l /usr/local/bin/gfortran
Output: lrwxr-xr-x 1 root wheel 32 15 May 14:07
/usr/local/bin/gfortran -> /usr/local/gfortran/bin/gfortran
How can I fix this where everything seems to be correctly installed?
Any help would be greatly appreciated!
On macOS Big Sur v11.1:
Relevant SO post: https://apple.stackexchange.com/questions/408999/gfortran-compiler-error-on-mac-os-big-sur
The fix is to add the stdlib to your $LIBRARY_PATH. For some reason or another it isn't in your standard $PATH anymore on 11.1.
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
(or add it to login file and restart terminal).
I added this to my ~/.profile:
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export LIBRARY_PATH="$LIBRARY_PATH:$SDKROOT/usr/lib"
And it works.
I'll also chime in (19 Dec 2020) that I just updated from MacOS Mojave to Catalina and suddenly got this error.
It resolved itself with
brew reinstall gcc
brew reinstall gfortran
Update: I tried what was suggested and installed the gfortran build from the gcc package using homebrew which gave me a newer version of gfortran and my problem was fixed!
I had the same problem, but installing gfortran build from the gcc package using homebrew did not help. Instead, I installed the whole gcc using homebrew:
brew install gcc
and that solved the problem.
For those using MacPorts.
# Installed `gcc8` and `gcc_select`
sudo port install gcc_select gcc8
# then to create "gfortran" softlink to "gfortran-mp-8"
sudo port select --set gcc gcc8
# and added to my .profile
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
I did ls -l /Library/Developer/CommandLineTools/SDKs/ and found that Xcode had installed one SDK for Catalina and one for Big Sur. I changed the soft link for MacOSX.sdk to point to the Catalina version.
Just placed this line at the end of .zshrc:
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
and ran my Fortran code again to compile – success! The issue with -lSystem has been solved in my macOS system.
I had this problem, and I'd tried lots of thing to solve the problem, but only using these "both" commands solved it:
brew reinstall gcc
brew reinstall gfortran
I recently had this
ld: library not found for -lSystem
problem after upgrading Mac OS from v10 to v11 (Big Sur). I am using Xcode 12.3 and I used brew install gcc to install gfortran 10.2.0. I still saw the error after trying brew reinstall gcc. I was able to solve the problem using:
brew install gfortran
but I do not know why this works.

Installing gcc with OpenMP support on Mac using homebrew has no effect

One way of installing gcc with openMP support on OSX is using Homebrew. However, when I follow the usual instruction of
brew reinstall gcc --without-multilib
It gives me a warning that there is no formula corresponding to the --without-multilib option and hence this will have no effect. Consequently, I do not have openMP support after this reinstallation process. Here is the detailed terminal output.
poulin8:02-prange-parallel-loops poulingroup$ brew --version
Homebrew 1.3.6
Homebrew/homebrew-core (git revision b5afc; last commit 2017-10-27)
poulin8:02-prange-parallel-loops poulingroup$ brew reinstall gcc --without-multilib
==> Reinstalling gcc
Warning: gcc: this formula has no --without-multilib option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/gcc-7.2.0.el_capitan.bottle
Already downloaded: /Users/poulingroup/Library/Caches/Homebrew/gcc-7.2.0.el_capitan.bottle.tar.gz
==> Pouring gcc-7.2.0.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/gcc/7.2.0: 1,486 files, 289.8MB
poulin8:02-prange-parallel-loops poulingroup$
Upon including omp.h in a file and compiling, I get the error
julia.c:447:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Could someone please help me with installing gcc on OSX with openMP support?
If you can substitute clang for gcc I was able to get clang to compile OpenMP programs quite easily. I built the latest version of LLVM/clang and used homebrew to install libomp via brew install libomp.
Full steps were something like:
mkdir omp_clang && cd omp_clang
git clone https://github.com/llvm-mirror/llvm.git -b release_60
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang -b release_60
mkdir build && cd build
cmake ../llvm
make
brew install libomp
./bin/clang -fopenmp=libomp ~/openmp_program.c

Why can't I compile with gfortran after upgrading to OSX Yosemite? gfortran error: libgfortran.spec: No such file or directory

Since upgrading to Yosemite I cannot compile with gfortran. Initially I was getting "segmentation fault 11", then I:
Updated to gcc v.5.0 from http://hpc.sourceforge.net/
Re-installed Xcode command line utilities v.6.1.1
After doing the above, I am able to compile very simple fortran programs but the more complex code that I run gives me the following error:
gfortran: error: libgfortran.spec: No such file or directory
But in fact, the libgfortran.spec file is located in /usr/local/lib
ls /usr/local/lib | grep gfortran
libgfortran.3.dylib
libgfortran.a
libgfortran.dylib
libgfortran.la
libgfortran.spec
All of the gcc binaries are located in /usr/local/bin
which gfortran
/usr/local/bin/gfortran
And my path seems to be OK
echo $PATH
/usr/local/lib:/usr/local/bin:/usr/local:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/lib:/usr/texbin:/Users/MattCooper/bin:/Applications/MRT/bin
I also tried re-installing gcc with homebrew:
brew install gcc
Error: gcc-4.9.2 already installed
To install this version, first 'brew unlink gcc'
However, I get v. 5.0 when I ask 'gcc --version':
gcc --version
gcc (GCC) 5.0.0 20141005 (experimental)
When I try to unlink or upgrade gcc with homebrew I get a permission denied error:
brew unlink gcc
Unlinking /usr/local/Cellar/gcc/4.9.2... Error: Permission denied - /usr/local/bin/c++-4.9
similarly
brew upgrade gcc
Permission denied - /usr/local/bin/c++-4.9
Finally
which gcc
/usr/local/bin/gcc
Please help. Many thanks ahead of time. Please let me know what I've forgotten to include.
I ended up solving the problem via homebrew. I can't pinpoint the exact source of the problem but it was related to the fact that I installed gcc v4.9 from http://hpc.sourceforge.net/, then somewhere along the way I re-installed and/or updated gcc with homebrew. Then, after upgrading to Yosemite, I installed gcc v5 from http://hpc.sourceforge.net/. Somewhere within that process, the binaries within /usr/local/bin and usr/local/lib were not linked properly.
The main clue was the Permission Denied error when trying to run 'brew upgrade gcc'. I found a solution here: Brew doctor says: "Warning: /usr/local/include isn't writable."
To fix, I used:
brew doctor
which returned a bunch of directories that were not writeable, for example usr/local/lib, thus brew was unable to ugrade gcc to the v5.0 and link everything.
I went through and issued:
sudo chown -R $USER /usr/local
and did this for all of the other non-writeable directories returned by 'brew doctor'. Then, I was able to use brew to ugrade gcc:
brew upgrade gcc
During the ugrade, homebrew returned an error that stated it could not finish the upgrade because there was already an existing gfortran file located in:
/usr/local/bin/gfortran
To fix, homebrew suggested I run:
brew -link gcc
at which point everything worked. Interesting (to me, because I don't fully understand all of this) when I ask brew to clean things up, I get:
brew cleanup
Warning: Skipping (old) /usr/local/Cellar/gcc/4.9.2 due to it being linked
There's some similar information located here: How to link to a new gcc version with brew?
Similar to that user, when I look in my cellar, I find two versions of gcc, but I'm not sure if I need both
ls /usr/local/Cellar/gcc
4.9.2 4.9.2_1
I had a similar issue with similar solution. It could not find this file:
gfortran: error: libgfortran.spec: No such file or directory
So my problem was that I had installed gcc through hpc.sourceforge.net and through homebrew. I had to uninstall the homebrew version
brew uninstall gcc
Then I had to reinstall the gcc from hpc.sourceforge.net
sudo tar -xvf gcc-4.9-bin.tar.gz -C /
This worked for me when I wanted to revert to gcc 4.9 from hpc.sourceforge.net, using Yosemite.

Resources