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

Reorganize Makefile, allowing MacOS & Linux build from a single makefile. #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/

*.o
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,38 @@ If you prefer to using newly released GTEx v8 eQTL annotation for analysis, plea
+ [Multi-tissue eQTL annotation with hg38 position ID](https://drive.google.com/open?id=1kfH_CffxyCtZcx3z7k63rIARNidLv1_P)
+ [Multi-tissue eQTL annotation with rs ID](https://drive.google.com/open?id=1rSaHenk8xOFtQo7VuDZevRkjUz6iwuj0)

## Building fastenloc
You will need a working C++ compiler and `make` already installed and configured. Installing additional library
dependencies is described below.
### Debian family (Ubuntu)
```shell
sudo apt install libgsl-dev libboost-iostreams-dev zlib1g-dev
cd src
make
```

### RHEL family (CentOS, Rocky)
```shell
sudo yum install boost-devel gsl-devel zlib-devel
cd src
make
```

### Other Linux, or building libraries from source:
* [GNU Scientific Library](https://www.gnu.org/software/gsl/)
* [ZLib](https://zlib.net/)
* [Boost iostreams](https://www.boost.org/doc/libs/)

### MacOS
You will want [Homebrew](https://brew.sh/) installed to easily install libraries. It's possible to build all of the necessary
library dependencies from scratch if you prefer.

```shell
brew install gsl boost libomp
cd src
make
```


## Citation

Expand Down
10 changes: 0 additions & 10 deletions src/MacOS/Makefile.macOS

This file was deleted.

27 changes: 0 additions & 27 deletions src/MacOS/README.md

This file was deleted.

34 changes: 26 additions & 8 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
main: main.o controller.o sigCluster.o
g++ -fopenmp -O3 main.o controller.o sigCluster.o -lm -lgsl -lgslcblas -lboost_iostreams -lz -o fastenloc
static: main.o controller.o sigCluster.o
g++ -fopenmp -O3 main.o controller.o sigCluster.o -lm -lgsl -lgslcblas -lboost_iostreams -lz -static -o fastenloc.static
main.o: main.cc
g++ -c main.cc
CXX=g++
CXXFLAGS+=-O3 -Wall
LDLIBS+=-lm -lgsl -lgslcblas -lboost_iostreams -lz

UNAME_S := $(shell uname -s)

# MacOS / Homebrew specific configuration
ifeq ($(UNAME_S),Darwin)
CPPFLAGS+=-isystem /opt/homebrew/include # Mac libraries installed via Homebrew
CPPFLAGS+=-Xpreprocessor -fopenmp # Mac openmp
LDFLAGS+=-L/opt/homebrew/lib # Homebrew library location
LDLIBS+=-lomp #only need lomp on Mac OS
endif


objects = main.o controller.o sigCluster.o

all: fastenloc

fastenloc: $(objects)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(objects) $(LDLIBS) -o fastenloc
static: $(objects)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(objects) $(LDLIBS) -static -o fastenloc.static

controller.o: controller.cc controller.h
g++ -fopenmp -c controller.cc
sigCluster.o: sigCluster.h sigCluster.cc
g++ -c sigCluster.cc

.PHONY: clean
clean:
rm *.o fastenloc