Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADDOCK3 install on MacOS M1 (arm64) #200

Closed
21tesla opened this issue Dec 18, 2021 · 6 comments
Closed

HADDOCK3 install on MacOS M1 (arm64) #200

21tesla opened this issue Dec 18, 2021 · 6 comments
Labels
community contributions from people outside the haddock team documentation Improve docs

Comments

@21tesla
Copy link

21tesla commented Dec 18, 2021

HADDOCK3 installation on an Ubuntu 21 (aarch64) VM running via 10 CPU MacBookPro M1 was straightforward. Thank you for the instructions.

On the MacOS side, it is possible to make HADDOCK3 and run it but it does require a few manual steps. I used homebrew to provide the required software.

Install homebrew, then the compiler and python modules and items required by haddock
brew install gcc-11 pyenv hdf5 hwloc llvm@11 open-mpi openblas

build cns_solve_1.3 for arm64
I transferred the updated source files from haddock2.4 to the source directory of cns_solve_1.3. I modified bin/getarch to output mac-arm-darwin and then made the appropriate machine directory The machine directory includes a Makefile.6.gfortran with references to gcc-11, g++-11 and gfortran-11 from homebrew. I made the binary as usual with make install compiler=gfortran. The
mac-arm64-darwin/source/cns_solve...exe binary was linked to bin/cns in the HADDOCK3 directory

build HADDOCK3 for arm64
install a compatible python and ensure that your shell's $PATH finds it first in ~/.pyenv/shims
pyenv install 3.9.9
pyenv global 3.9.9

manually build two python modules from the requirements.txt file.
I downloaded h5py-3.6.0 and manually built it with the usual python setup.py install
I downloaded llvmlite-0.37.0 and manually built it with the usual python setup.py install
Afterwards the HADDOCK3 installation will complete

The job distributor on HADDOCK3 over the 10 CPUs available on my MacProBook 2021 works flawlessly... congratulations !

For what it's worth, I have successfully built XPLOR-NIH 3.4 for MacOS/arm64 (and the speed relative to my 2019 intel i5 Mac, is > 2x !).

@amjjbonvin
Copy link
Member

amjjbonvin commented Dec 18, 2021 via email

@21tesla
Copy link
Author

21tesla commented Dec 18, 2021

Aaahhh. Yes, I did forget to transfer over the new source files. Thank you.
haddock3/examples/docking -> working
haddock3/examples/docking-protein-protein -> protein blew up
haddock3/examples/rigid-docking -> working
haddock3/examples/scoring -> protein blew up

@amjjbonvin
Copy link
Member

Hi Logan - on my old intel mac (I don't have yet access to a M1 to test things), the protein-protein example works fine.

So it could be a CNS compilation issue. Here are the settings I used to compile CNS last time I did it on my mac using gnu compilers:

F77 = gfortran
F77STD = -fdefault-integer-8 -w
F77OPT = -O3 $(CNS_MALIGN_I86) -funroll-loops -ffast-math -static
F77FLAGS = $(F77STD) $(F77OPT) $(EXT_F77FLAGS) $(F77BUG)

# C options
CC = gcc
CPP = g++
CCFLAGS = -O -DINTEGER='long int' -DCNS_ARCH_TYPE_$(CNS_ARCH_TYPE) $(EXT_CCFLAGS)

# link options
LD = gfortran
LDFLAGS = -w $(EXT_LDFLAGS)

Please note also that haddock3 has been evolving a lot the last few months and we have not yet a new stable release (but should have soon). Also the examples have limited sampling and should not be taking as real examples for a production run.

@amjjbonvin
Copy link
Member

PS: The compiler version I have currently installed is gcc version 11.2.0 (Homebrew GCC 11.2.0)

@joaomcteixeira joaomcteixeira added the documentation Improve docs label Dec 19, 2021
@21tesla
Copy link
Author

21tesla commented Dec 19, 2021

All seems to be well now. Thank you for all your suggestions !

I updated my haddock3 distribution and saw the new example files.

I built new cns_solve_1.3 binaries with no dependencies for three mac platforms:

  • mac-arm64-darwin
  • mac-intel-darwin
  • mac-arm64-linux

All of these builds may be found in this archive

https://drive.google.com/file/d/1l9c0BNboLa3ZudqEgbphaxPVCJZa7CGa/view?usp=sharing

Both my intel and arm64 mac's are homebrew only. I use pyenv to control the active python distribution (set at 3.9.9 for haddock3)

There were some clashes installing the python modules on my M1 mac but the homebrew install on my intel mac works perfectly. Same for the ubuntu-arm64 linux system I run via Parallels.

In the examples/ directory of haddock3, there are no issues with any of the cns_solve binaries now. In some instances I have observed some python problems but I attribute them to haddock3 being a work-in-progress.

Below you will find the Makefile that I used for cns_solve builds and the results from the examples files:


F77 = gfortran-11
F77STD = -w -fdefault-integer-8 -fno-align-commons -fallow-argument-mismatch
F77OPT = -O3 -funroll-loops -ffast-math
F77FLAGS = $(F77STD) $(F77OPT) $(EXT_F77FLAGS) $(F77BUG)

CC = gcc-11
CPP = g++-11
CCFLAGS = -O -DINTEGER='long int' -DCNS_ARCH_TYPE_$(CNS_ARCH_TYPE) $(EXT_CCFLAGS)

LD = gfortran-11
LDFLAGS = $(EXT_LDFLAGS) -static-libgfortran -static-libgcc

compile-utils:
@ cd $(CNS_INST)/utils;
make utils F77="$(F77)" CC="$(CC)" CPP="$(CPP)"
F77FLAGS="-w -O" CCFLAGS="-O"
F77LINK="" CCLINK="-lm"


examples/ results

docking-protein-DNA ... completed
docking-protein-homotrimer ... completed
docking-protein-ligand ... completed
docking-protein-ligand-shape ... completed
docking-protein-peptide ... completed
AttributeError: module 'pdbtools.pdb_segxchain' has no attribute 'run'
docking-protein-protein
'pdbtools.pdb_segxchain' has no attribute 'run'
refine-complex
AttributeError: module 'pdbtools.pdb_segxchain' has no attribute 'run'
scoring
AttributeError: 'dict' object has no attribute 'file_type'

@rvhonorato rvhonorato added community contributions from people outside the haddock team and removed users labels May 10, 2023
@rvhonorato
Copy link
Member

The instructions about building CNS have been introduced in #469 and thanks again for sharing your discoveries @21tesla. The errors you report about the integration tests could have been because of some unrelated bugs. I'll close the issue for now as the instructions are clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contributions from people outside the haddock team documentation Improve docs
Projects
None yet
Development

No branches or pull requests

4 participants