citiususc / veryfasttree

Efficient phylogenetic tree inference for massive taxonomic datasets
Other
111 stars 5 forks source link

Support for macOS #14

Closed corneliusroemer closed 12 months ago

corneliusroemer commented 1 year ago

It would be nice if you could mention which OSes you support. It seems that windows and linux are supported, but macOS isn't - though this doesn't seem to be explicitly mentioned in the README - you skip bioconda osx builds here: https://github.com/bioconda/bioconda-recipes/blob/029f3043cef71d65be20d05016d79a0d26038246/recipes/veryfasttree/meta.yaml#L15

cesarpomar commented 1 year ago

AppleClang lacks direct support for OpenMP, which causes compilation failures. The alternative for macOS is to use gcc, which works without any issues. The reason there is no binary for macOS in bioconda is that they only build with AppleClang, and as long as it does not support OpenMP, it fails. However, Clang currently supports OpenMP and can even be used as a replacement for gcc to compile VeryFastTree on Linux. It is conceivable that AppleClang will be compatible someday. This implies that VeryFastTree is compatible with Windows, Linux, and Mac. However, releasing binaries for macOS faces similar challenges as mentioned in the Linux issue13.

corneliusroemer commented 1 year ago

Thanks! I managed to build it on my arm mac, and it seemed to use multithreading correctly when I specified -threads 10.

Here's how (I installed libomp through homebrew)

brew install libomp
export CMAKE_PREFIX_PATH="/opt/homebrew/Cellar/libomp/16.0.6"
cmake -DUSE_NATIVE=ON .
make

Not sure if this approach is compatible with bioconda though.

cesarpomar commented 1 year ago

Could you verify the CMake trace to ensure it states "The CXX compiler identification is ..." and confirm that it is "AppleClang," and also check if Clang was not used to enable OpenMP functionality?

Regarding bioconda, once we can confirm that it compiles with AppleClang, the next step would be to remove the skip from the YAML file and verify if it builds successfully in a mac and then in the bioconda environment.

cesarpomar commented 12 months ago

The latest version of VeryFastTree is now available for Mac through MacPorts. We have also considered adding it to Homebrew, but they won't accept it until it reaches a minimum reputation measured in stars(75).

You can install an optimized version for your Mac using "port install veryfasttree +native." This version is compiled with AppleClang, so it should also be possible to contribute it to Bioconda.

The Bioconda script requires a review to add more optimized binaries, and we will take this opportunity to add support for Mac as well.