-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.internal
83 lines (62 loc) · 2.09 KB
/
Makefile.internal
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
40
41
42
43
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
#//////////////////////////////////////////////////////////////////////////////
# -- clMAGMA (version 1.3.0) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# @date November 2014
#//////////////////////////////////////////////////////////////////////////////
include $(MAGMA_DIR)/make.inc
#
# Set default values if they are not set in make.inc
#
PGIFORTRAN ?= 0
GPU_TARGET ?= AMD
LIBMAGMA ?= $(MAGMA_DIR)/lib/libclmagma.a
MAGMA_KERNELS ?= $(MAGMA_DIR)/lib/clmagma_kernels.co
CL_COMPILER := $(MAGMA_DIR)/interface_opencl/clcompile
prefix ?= /usr/local/clmagma
ifneq ($(findstring AMD, $(GPU_TARGET)),)
OPTS += -DHAVE_clBLAS -DHAVE_CBLAS
else
$(error GPU_TARGET, currently ${GPU_TARGET}, must contain AMD. Please edit your make.inc file)
endif
LIBEXT = $(LIBDIR) $(LIB)
# INC is all external include directories (CUDA, MKL, etc.).
# It is used for external programs that link with MAGMA, e.g., via pkgconfig.
# INC_MAGMA adds internal magma directories needed to compile magma itself.
INC_MAGMA = $(INC) -I$(MAGMA_DIR)/include -I$(MAGMA_DIR)/control
# Define the pointer size for fortran compilation
PTRFILE = $(MAGMA_DIR)/control/sizeptr.c
PTROBJ = $(MAGMA_DIR)/control/sizeptr.o
PTREXEC = $(MAGMA_DIR)/control/sizeptr
PTRSIZE = $(shell $(PTREXEC))
PTROPT = -Dmagma_devptr_t="integer(kind=$(PTRSIZE))"
$(PTREXEC): $(PTROBJ)
$(CC) $(LDOPTS) -o $@ $<
FOPTS += $(PTROPT)
#
# Rules to compile object files
#
.SUFFIXES:
%.i: %.cpp
$(CC) $(OPTS) $(INC_MAGMA) -E $< -o $@
%.i: %.c
$(CC) $(OPTS) $(INC_MAGMA) -E $< -o $@
# force headers to pre-process as C++
%.i: %.h
$(CXX) $(OPTS) $(INC_MAGMA) -E $< -o $@
%.o: %.cpp
$(CC) $(OPTS) $(INC_MAGMA) -c $< -o $@
%.o: %.c
$(CC) $(OPTS) $(INC_MAGMA) -c $< -o $@
%.o: %.cu
$(NVCC) $(NVOPTS) $(INC_MAGMA) -c $< -o $@
%.o: %.f90 $(PTREXEC)
$(FORT) $(FOPTS) $(INC_MAGMA) -c $< -o $@
%.o: %.F90 $(PTREXEC)
$(FORT) $(FOPTS) $(INC_MAGMA) -c $< -o $@
%.o: %.f $(PTREXEC)
$(FORT) $(F77OPTS) $(INC_MAGMA) -c $< -o $@
-include $(MAGMA_DIR)/Makefile.gen
# reset default goal
.DEFAULT_GOAL :=