- C Compiler For Mac Os
- Gcc For Mac Os
- Compilers For Mac Os High Sierra
- Fortran Compiler For Mac Os
- Compilers For Mac Os 10.10
Fortran Compiler Installation Instructions for OS X. The Mac OS X operating system is a variant of unix (called Darwin, which is a derivative of BSD unix). It is a versatile computing platform suitable both for computational chemistry calculations and for developing and compiling programs.
Silent Installation Guide for Intel Compilers for Mac OS* X Versions 14.x, 13.x, 12.x, 11.x, 11.x and 10.1
- 'C' Compiler for Mac OS 9.X? Powermixx asked on 2001-10-02. System Programming; 6 Comments. Last Modified: 2013-12-26. I am taking a C Programming course and would like to know if there is a 'C' Compiler available for the Macintosh. If so, where can I find it?
- Eclipse C Compiler. With Eclipse you get advance functionality for programming in C, C on an.
- Instructions for older versions of Mac OS X (10.6 - 10.10) Instructions for installing the GNU compilers for older versions of Mac OS X (10.6 - 10.10) have been moved and are available on another page. Tips & Warnings. I mention all but the last of these tips and warnings in the text above, but it doesn't hurt to list them a second time.
Navigation
Linux and Mac OS X Compilers Installation Help Center: /en-us/articles/intel-compilers-linux-installation-help
This guide presents silent installation instructions for current and previous versions of Intel compilers. Newer compilers are described first, scroll down for version 11.x or older.
Silent Installation Guide for Intel Compilers for Mac OS* X Versions 14.x, 13.x, and 12.x
Here are the steps you need to follow to install the Intel Composer XE for OS X* version 2013 SP1 aka '14.0' in silent mode.
Step 0) Confirm that the userID for the installation has 'sudo' priviledge. If you are unfamiliar with the 'sudo' command please research that command on the internet to become familiar with it's use. Test your sudo priviledge with a simple sudo command such as 'sudo pwd' or 'sudo ls -l'
Step 1) Mount the *.dmg file with required content using 'Finder', for example, by double-clicking on *.dmg. OR If you are working from a terminal window, use the hdiutil command to mount the compiler installer disk image (.dmg)
2013 SP1 Example:
Disk image mounts under
- /Volumes/m_fcompxe_2013_sp1.u.vvv (for the Fortran Composer XE 2013 SP1)
- /Volumes/m_ccompxe_2013_sp1.u.vvv (for the C++ Composer XE 2013 SP1)
Mount the image
- sudo hdiutil attach m_fcompxe_2013_sp1.u.vvv.dmg
- sudo hdiutil attach m_ccompxe_2013_sp1.u.vvv.dmg
where 'u' is the update number ( 0, 1, 2, 3, etc) and where 'vvv' is the specific version ( 2013_sp1.2.142 is Update 2, version 142 for example)
Step 2) Start a 'Terminal' program from Utilities group (if you have not done so already.
Step 3) Using 'Terminal', change directory to the /Packages folder:
2013 SP1 Example:
- cd /Volumes/m_ccompxe_2013_sp1.X.YYY/Packages
- cd /Volumes/m_fcompxe_2013_sp1.X.YYY/Packages
Step 4) Use 'sudo' to run the Intel installer 'i_install': ./i_install with the silent install options.
Usage: ./i_install [OPTIONS]
For Version 2013 SP1: usage: sudo ./i_install [-s or -h] [-f 'license file or folder or port@host'] or [-sn 'serialnumber'] -xd 'xcode folder' -l 'log file' -it '[1/2]' -sd '[yes/no]' -eula 'accept'
User can provide a valid serial number following the -sn option or a license file with the complete path or port@host for server license following the -f option.
Required Options
- -s : to indicate execute in silent mode
- -l : [optional] to provide a install log file (this file will be created '/tmp' folder. Do not use any path information, just some simple name like 'install.log'.
- -f : -licfile Install silently using the license file provided on the command line. Include the full path to the .lic license file on your system. Typically these are stored in directory /Users/Shared/Library/Application Support/Intel/Licenses/<file>.lic
- Port@host Install silently using the server license available at host
- -sn, -sn Install silently using the serial number provided on the command line
- -eula 'accept' to confirm that you have read the End User Licensing Agreement and have accepted the license conditions. By using silent installation you must accept the EULA and by using the silent installation you have agreed to those terms.
More required Options for all compilers Version 11.1 and above
- -id <install_dir> 'install directory', default install folder is /opt/intel
- Silent install utility installs all the packages bundled in the meta package.
- To set the top level install folder for these packages one can use this option
- -xd : 'xcode folder' ( provide Xcode IDE folder for compiler to be integrated with) - /Applications/Xcode.app for example or /Developer/XCode
More required Options for all compilers Version 12.0 and above (Composer XE 2011, Composer XE 2013, Composer XE 2013 SP1)
12.0 and 12.1 versions:
- -it: install type; 1. commandline install 2. xcode integration 3. both, command line and xcode environment.
- User has option to install either command line alone and/or integrate with xcode IDEenviromen
- Default install type is 3
More required options for all compilers version 13.0, 13.1, and 14.0: Composer XE 2013 and 2013 SP1 versions:
- -it: install type; 1. Command line install 2. both, command line and Xcode environment.
- User has option to install either command line alone or integrate with Xcode IDE enviroment
- Default install type is 2
- -sd: indicates agreement to participate in Intel(R) Software Improvement Program, by default is 'no'
Silent Installation Guide for Intel Compilers for Mac OS* X Version 11.x
Here are the steps you need to follow to install the Intel Compilers for Mac OS X* version 11.0 and higher in silent mode.
Step 0) Login as an administrative user or root. If you have sudo priviledge, become root user in a Terminal window with:
- sudo bash
- and enter your user password, then enter command
- su -
Step 1) Mount the *.dmg file with required content using 'Finder', for example, by double-clicking on *.dmg. OR If you are working from a terminal window, use the hdiutil command to mount the compiler installer disk image (.dmg)
11.0 Example (11.1 is similar):
Disk image mounts under
- /Volumes/m_cprof_p_11.0.0xx (for the 11.0 Fortran Compiler) or
- /Volumes/m_cproc_p_11.0.0xx (for the 11.0 C++ Compiler)
Mount image with
- hdiutil attach m_cprof_p_11.0.0xx.dmg
- hdiutil attach m_cproc_p_11.0.0xx.dmg
12.0 Example:
Disk image mounts under
- /Volumes/m_fcompxe_2011.u.vvv (for the 12.0 Fortran Compiler) or
- /Volumes/m_ccompxe_2011.u.vvv (for the 12.0 C++ Compiler)
Mount image with
- hdiutil attach m_fcompxe_2011.u.vvv.dmg
- hdiutil attach m_ccompxe_2011.u.vvv.dmg
where 'u' is the update number ( 0, 1, 2, 3, etc) and where 'vvv' is the specific version ( 2011.2.142 is Update 2, version 142 for example).
C Compiler For Mac Os
Step 2) Start a 'Terminal' program from Utilities group (if you have not done so already. Do this as root user or use the command 'sudo bash' to become root user)
Step 3) Using 'Terminal' as root user, change directory to the /Plugins folder:
11.0 (similarly for 11.1):
Change directory to the 'Plugins' folder inside /Volumes/m_cprof_p_11.0.0xx
For example:
- cd /Volumes/m_cproc_p_11.0.0xx/m_cproc_p_11.0.0xx.mpkg/Contents/Plugins
- cd /Volumes/m_cprof_p_11.0.0xx/m_cproc_p_11.0.0xx.mpkg/Contents/Plugins
12.0:
- cd /Volumes/m_ccompxe_2011.2.142/m_ccompxe_2011.2.142.mpkg/Contents/Plugins
- cd /Volumes/m_fcompxe_2011.2.142/m_fcompxe_2011.2.142.mpkg/Contents/Plugins
Step 4) Run installer 'i_install': ./i_install with the silent install options.
Usage: ./i_install [OPTION]
For version 11.0: usage: ./i_install [-s or -h] -l 'log file' -f 'license file or folder or port@host' -eula 'accept'
For version 11.1: usage: ./i_install [-s or -h] -l 'log file' -f 'license file or folder or port@host' -sn 'serialnumber' -xd 'xcode folder' -id 'install folder' -eula 'accept'
For Version 12.0: usage: ./i_install [-s or -h] -l 'log file' [-f 'license file or folder or port@host'] or [-sn 'serialnumber'] -it '[1/2/3]'-xd 'xcode folder' -id 'install folder' -eula 'accept'
User can provide a valid serial number following the -sn option or a license file with the complete path or port@host for server license following the -f option.
Required Options
- -s : to indicate execute in silent mode
- -l : [optional] to provide a install log file (this file will be created '/tmp' folder
- -f : -licfile Install silently using the license file provided on the command line.
- Port@host Install silently using the server license available at host
- -sn, -sn Install silently using the serial number provided on the command line
Additional Options, Version 11.1 and above
- -id <install_dir> 'install directory', default install folder is /opt/intel
- Silent install utility installs all the packages bundled in the meta package.
- To set the top level install folder for these packages one can use this option
- If install_dir is provided then the mounted system has to be writable for silent installs
- If the mounted volume is not writable, then user gets'Seems mounted volume is read only file system. Use 'hdiutil attach '<disk-image-name>.dmg' -readwrite -shadow' command, to mount the disk image', message and aborts silent install.
- -xd : 'xcode folder' ( provide xcode IDE folder for compiler to be intgegared with)
Additional Options, Version 12.0 and above
- -it: install type; 1. commandline install 2. xcode integration 3. both, command line and xcode environment.
- User has option to install either command line alone and/or integrate with xcode IDEenviroment
- Default install type is 3
- -h Display the silent install usage.
Examples:
Log File
Option, '-l mylog_file' creates a install log file 'tmp/mylog_file', if this argument is not given then'/tmp/pset.log' file is created for logs.
Silent Installation Guide for Intel Compilers for Mac OS* X Version 10.1
Here are the steps you need to follow to install the Intel Compilers for Mac OS X* version 10.1 in silent mode.
- Mount the *.dmg file with required content using 'Finder', for example, by double-clicking on *.dmg. If you are working from a terminal window, this command will mount the compiler installer disk image under /Volumes/m_fc_p_10.1.0xx (for the Fortran Compiler) or /Volumes/m_cc_p_10.1.0xx (for the C++ compiler)
- hdiutil attach m_fc_p_10.1.0xx.dmg
- hdiutil attach m_cc_p_10.1.0xx.dmg
- Start a 'Terminal' program from Utilities group (if you have not done so already). Using 'Terminal' do the following:
- Copy the contents of the mounted image to a local folder, for example:
- cp -pR /Volumes/m_fc_p_10.1.00x /Users/f_fc_p_10.1.00x (or the similar command for m_cc_p_10.1.0xx)
- Change directory to the local 'instman' folder inside the folder you copied in (a), for example:
- cd /Users/f_fc_p_10.1.00x/instman
- Export DYLD_LIBRARY_PATH=<instman folder>, for example:
- export DYLD_LIBRARY_PATH=/Users/f_fc_p_10.1.00x/instman:$DYLD_LIBRARY_PATH
- (optional) Make changes to ‘si_issa.xml' configuration file to change the default settings, see details below.
- Run: ./si_secore with the silent install options. Usage: /si_secore [OPTION]
The user must provide a valid serial number following the -sn option and a license file with the complete path following the --licfile option. -n, -sn Install silently using the serial number provided on the command line. The other settings will come from 'si_issa.xml' file in the instman folder or from a custom config file, specified as -c 'your config' on the command line.
- -l, -licfile Install silently using the license file provided on the command line. The other settings will come from 'si_issa.xml' file present in the instman folder or from the -c 'your config' file provided on the command line.
- -c Use ISSA and install parameters that are supplied through this configuration file.
- -h Display the silent install usage.
Precedence Order for Parameters
- If both -sn 'SN' and the -c 'CF' options are provided, the serial number provided via command line overrides the serial number specified in the <SerialNumber> value in the configuration file.
- If both -licfile 'LF' and the -c 'CF' options are provided, the license file provided via command line overrides the license file specified in the <LicenseFile> value in the configuration file.
- If both <SerialNumber> and <LicenseFile> values are provided in the configuration file or as command-line options, silent install will first copy the license file, validate and proceed with the install; if install fails, it will follow the serial number option path.
Configuration File
The default configuration file 'si_issa.xml' is available in the ‘instman' folder. You can use the script file 'pre_sinstall.sh' available in the 'instman' folder to generate an silent install config file. Here is an example of the format of this configuration file
Note: the pkg_id attribute under <Package pkg_id='1'> will set the order in which the tools will be installed. You can change the install order based on dependencies between installed packages. Include the <Proxy> section only if a web proxy server is required to reach the Intel® Software Development Products Registration Center web server.
Examples:
Log File
To create a log file, create a directory named 'WorkArea' within the 'instman' folder. Rerun the installation, and files will be created in the 'WorkArea' folder. The most important file will be secore.log, which is a transcript of the ISSA session.
Silent Install Using ‘sudo'
Users utilizing the ‘sudo' command to perform a silent install need to modify the above procedure. By default, sudo will not preserve the user's DYLD_LIBRARY_PATH setting. The following silent install procedure should be used by sudo users:
To install the compiler with sudo in the 'silent' mode with an interactive shell
- Mount the product dmg file with required content using Finder, for example, by double-clicking on the dmg file.
- Start a Terminal program from the Utilities group. Using Terminal, copy the contents of the mounted image to a local folder, for example
- cp -pR /Volumes/m_fc_p_10.1.00x /Users/m_fc_p_10.1.0xx
- Change directory to the local instman folder inside the folder you copied in (a), for example:
- cd /Users/m_fc_p_10.1.00x/instman
- Start a shell session under bash, for example:
- sudo /bin/bash
- Export DYLD_LIBRARY_PATH=<instman folder>, for example:
- export DYLD_LIBRARY_PATH=/Users/m_fc_p_10.1.00x/instman:$DYLD_LIBRARY_PATH
- (optional) Make changes to si_issa.xml configuration file to change the default settings, see details below.
- Run ./si_sicore with options as described above.
To install the compiler with sudo in the 'silent' mode with minimal interaction
The following method uses sudo in a mode suitable for scripted automation.
- Start a Terminal program from the Utilities, or create a user shell (rsh, X11, etc)
- Change directories to a working area where the user has write permission. For example, cd /Users/<my user> ,where this is the home directory of user <my user>. This example assumes the user has downloaded or copied the compiler disk image (.dmg) file to this user home directory /Users/<my user>/m_fc_p_10.1.0xx.dmg where '0xx' is the compiler minor version.
- Mount the compiler disk image. Assumes compiler .dmg file is in your current directory. This command will mount the compiler installer disk image under /Volumes/m_fc_p_10.1.0xx: sudo hdiutil attach m_fc_p_10.1.0xx.dmg
- Copy the contents of the mounted image to a local folder where you have write permission. For example, if your current directory is user writeable: cp -pR /Volumes/m_fc_p_10.1.0xx /Users/<my user> , where '<my user>' is replaced by your login or user name.
- Change directories to /Users/<my users>/m_fc_p_10.1.0xx/instman created by the previous copy command: cd /Users/<my user>/m_fc_p_10.1.0xx/instman
- Use sudo to run the installer, using one of two possible methods, where '<options>' are replaced by si_secore options described above.
- sudo env DYLD_LIBRARY_PATH=/Users/<my user>/m_fc_p_10.1.0xx/instman ./si_secore <options>
- sudo -c 'DYLD_LIBRARY_PATH=/Users/<my user>/m_fc_p_10.1.0xx/instman ; ./si_secore <options> '
- For example, to use the serial number XXXX-XXXXXX to install:
- sudo -c 'DYLD_LIBRARY_PATH=/Users/<my user>/m_fc_p_10.1.0xx/instman ; ./si_secore -n XXXX-XXXXXX '
- (optional) Remove the compiler installation files. For example,
- cd /Users/<my user>
- rm -Rf m_fc_p_10.1.0xx
- (optional) Unmount the compiler installation image. For example, sudo hdiutil unmount /Volumes/m_fc_p_10.1.0xx
- Finally, to truly make this sequence suitable for scripting, you can pass your password to the sudo commands above using the -S option to sudo. For example, echo ‘MyPassword' | sudo -S <options> <command> , where ‘MyPassword' is your user password used to run sudo command.
Note
As noted in the Intel® Software Development Product End User License Agreement, the Intel® Software Development Product you install will send Intel the product’s serial number and other system information to help Intel improve the product and validate license compliance. No personal information will be transmitted.
Skip to end of metadataGo to start of metadataAfter installing the GNU compilers, you may want to check out the HOWTO for installing Open MPI on Mac OS X.
Background
One of the nice things about Mac OS X is that you have a polished user interface atop a Unix operating system. This means that using command line utilities such as compilers is straightforward, making coding on your Mac easy. If you have a multi-core Mac (most should by now) and would like to run codes that use MPI to distribute processing across multiple processor cores, you should also check out the HOWTO for installing Open MPI on Mac OS X. Note that you'll need to follow the instructions on this page prior to installing Open MPI if you don't already have some set of compilers installed.
Requirements
To install the GNU compilers as described in this HOWTO, you'll need the following:
- A Mac running 10.11 (El Capitan)
- If you are using Mac OS X 10.6 - 10.10, check out the instructions for older versions of Mac OS X
- An Apple App Store account
- Internet access
Gcc For Mac Os
Video instructions for Mac OS 10.11 (El Capitan) with Xcode 7
Rough video transcript:
Hello, and welcome to this screencast on how to install the GNU C, C++ and Fortran compilers for Mac OS 10.11 (El Capitan). In this video, I will show you how to install the compilers as well as Apple’s Xcode software, which is required for the compiler installation. For this video, I am assuming you are using a Mac running Mac OS 10.11, also known as El Capitan, that you have an Apple App Store account and that you have internet access. I am also assuming you have administrator access on your Mac, allowing you to install software. If you’re running an older version of Mac OS X, the installation procedure will be similar, but you can check out the link at the end of this video for the installation procedure on older versions of Mac OS X back to 10.6.
Step 1: We’ll begin by installing the current version of Apple’s Xcode software, Xcode 7. To install Xcode, start by opening the App Store app by clicking on the Apple logo on the top left of the menu bar and then selecting App Store… Once the App Store app opens, enter 'Xcode' into the search and press Enter. You can now click install to install Xcode. You may be prompted to enter your Apple ID and password if you’ve not previously installed applications via the App Store. Xcode is a pretty big download, so depending on the speed of your internet connection it may take some time to download and install. I’ll be back once the install is complete.
Step 2: Xcode has been downloaded and installed, and now we can move on to a critical second step for the Xcode install, installing the command line tools. To do this, we can use Spotlight to open the Terminal app. If you’re installing compilers, I am going to assume you’re at least somewhat familiar with using a terminal emulator. If not, you should still be able to do the install by following these instructions carefully. Once Terminal has opened, type in xcode-select --install
. This will install the command line tools for Xcode, and you will be asked to perform the install using the typical application installation process. This may include asking you for your password.
Step 3: Now that Xcode is fully installed, we can move on to downloading the GNU compilers from the High-Performance Computing for Mac OS X website. The easiest way to get there is to open a web browser, Safari in this case. And type in 'High-performance computing Mac OS X' in the Google search. It should be the top hit. On that page, we’ll grab the latest STABLE version of the GCC compiler package and click the link to download.
Compilers For Mac Os High Sierra
Step 4: After the compilers have downloaded, we can return to the Terminal and navigate to the Downloads directory. We’ll install the compilers now using the `sudo
` command, and before we do so, I’m going to give you a little warning. Using the sudo command can do major damage to your computer if you aren’t careful, so please type the following exactly as shown to do the install: sudo tar -xvf gcc-5.3-bin.tar -C /
. If your downloaded package ends in .tar.gz
, you’ll need to add z
to the list of flags after the tar
command. This should take just a moment and will install the compilers in /usr/local
.
Fortran Compiler For Mac Os
Step 5: Now the compilers are installed, and if you’re running Mac OS 10.11, you should be able to test the installation by typing gcc -v
. It should show version 5.3. You can try the same with the Fortran compiler by typing gfortran -v
. If they return the compiler versions as expected, you’re all set. Enjoy.
- If your compilers are not installed, you may need to add the installation location to the PATH environment variable, which tells the computer where to look for command line programs.
- In that case, the easiest thing to do is go to the installation HOWTO at the link at the end of this video and check out the last section of the instructions for the installation for Mac OS 10.9 or 10.10. There are some additional instructions that may help resolve your issues. If you’re still having trouble, double check you’ve followed the instructions exactly as given in the video and feel free to add a comment if you still need some help.
- OK, so that’s it. Thank you for watching. If you have any comments, please leave them below. In case you’re interested, here’s another link to a video on how to install the Open MPI software for running multi-core applications on your Mac using MPI, the message-passing interface. Good luck!
Instructions for older versions of Mac OS X (10.6 - 10.10)
Instructions for installing the GNU compilers for older versions of Mac OS X (10.6 - 10.10) have been moved and are available on another page.
Tips & Warnings
I mention all but the last of these tips and warnings in the text above, but it doesn't hurt to list them a second time...
Compilers For Mac Os 10.10
- Beware that using sudo can do major damage to your computer if you aren't careful.
- Note that after installing Xcode, you also need to perform a critical additional step.
- Launch Xcode and install any available updates. Quit Xcode.
- Launch Terminal.app (in
/Applications/Utilities
, hopefully you know that) Install the Command Line Tools for OS X by typing
This will open a dialog box to install the Command Line Tools for Xcode package. Install following the standard procedure.
- Launch Xcode and install any available updates. Quit Xcode.
- If the correct version of gcc is not being found at the command line after installation, it is possible that you're using a terminal emulator that reads the
.bashrc
file rather than the.bash_profile
file. To confirm, do the following:Open a new terminal window using your terminal emulator of choice. This will reread the either the
.bash_profile
file or the.bashrc
. If the new gcc version is not returned when typingthen your terminal emulator may be reading the
.bashrc
file.- You can fix this one of two ways
Create a symbolic link called
.bashrc
that points to.bash_profile
by typingModify the order of directories that are searched for commands by typing