Makefile 2.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

ifndef MACH
	MACH := $(shell uname)
endif

ifeq ($(MACH), Linux)
	include ../Linux_g++_make.inc
	ifeq ($(BLAS), 1)
# ===== OpenBLAS ========
		BLASYES = -DCBLAS
		BLASDIR = /exp/opera/kits/OpenBLAS
		BLASINC = -I$(BLASDIR)/include
		BLASLIB = -L$(BLASDIR)/lib
		BLASLIBN = $(BLASLIB) -lopenblas
	endif
else
	include ../Darwin_g++_omp_make.inc
# ===== nNative BLAS (Darwin)
	BLASYES = -DCBLAS -flax-vector-conversions 
	BLASLIBN = -framework Accelerate
	ifeq ($(BLAS), 0)
		BLASYES =
		BLASLIBN =
	endif
endif



# ===== Libsharp =====
#SHARPDIR = <yourdir>/libsharp-code/auto/

SHARPDIR = /Users/campagne/Travail/kits/libsharp-code/auto
SHARPLIB = $(SHARPDIR)/lib
SHARPINC = -I$(SHARPDIR)/include
SHARPLIBN = -L$(SHARPLIB) -lsharp -lc_utils -lfftpack 



#======= LagSHT ======
40
LAGSHTDIR = /Users/campagne/Travail/Software/Laguerre/LagSHT
41 42
LAGSHTLIB = $(LAGSHTDIR)/lib
LAGSHTINC = -I$(LAGSHTDIR)/include
43
LAGSHTLIBN = -L$(LAGSHTLIB) -llagsht
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97


SRC = ./src/
LIB = ./lib/
OBJ = ./objs/
EXE = ./bin/
DATA = ./data/
INCL = ./include/LagSHT/

#  Define our target list
.PHONY: default
default: makedir test3D

.PHONY: all 
all : makedir test3D


.PHONY: makedir
makedir :
	@mkdir -p $(OBJ)
	@mkdir -p $(EXE)

confcheck :
	@echo "Config check mach=<$(MACH)> sharp=<$(SHARPDIR)> blas=<$(BLASDIR)>" 
ifeq ($(BLAS), 1)
	@if [ ! -d "$(BLASDIR)" ]; then \
		echo "BLAS directory not defined properly!"; \
		exit 1; \
	fi ; 
endif
	@if [ ! -d "$(SHARPDIR)" ]; then \
		echo "SHARP directory not defined properly!"; \
		exit 1; \
	fi ; 


.PHONY: tidy
tidy : 
	find . -name "*~" | xargs -I {} rm {}

.PHONY: clean
clean :
	rm -f $(OBJ)/*
	rm -f $(EXE)/*

#C++ common Objects
CXXOBJ =

CXXSHOBJ =

#C++ common Headers
CXXHDR = 

CPPFLAGS  += $(BLASYES) $(SHARPINC) $(BLASINC) $(LAGSHTINC)
98
LDFLAGS   += $(LAGSHTLIBN) $(SHARPLIBN) $(BLASLIBN)    -lm
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117


######################
.PHONY:  test3D
test3D: $(EXE)test3D
	echo '---- test3D made'

$(EXE)test3D : $(OBJ)test3D.o $(CXXOBJ)
	echo "Link..."
	$(CXXLINK) -o $@ $(OBJ)test3D.o  $(CXXOBJ) $(LDFLAGS)

$(OBJ)test3D.o: test3D.cc $(CXXHDR)
	echo "compile... $<"
	$(CXXCOMPILE) $< -o $@