2

I have been trying to run the make command and keep getting error codes. I have installed gcc with homebrew. When I run the code from github

if I use

make STARforMacStatic CXX=/usr/bin/gcc

I get the following error

date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
/usr/bin/gcc -c   -O3 -std=c++11 -fopenmp -D'COMPILATION_TIME_PLACE=" :/Users/elizabethbonner/STAR-2.7.9a/source"' -D'COMPILE_FOR_MAC' -pipe -Wall -Wextra SoloFeature_collapseUMI_Graph.cpp
clang: error: unsupported option '-fopenmp'
make: *** [SoloFeature_collapseUMI_Graph.o] Error 1

I am sure I am missing something simple

EBonner
  • 21
  • 1
  • 1
    Have a look at the answers here: https://stackoverflow.com/q/43555410/1968 — But actually if you look [at the instructions](https://github.com/alexdobin/STAR#compile-under-mac-os-x) it seems that STAR might require GCC instead of clang; and `/usr/bin/gcc` on macOS *is clang, not GCC!* – Konrad Rudolph Dec 13 '21 at 21:21

1 Answers1

0

The shortest and easiest way to install STAR aligner on a MacOS or Linux machine is to first install conda - I would install miniconda and not anaconda (because anaconda installs bunch of stuff you never need - miniconda is the stripped off version of anaconda):

# download the installer bash script by:
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
# then run the install script by:
$ bash Miniconda3-latest-MacOSX-x86_64.sh

then create a conda environment by:

# create a virtual environment named "star"
conda create --name star
# enter the virtual environment by:
conda activate star # or: source activate star

and then, in the environment, run this command which will install you a fully functional STAR version with all dependencies it needs:

$ conda install -c bioconda star

Conda will take care of all the dependencies and install STAR aligner and you could then immediately begin to run it.

Alternatively, if you insist in installing from source, run

$ conda install -c bioconda start --only-deps

It installs you all dependencies which STAR needs. Then, install your STAR from source whil still in the conda environment - I guess this installation will work (except the dependency versions changed ...).

Gwang-Jin Kim
  • 9,303
  • 17
  • 30
  • 2
    While I'm all for Conda and would even say it has become **the** *de facto* package manager for computational biologists, the STAR build from Bioconda is [literally just a copy of the binary](https://github.com/bioconda/bioconda-recipes/blob/master/recipes/star/build.sh) that Alex distributes [in the GitHub repo directly](https://github.com/alexdobin/STAR/tree/master/bin/MacOSX_x86_64). So, if OP has a question about compiling from scratch, I wouldn't consider a recommendation for installing a precompiled version to be a proper answer - more of a comment. – merv Dec 14 '21 at 18:29
  • @merv thanks for comment - but why not? - I don't know the intricacies of the conda package for STAR. However, I find it practical - even if the bioconda package usually is a little bit behind in versioning. It is installed within minutes - and no headache to waste about dependencies. And there are possibilities - e.g. with the `--only-deps` flag - he could install only the dependencies and then on top of this background install STAR from source/binary ... – Gwang-Jin Kim Dec 14 '21 at 21:23
  • 1
    @merv Imho if an OP has compilation questions that are as basic as this (missing openmp support) then it is much more likely they are trying to compile because they're unaware of package managers such as conda or existing binaries, rather than trying to sequeeze out the last tiny bit of performance out of a tool by a native compilation, especially on a Mac that is limited in RAM and cores for a hungry application such as the STAR aligner. – ATpoint Dec 16 '21 at 13:39