Commit 79f5c5f6 authored by Jean-Eric Campagne's avatar Jean-Eric Campagne
Browse files

(JEC) 15/4/15 use Accelerate Framework instead of OpenBLAS on Darwin; adapt the Makefile

parent 2acbc31f
#include Linux_g++_make.inc
include Darwin_g++_omp_make.inc
ifeq ($(MACH), Linux)
include Linux_g++_make.inc
ifeq ($(BLAS), 1)
# ===== OpenBLAS ========
BLASYES = -DCBLAS
BLASDIR = /opt/local/
BLASLIB = $(BLASDIR)/lib
BLASLIBN = -lopenblas
BLASYES = -DCBLAS
BLASDIR = /opt/local/
BLASLIB = -L$(BLASDIR)/lib
BLASLIBN = -lopenblas
endif
else
include Darwin_g++_omp_make.inc
# ===== nNative BLAS (Darwin)
BLASYES = -DCBLAS -flax-vector-conversions
BLASLIBN = -framework Accelerate
endif
# ===== Libsharp =====
......@@ -71,7 +77,7 @@ CXXHDR = lagsht_exceptions.h \
CPPFLAGS += $(BLASYES) -I$(SHARPINC) -I$(BLASINC)
LDFLAGS += -L$(SHARPLIB) $(SHARPLIBN) -L$(BLASLIB) $(BLASLIBN) -lm
LDFLAGS += -L$(SHARPLIB) $(SHARPLIBN) $(BLASLIB) $(BLASLIBN) -lm
......
......@@ -25,17 +25,17 @@ Look at the `libsharp-code/libsharp/sharp_cxx.h` file and add if necessary
sharp_geom_info* get_geom_info() { return ginfo;}
sharp_alm_info* get_alm_info() { return ainfo; }
* OpenBLAS:
* OpenBLAS (not Darwin):
If the variable `CBLAS` is defined then the code of laguerreTransform.cc use the BLAS matrix multiplication highly optimized. See installation in the Readme.md using
`git clone https://github.com/xianyi/OpenBLAS.git`
**WARNING** on Darwin the `cmath.h` is replaced by `cmath_openblas.h`
**WARNING** on Darwin the Makefile use the `Accelerate Framework` features which are a bit more effective than OpenBLAS.
# Compilation
> edit Makefile and adapat to local platform :
1) adapt to the type of Machine MacOSX (Darwin) vs Linux
2) adapt the location of the libsharp library (SHARPDIR)
> mkdir Objs
3) on Linux adapt the location of BLAS/OpenBLAS
> make
> make check
runs a computation of the Nodes & Weights for N=1024
......
......@@ -2,10 +2,15 @@
#include <iostream>
#include <algorithm> // for copy
#include <iterator> // for ostream_iterator
#ifdef CBLAS
#ifdef Darwin
#include <Accelerate/Accelerate.h>
#elif Linux
#include <cblas.h>
//#include <cblas_openblas.h> //Darwin
#endif
#endif
using namespace std;
#include "laguerreTransform.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment