Re: Question on gnu compiler for mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Jun 2020 at 20:38, Edris Tajfirouzeh via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> Dear Operator
> I'm trying to install gfortran and gcc on my mac catalina version 10.15.4.
> I have already installed xcode and command line tools. I have also
> installed home brew.
> When I type "which gcc" and "gcc --version" I get the following answer:
>
> [edriss-MacBook-Pro:~] edris% which gcc
> /usr/bin/gcc
> [edriss-MacBook-Pro:~] edris% gcc --version
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
> Apple clang version 11.0.3 (clang-1103.0.32.62)
> Target: x86_64-apple-darwin19.4.0
> Thread model: posix
> InstalledDir:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>
> I wonder if I have installed it correctly. I found that this is not gcc and
> it is clang that I have installed. Please guide me .

The default "gcc" command on macOS is actuall clang, pretending to be GCC.

> Any way, I need gfortran compiler and when I type "which gfortran" I get
> the following message.
> [edriss-MacBook-Pro:~] edris% which gfortran
> gfortran: Command not found.
>
> Let me please know if I have done the installation wrong.
> If yes, please show me how can I remove the old installation of gcc and
> install a correct one (including gfortran compiler).

You don't want to remove that "fake" GCC, it's part of Xcode. You can
install a real GCC using home brew, which will include gfortran. It
will install to a different location, and you'll be able to choose
whether to run the "fake" GCC (i.e. Clang) or the real one (from home
brew) using the full path to the binary, or by editing the PATH
variable in your environment.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux