-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathREADME
More file actions
199 lines (180 loc) · 5.73 KB
/
Copy pathREADME
File metadata and controls
199 lines (180 loc) · 5.73 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
+---[ (0) README ]------------------------------------------
| Installing:
| Using a terminal, go to your OCCA directory
| You should see: this README, include, src, lib
| Set OCCA_DIR (check (2) below)
| Type "make" to compile libocca
|
| Running Examples: (After compiling libocca)
| Setup your LD_LIBRARY PATH (check (3) below)
| cd examples/addVectors
| make
| ./main (C++), ./main_c (C), python main.py, etc
|
| Further options can be seen in (4-7)
|
| OS Status:
| Linux and OSX are fully supported
| Windows is partially supported
| - Code is up-to-date for windows
| - Missing compilation project/scripts
| - Visual Studio project is out of date
|
| OKL Status:
| Supports most of C (send bugs =))
| Preprocessor is missing variadic functions
|
| OFL Status:
| Currently only supports a subset of Fortran:
| - integer, real, character, logical, double precision
| - function, subroutine
| - DO, WHILE, IF, IF ELSE, ELSE
|
+===========================================================
+---[ (1) ENVIRONMENT VARIABLES ]---------------------------
|
| (2) OCCA_DIR (Required!)
|
| (3) Useful environment variables:
| LD_LIBRARY_PATH
| OCCA_CACHE_DIR
| OCCA_INCLUDE_PATH
| OCCA_LIBRARY_PATH
| OCCA_CXX
| OCCA_CXXFLAGS
|
| (4) Pthreads Options
| OCCA_PTHREADS_COUNT
|
| (5) OpenCL Options
| OCCA_OPENCL_COMPILER_FLAGS
|
| (6) CUDA Options
| OCCA_CUDA_COMPILER, OCCA_CUDA_COMPILER_FLAGS
|
| (7) COI Options
| OCCA_COI_COMPILER, OCCA_COI_COMPILER_FLAGS
|
| (A) Running OCCA on Matlab
|
| (B) Running OCCA on Fortran
+===========================================================
+---[ (2) OCCA_DIR (Required!) ]----------------------------
| Info:
| Absolute path to the OCCA2, used to find:
| $OCCA_DIR/include
| $OCCA_DIR/src
| $OCCA_DIR/lib
|
| Setting it:
| export OCCA_DIR=/absolute/path/to/dir
+===========================================================
+---[ (3) Useful environment variables ]--------------------
|
| +---[ LD_LIBRARY_PATH ]---------------------
| | Info:
| | Append directory where libocca is stored:
| | $OCCA_DIR/lib
| | to link libocca to your application
| |
| | Setting it:
| | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":${OCCA_DIR}/lib"
| +===========================================
|
| +---[ OCCA_CACHE_DIR ]----------------------
| | Info:
| | Directory where compile kernels are
| | stored (caching binaries). This defaults
| | to:
| | ~/._occa
| |
| | Setting it:
| | export OCCA_CACHE_DIR=/absolute/path/to/dir
| +===========================================
|
| +---[ OCCA_INCLUDE_PATH ]-------------------
| | Info:
| | Append paths for OCCA-mode headers, such as:
| | /path/to/CL (for #include <CL/cl.h>)
| | /path/to/cuda.h (for #include <cuda.h>)
| |
| | Setting it:
| | export OCCA_INCLUDE_PATH="/path/to/CL:/path/to/cuda.h"
| +===========================================
|
| +---[ OCCA_LIBRARY_PATH ]-------------------
| | Info:
| | Append paths for OCCA-mode libraries, such as:
| | /path/to/libOpenCL
| | /path/to/libcuda
| |
| | Setting it:
| | export OCCA_LIBRARY_PATH="/path/to/libOpenCL:/path/to/libcuda"
| +===========================================
|
| +---[ OCCA_CXX ]----------------------------
| | Info:
| | C++ compiler used at runtime
| |
| | Setting it:
| | export OCCA_CXX=clang++
| +===========================================
|
| +---[ OCCA_CXX_FLAGS ]----------------------
| | Info:
| | C++ compiler flags used at runtime
| |
| | Setting it:
| | export OCCA_CXXFLAGS=-g
| +===========================================
+===========================================================
+---[ (4) Pthreads Options ]--------------------------------
| Info:
| OCCA_PTHREAD_COUNT : Threads spawned at each kernel
|
| Setting it:
| export OCCA_PTHREAD_COUNT="8"
+===========================================================
+---[ (5) OpenCL Options ]----------------------------------
| Info:
| OCCA_OPENCL_COMPILER_FLAGS: OpenCL Compiler Flags
|
| Setting it:
| export OCCA_OPENCL_COMPILER_FLAGS="-cl-mad-enable -cl-finite-math-only"
+===========================================================
+---[ (6) CUDA Options ]------------------------------------
| Info:
| OCCA_CUDA_COMPILER : CUDA Compiler
| OCCA_CUDA_COMPILER_FLAGS: CUDA Compiler Flags
|
| Setting it:
| export OCCA_CUDA_COMPILER="nvcc"
| export OCCA_CUDA_COMPILER_FLAGS="-O3"
+===========================================================
+---[ (7) COI Options ]-------------------------------------
| Info:
| OCCA_COI_COMPILER : COI Compiler
| OCCA_COI_COMPILER_FLAGS: COI Compiler Flags
|
| Setting it:
| export OCCA_COI_COMPILER="icpc"
| export OCCA_COI_COMPILER_FLAGS="-O3"
+===========================================================
+--[ (A) MATLAB ]-------------------------------------------
|
| path(strcat(getenv('OCCA_DIR'), '/lib'), path)
|
+===========================================================
+--[ (B) Fortran ]-------------------------------------------
|
| Info:
| OCCA_FORTRAN_ENABLED: Build Fortran wrappers
| FC : Fortran Compiler
| FCFLAGS : Fortran Compiler Flags
|
| Setting it:
| export OCCA_FORTRAN_ENABLED="1"
| export FC="gfortran"
| export FCFLAGS="-O3 -Wall"
|
+===========================================================