So after a fair bit of contemplating I made the decision to switch from MacPorts to Homebrew. This has not been a painless process and even if I like Homebrew, there are a number of caveats and I cannot for the life of me understand the motivation for implementing this “features”. Having this said, I am now fully committed to Homebrew and hence instructions for how to compile software will from now on out use Homebrew (or not).
Rockys revolution mac os. A cross-platform tool to flash OS images onto SD cards and USB drives safely and easily. Free and open source for makers around the world. These instructions will guide OKI users in order to overcome the limitations and restrictions set by Apple's new Mac OS X.8, code name Mountain Lion. https://herezfiles794.weebly.com/earth-defender-itch-dutchtim2003-mac-os.html. Please note: After carefully reading these instructions, Lion Mac OS X.7 supported drivers and related software can be used under Mac OS X.8 with some known limitations. Operating System: OS X 10.8.
With the recent update from OS X 13.X High Sierra to OS X 14.X Mojave a lot of things broke, as anticipated. This is something that I have now sadly come to expect from any update of the macOS. This did of course include the ability to compile amber on macOS. It turns out that, among other things, Apple decided that ”libstdc++” is deprecated and you should now use ”libc++” without leaving any backwards compatibility solution. Some other important files have also gone missing that used to reside in /usr/include/ that you now need to manually installed from an PKG installer buried in Xcode, this will however stop working with the next major Xcode release and undoubtedly brake a lot of other things as well. Long story short, this is what you need to do to compile AmberTools18/amber18 on macOS Mojave using Homebrew GCC8 or just using the macOS clang compiler. The journey resulting in this post is long and includes more issues than reported though I will not describe all of them since that would take a looooong time and would potentially not be very interesting for the general public.
sudo xcode-select --install
/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
brew install gcc
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
tar xvf AmberTools18.tar.bz2
export AMBERHOME=/[PATH]/[TO]/amber18
export PATH=${AMBERHOME}:$PATH
cd $AMBERHOME
export MACOSX_DEPLOYMENT_TARGET='10.14'
'cannot find <include> file'.
ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc
ln -s /usr/local/bin/g++-8 /usr/local/bin/g++
ln -s /usr/local/bin/c++-8 /usr/local/bin/c++
./configure -macAccelerate gnu
make install
This will produce a working version of AmberTools18/amber18 using Homebrew GCC8 though there are still issues and there will undoubtedly be more issues that will surface before everything works as intended. How to compress two files into a zip.
sudo xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
tar xvf AmberTools18.tar.bz2
export AMBERHOME=/[PATH]/[TO]/amber18
export PATH=${AMBERHOME}:$PATH
cd $AMBERHOME
export MACOSX_DEPLOYMENT_TARGET='10.14'
'cannot find <include> file'.
vi $AMBERHOME/AmberTools/src/configure2
# if [ '$intelmpi' = 'yes' ]; then
# echo 'Intel MPI must be used with the Intel compilers.'
# exit 1
# fi
#
vi $AMBERHOME/AmberTools/src/pytraj/setup.py
142 extra_compile_args.append('-stdlib=libstdc++’)
--->
142 extra_compile_args.append('-stdlib=libc++’)
2289 # mac/clang
2290 if [ '$skippython' = 'no' ]; then
2291 cpptrajcxxflags='-stdlib=libstdc++ $cpptrajcxxflags'
2292 cpptrajldflags='-stdlib=libstdc++ -L/usr/lib/'
2293 fi
--->
2289 # mac/clang
2290 if [ '$skippython' = 'no' ]; then
2291 cpptrajcxxflags='-stdlib=libc++ $cpptrajcxxflags'
2292 cpptrajldflags='-stdlib=libc++ -L/usr/lib/'
2293 fi
./configure -macAccelerate clang
make install
This produces a working version of AmberTools18/amber18 using macOS clang though there are still issues and there will, without a doubt, be more issues that will surface.