-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake.inc.macos
67 lines (52 loc) · 2.11 KB
/
make.inc.macos
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
#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.3.0) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# @date November 2014
#//////////////////////////////////////////////////////////////////////////////
# setenv AMD_CLBLAS_STORAGE_PATH /home/tomov/cl_magma
# GPU_TARGET specifies for which GPUs you want to compile MAGMA.
# In clMAGMA, only AMD is supported, and is the default.
# AMD - clMAGMA with OpenCL on AMD cards
#
#GPU_TARGET ?= AMD
CC = gcc
FORT = gfortran
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
# use -m32 to compile with 32-bit long & pointers.
# use -m64 to compile with 64-bit long & pointers (lp64). int is still 32-bit.
# add -DNDEBUG to disable asserts and certain error checks.
#
# MacOS veclib has a bug where some single precision functions return
# a double precision result, for instance slange.
# This is observed with -m64, but oddly not with -m32.
# The easiest fix is to replace those routines with correct ones from LAPACK.
# See BLAS_FIX below.
# Alternatively, don't link with the veclib/accelerate framework;
# use a different BLAS and LAPACK library.
OPTS = -Wall -Wno-unused -m64 -O3 -DADD_
F77OPTS = -Wall -m64 -O3 -DADD_
FOPTS = -Wall -m64 -O3 -DADD_ -x f95-cpp-input
LDOPTS = -Wall -m64
LIB = -framework Accelerate -lstdc++ -lm
LIB += -lclBLAS -framework OpenCL
# define library directories preferably in your environment, or here.
##ACMLDIR ?= /opt/acml-4.4.0
##clBLAS ?= /opt/clBLAS
##-include make.check-acml
-include make.check-clblas
LIBDIR = -L$(clBLAS)/lib64
INC = -I$(clBLAS)/include
# ========================================
# replace single & single-complex BLAS functions with reference versions.
# (i.e., functions that return float; subroutines do not need a fix.)
LIB := -L$(MAGMA_DIR)/lib -lblas_fix $(LIB)
BLAS_FIX = $(MAGMA_DIR)/lib/libblas_fix.a
.PHONY: blas_fix
blas_fix:
@echo "======================================== BLAS fix for MacOS"
( cd $(MAGMA_DIR)/blas_fix && $(MAKE) )
lib: blas_fix