- Check whether the Xcode command line tools are installed on your Mac: Start Xcode on the Mac. Choose Preferences from the Xcode menu. In the General window, click the Locations tab. On the Location window, check that the Command Line Tools option shows the Xcode version (with which the Command Line Tools were installed). This means that the.
- I have to use Xcode occasionally, and have now come across a problem where I've upgraded to Xcode 4.6, but another piece of software I'm using doesn't support it, so I need to go back to Xcode 4.5. I'm not used to the way Macs work in general, so if the answers provided could be written with that in.
- Xcode 10.1 Download
- Apple Xcode 10.1 Download
- Download Xcode 10.2.1 For Mac
- Download Xcode For Mac
- Xcode 8.2.1 Download
I am using a Hackintosh for my iOs development. Installing or updating macOS is what I fear most because it regularly breaks operating system compatibility and requires lots of time to fix.
And seem like Apple always ‘encourage' developers to update their machine by increasing minimum support OS version of XCode.
- Xcode 10.2.1 requires a Mac running macOS 10.14.3 or later.
Apple has released the latest macOS Mojave 10.14.4 (Build 18E226) Final Update for Mac devices with the addition of numerous new features and functions. Apple has also released several other software updates as well i.e. MacOS Server 5.8 Final Version, Xcode 10.2 (Build 10E125) Final Update, iTunes 12.9.4, Safari 12.1, and iCloud 7.11 for macOS powered laptops and computers.
Now I want to update my codebase to Swift 5, a major release of Swift which brings ABI stability, I have no choice but install XCode 10.2 or above.
After searching for some solutions, I have found one and got it works successfully.
- Download Xcode 10.2.1 via this link and extract it (https://stackoverflow.com/questions/10335747/how-to-download-xcode-dmg-or-xip-file)
- Edit Xcode.app/Contents/Info.plist and change the Minimum System Version to 10.13.6
- Do the same for Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/Info.plist (might require a restart of Xcode and/or Mac OS to make it open the simulator on run)
- After Minimum System Version modification, if there are still forbidden sign in XCode icon, try to rename Xcode app.
- If there are problems with the simulator, reboot your Mac
I think I will be stuck with XCode 10.2.1 for a long time and will consider update when the next version of macOS available and stable for Hackintosh. XCode 11 is looking good with SwiftUI but only works with iOS 13 so it's a must wait.
Installing Amber/AmberTools on macOS has become much easier though is not to be considered completely trivial. Below different methods are presented to install the current version of AmberTools, where the method should be the same for Amber.
Xcode 10.1 Download
After the latest update of Xcode to 10.2.1, problems started emerging when trying to use a compiler other than clang. It is now once again possible to use gcc as long as you are using the latest and patched version of whichever gcc version you choose.
This will require you to install some things and run some commands through the built in 'command interpreter' which on macOS is called Terminal(.app). You find this app in your Applications folder, in a sub folder called Utilities or by using Spotlight, the litle magnifying glass in the top right corner of the screen (alternatively through the keyboard shortcut cmd+space
on your keyboard, assuming this is active) and search for 'Terminal'. When you are expected to run commands in the terminal, they will be presented in this manner:
Some commands might require you to 'side-scroll' to see the entire sequence as they might continue 'off screen'. With this explained I think it is time to get started. I will now explain how to compile AmberTools19(/Amber18) with the package manager 'Homebrew' and the Apple version of the C compiler package clang. Earlier I have offered instructions for using 'MacPorts' och binary distributed versions of HPC gcc/gfortran. However, not having enough time and a more acute lack of a stable and available virtual machine with macOS for testing I have had to limit myself somewhat. The process should still be the same regardless of the source one chooses for gcc/gfortran. Remember, only chose one source of installing compilers from as you may accidentally cause conflicts of installing more than one package manager or from more than one source of binaries at once.
If you run into issues I refer you to the AMBER mailing list for help rather than trying to comment here as I am not updating this page regularly enough to be able to help in any reasonable amount of time.
Installing Xcode and accompanying Command Line Tools
Regardless of which package manager or gcc source you select, you need to install Xcode. For this 'how-to', Xcode 10.2.1 was used and you should install this software using the AppStore on your Mac. Command Line Tools (CLT) is needed to run commands and compile using the terminal and is installed after Xcode has been installed by executing the following command in the Terminal(.app).
The step below might no longer be necessary with the latest updates of the amber code though I'll leave it here since I have installed these headers on my machine already and have yet had time to investigate if this makes a difference. Hence, you might need to install some missing header files by running the following command, opening a PKG installer which is shipped with Xcode10. Follow the on-screen instructions to install.
This step was necessary for AmberTools18 as Apple retired some tools that previously came with Xcode.
Some modules of the Amber package uses X.org X Window System for dealing with GUIs, support for this is no longer the default in macOS in the form of the old X11.app so in order for this to work you need to install XQuartz which has replaced X11.app. I believe you still recieve a popup explaining that you need to install XQuarts when trying to use X11 though you might just as well install the software directly. Visit the developer website at https://www.xquartz.org/ and follow the instructions.
Now you should have installed Xcode and CLT to be able to run commands and compile code with Terminal(.app) and potentially also XQuartz.
Compiling AmberTools19(/Amber18) with macOS clang
You've already installed Xcode (right?) so you now have a working C compiler (clang). Now you need a fortran compiler, as this is not shipped with Xcode. You can procure this using any method you chose which works. I use the homebrew package manager. In previous versions of these write-ups I have offered three different ways of obtaining these and installing amber using them and I will leave the outline in this guide as well despite the fact that I have not tested all three alternatives with the latest version of AmberTools. Please note that you should only select one method!
Alternative 1: HomebrewHomebrew is installed by running a command in the Terminal(.app), please visit the Homebrew website (https://brew.sh/) and confirm the command. This is the only validated method at the time.
Then proceed to install Homebrew GCC 9.1.0 (currently the default version) by running this command:
Since Apple does not supply a version of gfortran, the homebrew version of gfortran will automatically become the default global version by installing gcc. No links, edits or exports are needed.
Alternative 2: MacPortsDownload and install MacPorts and GCC. I have previously evaluated gcc versions 6-8 though not with the latest version of AmberTools. I am unsure if there is a gcc version 9 available from MacPorts as of writing this.
Alternative 3: HPC GCCWhere I have previously chosen HPC gfortran-8.1-bin.tar.gz from http://hpc.sourceforge.net to only install the fortran compiler as I now intend to use Apple clang for the rest. I have not validated that this method currently works with the latest updates of macOS and AmberTools. There is no version 9 available as of writing this.
Everything is installed in /usr/local/
. During this process I recieved error messages though the installation worked as intended anyway so I did not dig deeper into this:
You should now have a working installation of gfortran and it is time to move on with the configuration and installation of AmberTools19(/Amber18).
Download AmberTools19(/Amber18) from the developer website (https://ambermd.org/), move the compressed file and then extract the archive in the location where you intend to install AmberTools(/Amber).
Configure and install:
After a decent amount of time you should be greeted with something along the lines of:
You are also presented with a very wise suggestion to add a line of code to you .profile/.bashrc/.cshrc or similar, you should follow this suggestion as it will make you life a lot easier working with amber. For me, using SH/BASH (the macOS default) I execute this command:
You can then elect to 'restart' your terminal session by closing the window and opening it again, reading the content of this file again. Alternatively you execute the following command:
After the successful installation of AmberTools(/Amber) you should run through the tests to make sure everything is running smoothly under the hood. You start these test by executing the following:
Check that everything looks OK and that no major errors or issues were identified. You should now have a working serial version of AmberTools19 installed and ready to go. This time we'll also cover the installation of the parallel version.
Assuming everything ran smoothly this should, after some time, end with a message similar to:
You are supposed to download and install openMPI 4.0.1 from source using a script found in $AMBERHOME/AmberTools/src
called configure_openmpi. I did not manage to get this to work with macOS clang however it is supposedly accomplished running the commands outlined below. On any other system than macOS, the number of cores is likely found issuing another command then sysctl
:
The last step that remains seems to be to install openMPI support for cpptraj to read and write NetCDF files in parallel. I did not manage to do this using clang so for this option, see the GCC instructions below. This is what the commands should look like:
However, this produces the following error for me:
Apple Xcode 10.1 Download
Compiling AmberTools19(/Amber18) with Homebrew GCC
Assuming that you have already installed Xcode and CLT (otherwise go back to the start and take care of this right now) we shall now install AmberTools19(/Amber18) using Homebrew GCC 9.
Download Xcode 10.2.1 For Mac
The first thing you need to do is to give the Homebrew versions of gcc compilers priority over macOS clang alternatives. Even if you installed gcc 9 through homebrew, gcc will still be clang when you try to compile code using 'gcc
'. If this is a project of your own you can always just refer to gcc as gcc-9
however this will not help is now as AmberTools(/Amber) will look for 'gcc'. One simple way to reversibly accomplish this is to use symbolic/soft links:
Creating links in /usr/local/bin
with correct names according to the OS. You might need to 'exit' the terminal to reset the session and make sure that the correct compilers have priority. Running:
You are also presented with a very wise suggestion to add a line of code to you .profile/.bashrc/.cshrc or similar, you should follow this suggestion as it will make you life a lot easier working with amber. For me, using SH/BASH (the macOS default) I execute this command:
You can then elect to 'restart' your terminal session by closing the window and opening it again, reading the content of this file again. Alternatively you execute the following command:
After the successful installation of AmberTools(/Amber) you should run through the tests to make sure everything is running smoothly under the hood. You start these test by executing the following:
Check that everything looks OK and that no major errors or issues were identified. You should now have a working serial version of AmberTools19 installed and ready to go. This time we'll also cover the installation of the parallel version.
Assuming everything ran smoothly this should, after some time, end with a message similar to:
You are supposed to download and install openMPI 4.0.1 from source using a script found in $AMBERHOME/AmberTools/src
called configure_openmpi. I did not manage to get this to work with macOS clang however it is supposedly accomplished running the commands outlined below. On any other system than macOS, the number of cores is likely found issuing another command then sysctl
:
The last step that remains seems to be to install openMPI support for cpptraj to read and write NetCDF files in parallel. I did not manage to do this using clang so for this option, see the GCC instructions below. This is what the commands should look like:
However, this produces the following error for me:
Apple Xcode 10.1 Download
Compiling AmberTools19(/Amber18) with Homebrew GCC
Assuming that you have already installed Xcode and CLT (otherwise go back to the start and take care of this right now) we shall now install AmberTools19(/Amber18) using Homebrew GCC 9.
Download Xcode 10.2.1 For Mac
The first thing you need to do is to give the Homebrew versions of gcc compilers priority over macOS clang alternatives. Even if you installed gcc 9 through homebrew, gcc will still be clang when you try to compile code using 'gcc
'. If this is a project of your own you can always just refer to gcc as gcc-9
however this will not help is now as AmberTools(/Amber) will look for 'gcc'. One simple way to reversibly accomplish this is to use symbolic/soft links:
Creating links in /usr/local/bin
with correct names according to the OS. You might need to 'exit' the terminal to reset the session and make sure that the correct compilers have priority. Running:
Should now return /usr/local/bin
instead of /usr/bin
, then you are set to go!
Once you no longer want these alternatives to be the default, just remove the links accordingly:
Assuming that you've downloaded AmberTools19 from the developers webpage and moved the compressed archive to the location where you want to install AmberTools19(/Amber18) you make your way through the filesystem in a Terminal(.app) session and execute the following commands:
After a while you should see something along the lines of:
After a successful installation you should run through the tests to see that everything is churning along correctly:
If this does not generate any larger problems you now have a functioning serial version of AmberTools19(/Amber18) installed and ready for use. I have previously terminated the write-up here though as I've made the decision to cut down on the alternatives for compilers I have instead provided information regarding the parallel installation as well. For this I elected to use the script ($AMBERHOME/AmberTools/src/configure_openmpi
) which is available to help with the installatoin of opemMPI as the version provided by homebrew is built for clang and not gcc and I did not have the energy to build it from source by myself. You'll get through these steps by doing the following:
You might need to reset you terminal session to make sure the correct openMPI installation is found (exit
).
Download Xcode For Mac
After some waiting and pacing you should se something similar to:
So assuming everything went well it is now time to runs some tests, this does not work for me. Potentially this depends on the fact that I'm using a work computer though what happens is that I get bombarded with 'Allow network access' pop-ups for every test and some other annoying things. Theoretically, this is what you should do:
Replacing 'X' with the number outputted by sysctl -h hw.ncpu | awk {'print $2'}
Download yousendit for mac. to use all cores available.
Remaining is to install openMPI support for cpptraj to deal with NetCDF files in parallel, which is accomplished with the following command:
After some more waiting:
Xcode 8.2.1 Download
Again, you should run some tests though I am not able to do this as my OS does not allow me to run them. You should by now have a working parallel version of AmberTools19(/AMber18) ready for use.