Install AmberTools18 (amber18) on Mac OS X 10.14 (Mojave) using Homebrew (or not)

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).

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.

Compile AmberTools18/amber18 using Homebrew GCC8

  1. Install Xcode and Command Line Tools
    Xcode10 is most appropriately installed from the AppStore
    You need to install Command Line Tools manually by executing the following in Terminal.app
    sudo xcode-select --install

  2. Install Homebrew and GCC
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew install gcc

  3. Install missing header files
    In Terminal.app, run the following command to open the PKG installer and follow the instructions.
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

  4. Download the AmberTools18/amber18 archives and extract them where you want to install them.
    tar xvf AmberTools18.tar.bz2

  5. Configure and install
    export AMBERHOME=/[PATH]/[TO]/amber18
    export PATH=${AMBERHOME}:$PATH
    cd $AMBERHOME
    export MACOSX_DEPLOYMENT_TARGET='10.14'
    Eliminates an error: "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.

Compile AmberTools18/amber18 using macOS clang

  1. Install Xcode and Command Line Tools
    Xcode10 is most appropriately installed from the AppStore
    You need to install Command Line Tools manually by executing the following in Terminal.app
    sudo xcode-select --install

  2. Install the missing header files
    In Terminal.app, execute the following command to launch the PKG installer and follow the instructions.
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

  3. Download AmberTools18/amber18 archives and extract where you want to install.
    tar xvf AmberTools18.tar.bz2

  4. Configure and install
    export AMBERHOME=/[PATH]/[TO]/amber18
    export PATH=${AMBERHOME}:$PATH
    cd $AMBERHOME
    export MACOSX_DEPLOYMENT_TARGET='10.14'
    Eliminates an error: "cannot find <include> file".
    vi $AMBERHOME/AmberTools/src/configure2
    Comment out rows 2237-2241
    # if [ "$intelmpi" = 'yes' ]; then
    # echo "Intel MPI must be used with the Intel compilers."
    # exit 1
    # fi
    #


    vi $AMBERHOME/AmberTools/src/pytraj/setup.py
    Change libstdc++ to libc++ on row 142
    142 extra_compile_args.append('-stdlib=libstdc++’)
    --->
    142 extra_compile_args.append('-stdlib=libc++’)



    Also change the same on rows 2289-2293
    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.

eReader with “paper feeling”

There are some things that I can sometimes miss with the “analogue era”, taking notes using a pen an paper, opening a book and flipping through and reading text on physical pages. It might not be the actual book or notepad I miss though rather a feeling and an impression. The iPad or a mobile phone are fantastic tools allowing me to read books and take notes, even using “handwriting” with my finger or a stylus, though there just feels like something is missing. So in a rare moment of having a few minutes to spare I started looking into something I had previously chosen to ignore, eReaders. Just as one would suspect, a lot has happened since I first looked into the Amazon Kindle, realising that you can only read books from amazon, not take notes, not easily import PDFs and never looking back. This promoted a tour of the internet to investigate what was now available and I thought I’d share some of my impressions from this here and now.

The Sony eInk readers are presented as there “digital paper system”. The DPTS1 unit is available with a price tag reading $799 at the SONY webstore, though this is of course not available in the Swedish store. Following the link to Amazon I can only find used S1 models priced around $1000. The DPT-RP1 13″ seems to be another model though is available both as new and used with a price tag at $600.

Looking at the promotional material for these products, I am really impressed. If these units perform as well as in the videos, these products would be just fantastic. SONY has seemingly managed to truly capture the feel of real paper in an impressive way and it seems like these units are relatively light and could be easily transported and handled. Based on what I can see, this is something I would be happy to drag with me just in case I’d get a few minutes to do some reading or writing. However, there are two things that sway my enthusiasm, not being available in Sweden if of course a big issue for starters and I cannot find any reasonable way that I could motivate this expense at this moment in time.

Other products include reMarkable, which also looks very interesting, is available for instant purchase in sweden and coming in at €599, a comparable price to the SONY reader.

Only based on the promotional material (since I do not have access to this product, any of these products really) this also seems like a really impressive piece of technology.  It also seem really light, portable and manageable with a fantastic paper look/feeling and allowing note taking in a natural and effective way.

Last but not least on the list of products I looked at is the Amazon Kindle Oasis 2 (32 GB) coming in at 3490:- ($384 or 314€), is available for purchase in Sweden and is of course slightly cheaper of purchased in the US at $280, though with shipping, tax and import fees the price would be the same if having it shipped here.

So the development of the kindle has been moving forward, you can listen to podcasts/books, the format has changed a bit and from what I understand this new version is also waterproof/water resistant (if you want to go reading in the tub?). What I’m missing in this product is the note taking capability, both just general notes and making highlights and notes in documents/books. Out of the one I have looked at, even though it is missing some of the features I would want including the ability to take notes, the kindle seems to be the most realistic product considering the price tag. It also seems to be the smallest of the readers, which is a bonus since it would be a minimal addition to what I would need to carry with me. I am however a bit skeptical about the new design where not being flat might be an issue for portability and usage. However, the impression I get by looking at the promotional material, the paper feeling seems amazing.

So, I am really feeling the appeal and I would really like to have an eReader with paper feeling. All of the ones I have looked at have their own appeal and they all looks fantastic, the issue being that there is no way I could motivate a $400-$800 purchase to get an electronic notebook and PDF reader with no additional function, which is a shame. So, if anyone from SONY, reMarkable or Amazon would happen to stumble across this post and be interested in a thorough evaluation and review of their product on a site that has a returning visitors count of around one person, you are more then welcome to send me a unit for testing. If anyone else happens to find this post and owns one of these products, pleas leave a little comment regarding your impression.

Disenchantment

It’s finally time! Today, the 17th of August 2018 is finally the premiere for Disenchantment on Netflix, the latest creation from Matt Groening. For someone who has grown up with and has probably watched every episode of The Simpsons (Wiki) and whom with even more anticipation and joy got to enjoy the fantastic series Futurama (Wiki), for which the old VHS recorder was obsessively  programmed and every episode recorded, this is a great day and anticipations are sky high. If this is a good or bad thing, well that all depends on the quality of the series of course. One thing that is however very clear, this series will likely receive both harsh criticism and high praise across the internet from likeminded fans of the same age and demographic as me.

Me? Well, I’ll save the premiere for tonight and enjoy the first episode  “A Princess, an Elf, and a Demon Walked Into a Bar” when I can give it my full and relaxed attention. I don’t know if there is only one episode available or if all of them are available at once since Netflix seems to have a bit of a problem delivering this content in Sweden on the day of the premiere (see Figure 1), if however if there are more episodes available, well I’ll probably just keep watching until I fall asleep.

Figure 1. Error message from Netflix when trying to access the series page on mobile in Sweden, “Could not connect to Netflix, try again”.

If you, like me, is a fan and has both time and energy to watch the episode and want to share your opinions, please do. It is always fun to partake in other peoples opinions.

CTFR – Subdomains for HTTPS websites

I recently found this interesting little script that allow you to enumerate available subdomains for any HTTPS website in just a few seconds.

What makes this script extra nice is that it does not make use of “wordlists” or “brute force” to identify available domains though instead abuses certificate transparency logs.

This script was made available by UnaPibaGeek through Github.

Remember not to abuse this tools, only scan domains/websites that you own or have the owners permission to investigate to avoid potential legal issues or upset emotions.

Cybersecurity 2.0 by Wiley

This week, a previous opportunity is back in a new version.  Humble Bundle is currently offering  14 high quality books from Wiley on IT security for only $15 which is har to beat. You can of course offer any amount above this that you can spare.

This offer includes the following titles:titlar:

  • Secrets and Lies: Digital Security in a Networked World
  • The Shellcoder’s Handbook: Discovering and Exploiting Security Holes
  • Reversing: Secrets of Reverse Engineering
  • Threat Modeling: Designing for Security
  • Engineering: A Guide to Building Dependable Distributed Systems
  • Practical Reverse Engineering: x86, x64, ARM, Windows Kernel, Reversing Tools, and Obfuscation
  • Cryptography Engineering: Design Principles and Practical Applications
  • Wireshark for Security Professionals
  • Malware Analyst’s Cookbook: Tools and Techniques for Fighting Malicious Code
  • The Art of Memory Forensics: Detecting Malware and Threats in Windows, Linux, and Mac Memory
  • Advanced Penetration Testing
  • Investigating Cryptocurrencies
  • The Web Application Hacker’s Handbook: Finding and Exploiting Security Flaws
  • Applied Cryptography: Protocols, Algorithms and Source Code in C

You can make your way directly to the offer via this link and why not choose to donate part of your investment to the EFF?

International Conference on Molecular Imprinting 2018 (MIP2018)

This week, the MIP2018 conference has been hosted in Jerusalem (Israel)

The trip started Saturday last weekend by train to Kastrup at 07:00, against all odds SJ managed to keep their schedule and arrived at Kastrup on time. This ment almost four hours buffer at the airport, an astounding amount of extra time I have seldom experiences on work trips before. For some reason I was selected for a “random check”  and received my “full body scan”. The flight then got delayed from Kastrup as most flights we’ve taken from Denmark, almost an hour delayed. Despite this fact, Lufthansa managed to land in Frankfurt only about 20 minutes late, leaving an unexpected 50 minutes to get across the airport. Slightly less then the 85 minutes we should have gotten though still surprisingly much time compared to what was expected when the airplane was almost han hour delayed.

We made it across the airport, managed to make a quick stop at the taxfree store, past the extra security control we did not expect and caught the flight. This, however, was the most thorough security check I have yet to encounter, our luggage was x-rayed again, which might not be a strange event at the airport. What was however a bit surprising was when I was trying to remove my belt and the women at the x-ray machine told me “it doesn’t matter, we check everyone anyway”. This they did, person number two steps forward with the wand and starts scanning. This metal detector was obviously set to “insanely sensitive” since my entire body lit up like an alarm. This led to a thorough body visitation where the area around my zipper was investigated in detail through squeezing and cupping since (to everyones surprise) the area around my belt buckle and zipper strangely enough set of the alarm like an siren during the scan.

After a couple of nervous minutes (“hold you belt like this”, “do not remove the belt though do not let it interfere”, “pull you pants up”, “put you shirt down”, “DO NOT MOVE YOUR HANDS SIR”, “turn around”, “lift your feet”, “lift your shirt BUT DO NOT MAKE ME LOOSE SIGHT OF YOUR HANDS”) we made it thorough the security checkpoint. After four hours on an over book flight we landed at the Tel Aviv airport. The late hour and the 15 hours in transit was not enough to prevent an admiration for the beautiful airport. The “raining” ceiling, the sandstone details and so much more. With a lump in my stomach we approached the boarder control and after a few minutes it was time to approach the desk. A couple of questions later regarding where I was living and some other things, plus a few minutes of heckling me for Sweden loosing agains Germany in the World Cup I got my entry card and was welcomed into the country.

The taxi trip from the airport was in a luxurious minibuss with working AC, tinted windows and leather seats where the driver was avoiding to put on some sort of 2011 years disko mix. A couple of minutes after midnight we arrived at the hotell and after some hassle regarding the number of rooms we all managed to check into the hotel and pass out a couple of minutes before two.

This might actually be the less problematic conference trip I have yet to enjoy though at the point of writing this, a lot of the week remains and the trip back home remains. Thursday was my time to shine with a presentation scheduled just before lunch. Since this is now written in past tense, the presentation went fairly well, sleep deprived and nervous I managed to put my fot right in my mouth and invoke the slight irritation of a senior researches. Other than that, I think it went fairly well.

Installing AmberTools17 (amber16) on Mac OS X 10.13.3 using MacPorts

This will be a quick and unpolished walkthrough of how you get a version of AmberTools17 and in the same manner Amber16 (if you have a licence) installed using the package manager MacPorts. I will supply a walkthrough using Homebrew at a later point in time and try to polish this post up to a more thorough appealing guide, maybe including pictures.

I switched computer at work a little while ago just running on routine I installed MacPorts as the package manager and started to fill the blanks. During this process though, I kept coming back to the fact that I found a lot of information comparing MacPorts and Homebrew where there is either a small amount of “true believers” or a growing majority of users that recommends Homebrew over MacPorts for various resons. I will not get into the details here though I will make an effort of presenting the details regarding my experience of switching package manager.

As stated in the heading, I am using a relatively new Mac running 10.13.3 at work, though the process should be the same for most OS X versions. I have semi-confirmed this by repeating the process on a 2009 year model MacBook Pro running 10.11 as well.

You have to be an administrator/have administrative rights on the computer you are attempting to install amber on, regardless of which method you choose later on since both MacPorts and Homebrew both requires an administrator password at some point during the installation process.

To install using MacPorts, do the following

  1. Install Xcode from AppStore
  2. Open a new terminal session (cmd+space, write and search for terminal and open the Terminal.app) and run the following commands to install additional components and approve the license agreement.
    xcode-select --install
    xcodebuild -license
  3. Launch Xcode and install any updates
  4. Go to MacPorts hemsida, download and install according to instructions
  5. Go to XQuartz hemsida in order to download and install XQuartz (the replacement for Apples X11 that is no longer available)
  6. Start a new terminal session
  7. Run the following commands
    sudo port selfupdate
    sudo port upgrade outdated
    sudo port install gcc6
    sudo port install mpich-gcc6
    sudo port select --set gcc mp-gcc6
    sudo port select --set mpi mpich-gcc6-fortran
    exit
  8. Register and download AmberTools/Amber from the download site
  9. You’ll receive a file/archive with a name similar to AmberToolsXX.tar.bz2, find this in Finder (likely in your downloads folder), don’t forget to replace XX to the numbers your file actually has. Place this file/archive in a folder where you have read/write permission and where you want to install the package. I will create a folder in my “Home” folder that is called “Software” where I will install AmberTools so this is where I’ll place my downloaded archive file. You can do this in finder using your keyboard and mouse or in the Terminal.app running commands similar to this:
    mkdir ~/Software/
    mv ~/Downloads/AmberToolsXX.tar.bz2 ~/Software/
    cd ~/Software/
  10. If you know how to use the terminal, just “cd” into the directory with the archive file, alternatively if you used the keyboard and mouse/trackpad combo, open a new terminal session, type “cd ” at the $ prompt, don’t forget to ad a trailing space and then “drag-and-drop” the folder icon containing the archive in “Finder”, drag it to the Terminal window and drop it there. This should print out the path to that folder so then just press “enter”/”return” on your keyboard.
  11. When placed in the correct directory in the terminal, run this command
    tar xvf AmberToolsXX.tar.bz2
    to extract the archive.
  12. Then run this command
    export AMBERHOME=~/Software/amberXX/
    (again, replace XX to the correct numbers)
  13. Then run this command to place yourself in the correct subdirectory
    cd $AMBERHOME
  14. and run this command
    ./configure -macAccelerate gnu
    Then compile the serial version first
    make install
  15. Once this process has finished, you’ll be presented with some info and be prompted to perform some actions. This can be performed as following, open a new terminal window (do not close the install terminal yet!) and do the following
    vi ~/.profile
    Press “i” on your keyboard to activate “edit” mode, in the “install terminal” highlight and copy the line reading something similar to below and paste this in the “.profile” terminal in a new line
    test -f ~/Software/amberXX//amber.sh && source ~/Software/amberXX//amber.sh
    Press the “esc” key, hold down “shift” and press the “z” key twice (shift+z+z) to save and exit the editor. In both terminals, type
    exit
  16. Close both terminal windows, quit out of Terminal.app and then start a brand new terminal session. Then runt the following
    cd $AMBERHOME
    make test
  17. If the tests looks OK you now have a working serial installation of Amber/AmberTools. What remains is the parallell version, if inclined then run the following
    cd $AMBERHOME
    ./configure -macAccelerate -mpi gnu
    make install
    export DO_PARALLEL='mpirun -np 2'
    make test.parallel
    export DO-PARALLEL='mpirun -np 4'
    make test.parallel
  18. If the tests work and no large issues are encountered the complete installation is now finished.

This post looks kind of awful, I’ll try to work in some CSS modifications at some point in time.

Lost in Space

Netflix have had a pretty decent fall season this year. I’ve managed to find quite a few little nuggets to listen to or watch a little more active. Now, however, something has come up that I am really looking forward to, a reboot on the old classic series “Lost in Space”.

Now this is something I’m looking forward to with anticipation and joy. It seems that April 13th is the planned release date.

It’s a feature, not a bug

I found a little interesting story explaining how you no longer need to “hack” users to acquire personal information, you can just produce a somewhat successful App for Mac.

Apparently, there is a loophole allowing developers to write apps, sandboxed or not, that can access all screens connected to your mac and perform screen dumps at regular intervals which can be exfiltrated back to the developer. This is obviously a huge privacy and security issue or maybe it’s just “a feature”.

I did not dig into this further than drawing the conclusion that this is an interesting observation. Read more at Felix Krauses page.

Talk like a “pro”

I found this little nugget the other day and found it quite amusing, it generates IT-strategies:

http://whatthefuckismyinformationsecuritystrategy.com/

It produces examples such as:

Protect the organization’s security posture by participating in business continuity planning, data loss, and fraud prevention by emphasizing risk of data loss“, Remediate SOX and PCI gaps by locating PII and driving compliance practices towards regulations by reducing incidents caused by data loss” and “Facilitate and demonstrate ROI through ongoing monitoring and correlation of access control frameworks and standards

While playing around with this I happened to find another page with a similar service though aimed at social media strategies:

http://whatthefuckismysocialmediastrategy.com/

With amusing examples such as:

Amplify word of mouth by motivating influencers“, Target influencers with engaging assets to act as platforms for conversation” and Amplify word of mouth by motivating influencers

I can’t help but going back and looking at these generated strategies, nice clean fun.