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

Compiling CAVIAR on Mac OS X M1 chip computer with homebrew installed GNU scientific library #29

Open
DesmondSmith opened this issue Oct 14, 2022 · 2 comments

Comments

@DesmondSmith
Copy link

If the GNU scientific library (https://www.gnu.org/software/gsl/) is installed using the homebrew package manager on a macOS X M1 chip computer :

brew install gsl

The gsl folder containing the relevant header files are in "/opt/homebrew/Cellar/gsl/2.7.1/include/"

The CAVIAR packages can be successfully compiled using "make" if the following line is added to "Makefile":

LDFLAGS += -I /opt/homebrew/Cellar/gsl/2.7.1/include/

I added the line on line 4, below

CFLAGS=-c -Wall -g -I $(DIC)

and above

LDFLAGS += -I $(DIC)/armadillo/include/ -DARMA_DONT_USE_WRAPPER -llapack -lblas -lgslcblas -lgsl

That is:

CC=g++
DIC=$(PWD)
CFLAGS=-c -Wall -g -I $(DIC)
LDFLAGS += -I /opt/homebrew/Cellar/gsl/2.7.1/include/
LDFLAGS += -I $(DIC)/armadillo/include/ -DARMA_DONT_USE_WRAPPER -llapack -lblas -lgslcblas -lgsl
SOURCES1=caviar.cpp PostCal.cpp Util.cpp TopKSNP.cpp
... etc.

@phyllip3
Copy link

To get this working I had to include the library paths too.
I added this to the Makefile:
LDFLAGS += -I /opt/homebrew/include/ -L /opt/homebrew/lib/

@laleoarrow
Copy link

laleoarrow commented Apr 16, 2024

To get this working I had to include the library paths too. I added this to the Makefile: LDFLAGS += -I /opt/homebrew/include/ -L /opt/homebrew/lib/

Thanks it does help in my case.

The makefile head is as below:

 🍎  ~/p/s/caviar/CAVIAR-C++  master !1 ?4  head makefile 
CC=g++
DIC=$(PWD)
CFLAGS=-c -Wall -g  -I $(DIC)
LDFLAGS += -I /opt/homebrew/Cellar/gsl/2.7.1/include/
LDFLAGS += -I /opt/homebrew/include/ -L /opt/homebrew/lib/
LDFLAGS += -I $(DIC)/armadillo/include/ -DARMA_DONT_USE_WRAPPER -llapack -lblas -lgslcblas  -lgsl
SOURCES1=caviar.cpp PostCal.cpp Util.cpp TopKSNP.cpp
SOURCES2=ecaviar.cpp PostCal.cpp Util.cpp
SOURCES3=setcaviar.cpp PostCal.cpp Util.cpp
SOURCES4=multipop.cpp PostCalMultiPop.cpp Util.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants