Skip to content

Commit 7979a07

Browse files
committedMay 20, 2015
Change CMake variable prefix to LIBOMP
Cached CMake variables need to have a prefix so they don't collide with other projects. This change (a lot of simple changes) simply prefixes cached variables with LIBOMP_ and sets all of these variables to UPPERCASE which is convention. e.g., os => LIBOMP_OS, ompt_support => LIBOMP_OMPT_SUPPORT. Differential Revision: http://reviews.llvm.org/D9829 llvm-svn: 237845
1 parent 58443f2 commit 7979a07

10 files changed

+227
-248
lines changed
 

‎openmp/runtime/Build_With_CMake.txt

+44-45
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ How to call cmake initially, then repeatedly
2525
- Example of configuring, building, reconfiguring, rebuilding:
2626
$ mkdir build
2727
$ cd build
28-
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -Darch=32 .. # Initial configuration
28+
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ARCH=32 .. # Initial configuration
2929
$ make all common
3030
...
3131
$ make clean
32-
$ cmake -Darch=32e -DCMAKE_BUILD_TYPE=Debug .. # Second configuration
32+
$ cmake -DLIBOMP_ARCH=32e -DCMAKE_BUILD_TYPE=Debug .. # Second configuration
3333
$ make all common
3434
...
3535
$ rm -rf *
36-
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -Darch=32e .. # Third configuration
36+
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ARCH=32e .. # Third configuration
3737
$ make all common
3838
- Notice in the example how the compiler definitions are only specified
3939
for an empty build directory, but other Build options are used at any time.
@@ -58,7 +58,7 @@ Instructions to Build
5858
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> ..
5959

6060
[ Intel(R) Many Integrated Core Library (Intel(R) MIC Library) ]
61-
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> -Darch=mic ..
61+
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> -DLIBOMP_ARCH=mic ..
6262

6363
[ Windows Libraries ]
6464
$ cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> -DCMAKE_ASM_MASM_COMPILER=[ml | ml64] -DCMAKE_BUILD_TYPE=Release ..
@@ -71,13 +71,13 @@ Mac* Fat Libraries
7171
On OS X* machines, it is possible to build universal (or fat) libraries which
7272
include both IA-32 architecture and Intel(R) 64 architecture objects in a
7373
single archive; just build the 32 and 32e libraries separately:
74-
$ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32 ..
74+
$ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBOMP_ARCH=32 ..
7575
$ make
76-
$ cmake -Darch=32e ..
76+
$ cmake -DLIBOMP_ARCH=32e ..
7777
$ make
7878
then invoke make again with a special argument as follows:
7979
$ make fat
80-
- The fat target is only available for the arch=32e configuration.
80+
- The fat target is only available for the LIBOMP_ARCH=32e configuration.
8181
- The fat libraries will be put in exports/mac_32e/lib while the "thin" libraries
8282
will be in exports/mac_32e/lib.thin and exports/mac_32/lib.thin
8383

@@ -89,7 +89,7 @@ Compiler options
8989

9090
-DCMAKE_Fortran_COMPILER=<Fortran compiler name>
9191
Unix* systems (Optional as compiler is default):
92-
This option is only needed when -Dcreate_fortran_modules is true
92+
This option is only needed when -DLIBOMP_FORTRAN_MODULES is true
9393

9494
-DCMAKE_ASM_MASM_COMPILER=[ml | ml64 ]
9595
This option is Windows* Only
@@ -101,52 +101,51 @@ Build options
101101
==========================
102102
==== Operating System ====
103103
==========================
104-
-Dos=lin|mac|win
104+
-DLIBOMP_OS=lin|mac|win
105105
* Operating system can be lin (Linux*), mac (Mac*), or win (Windows*).
106106
If not specified, cmake will try to determine your current operating system.
107107

108108
======================
109109
==== Architecture ====
110110
======================
111-
-Darch=32|32e|arm|ppc64|ppc64le|aarch64|mic
111+
-DLIBOMP_ARCH=32|32e|arm|ppc64|ppc64le|aarch64|mic
112112
* Architecture can be 32 (IA-32 architecture), 32e (Intel(R) 64 architecture),
113113
arm (ARM architecture), aarch64 (ARMv8 architecture), ppc64 (PPC64 architecture),
114114
or ppc64le (little endian PPC64 architecture).
115115
* This option, by default is chosen based on the probing the compiler for
116116
architecture macros (e.g., is __x86_64__ predefined by compiler?).
117117

118118
---- First values listed are the default value ----
119-
-Dlib_type=normal|profile|stubs
119+
-DLIBOMP_LIB_TYPE=normal|profile|stubs
120120
Library type can be normal, profile, or stubs.
121121

122122
-DCMAKE_BUILD_TYPE=Release|Debug|RelWithDebInfo
123123
Build type can be Release, Debug, or RelWithDebInfo.
124-
See below for interaction when -DUSE_BUILDPL_RULES is on.
125124

126-
-Dversion=5|4
125+
-DLIBOMP_VERSION=5|4
127126
libiomp5 version can be 5 or 4.
128127

129-
-Domp_version=40|30
128+
-DLIBOMP_OMP_VERSION=40|30
130129
OpenMP version can be either 40 or 30.
131130

132-
-Dmic_arch=knc|knf
131+
-DLIBOMP_MIC_ARCH=knc|knf
133132
Intel(R) MIC Architecture, can be knf or knc.
134-
This value is ignored if os != mic
133+
This value is ignored if LIBOMP_ARCH != mic
135134

136-
-Dcreate_fortran_modules=off|on
135+
-DLIBOMP_FORTRAN_MODULES=off|on
137136
Should the Fortran modules be created (requires Fortran compiler)
138137

139-
-Dstats=off|on
138+
-DLIBOMP_STATS=off|on
140139
Should include stats-gathering code?
141140

142-
-Dompt_support=off|on
141+
-DLIBOMP_OMPT_SUPPORT=off|on
143142
Should OMPT support be turned on?
144143
If ompt_support is off, then both ompt_blame and ompt_trace are ignored.
145144

146-
-Dompt_blame=on|off
145+
-DLIBOMP_OMPT_BLAME=on|off
147146
should OMPT blame functionality be turned on?
148147

149-
-Dompt_trace=on|off
148+
-DLIBOMP_OMPT_TRACE=on|off
150149
should OMPT trace functionality be turned on?
151150

152151
=====================
@@ -155,14 +154,14 @@ should OMPT trace functionality be turned on?
155154
After the library has been built, there are five optional microtests that
156155
can be performed. Some will be skipped based upon the platform.
157156
These tests can be turned on (default) or off with the following options:
158-
-Dtest_touch=on|off -- Should the touch test be done?
159-
-Dtest_relo=on|off -- Should the position independent code test be done?
160-
-Dtest_execstack=on|off -- Should the stack be checked for executability?
161-
-Dtest_instr=on|off -- Should the Intel(R) MIC Libraries be checked
157+
-DLIBOMP_TEST_TOUCH=on|off -- Should the touch test be done?
158+
-DLIBOMP_TEST_RELO=on|off -- Should the position independent code test be done?
159+
-DLIBOMP_TEST_EXECSTACK=on|off -- Should the stack be checked for executability?
160+
-DLIBOMP_TEST_INSTR=on|off -- Should the Intel(R) MIC Libraries be checked
162161
for correct instruction set?
163-
-Dtest_deps=on|off -- Should libiomp5's dependencies be checked?
164-
-Dtests=off|on -- Should any of the above tests be done?
165-
If -Dtests=on is specified, the user can then call:
162+
-DLIBOMP_TEST_DEPS=on|off -- Should libiomp5's dependencies be checked?
163+
-DLIBOMP_MICRO_TESTS=off|on -- Should any of the above tests be done?
164+
If -DLIBOMP_MICRO_TESTS=on is specified, the user can then call:
166165
$ make libiomp-micro-tests
167166
which runs the tests.
168167

@@ -171,45 +170,45 @@ which runs the tests.
171170
============================================
172171
- These flags are *appended*. They do not
173172
overwrite any of the preset flags.
174-
-DLIBIOMP_CPPFLAGS=<space-separated flags> -- Additional C Preprocessor flags
173+
-DLIBOMP_CPPFLAGS=<space-separated flags> -- Additional C Preprocessor flags
175174
(typically additional -Ddef=val flags)
176-
-DLIBIOMP_CFLAGS=<space-separated flags> -- Additional C compiler flags
177-
-DLIBIOMP_CXXFLAGS=<space-separated flags> -- Additional C++ compiler flags
178-
-DLIBIOMP_ASMFLAGS=<space-separated flags> -- Additional assembly flags
179-
-DLIBIOMP_LDFLAGS=<space-separated flags> -- Additional linker flags
180-
-DLIBIOMP_LIBFLAGS=<space-separated flags> -- Additional libraries to link
175+
-DLIBOMP_CFLAGS=<space-separated flags> -- Additional C compiler flags
176+
-DLIBOMP_CXXFLAGS=<space-separated flags> -- Additional C++ compiler flags
177+
-DLIBOMP_ASMFLAGS=<space-separated flags> -- Additional assembly flags
178+
-DLIBOMP_LDFLAGS=<space-separated flags> -- Additional linker flags
179+
-DLIBOMP_LIBFLAGS=<space-separated flags> -- Additional libraries to link
181180
to during link phase
182-
-DLIBIOMP_FFLAGS=<space-separated flags> -- Additional Fortran compiler flags
181+
-DLIBOMP_FFLAGS=<space-separated flags> -- Additional Fortran compiler flags
183182

184183
===================================
185184
==== Feature Based Compilation ====
186185
===================================
187-
-DUSE_BUILDPL_RULES=false|true
186+
-DLIBOMP_USE_BUILDPL_RULES=false|true
188187
Should the build imitate build.pl's build process.
189188
When this is true, the Unix* Release builds will build libiomp5
190189
with -O2 and -g flags activated (same as RelWithDebInfo). Then,
191190
the debug info is stripped out of the library and put into libiomp5.dbg
192191
This is done for interaction with Intel(R) Parallel Amplifier.
193192

194-
-DUSE_ADAPTIVE_LOCKS=true|false
193+
-DLIBOMP_USE_ADAPTIVE_LOCKS=true|false
195194
Should adaptive (TSX-based) locks be included?
196195
These are x86 specific. This feature is turned on by default
197196
for IA-32 architecture and Intel(R) 64 architecture.
198197
Otherwise, it is turned off.
199198

200-
-DUSE_INTERNODE_ALIGNMENT=false|true
199+
-DLIBOMP_USE_INTERNODE_ALIGNMENT=false|true
201200
Should 4096-byte alignment be used for certain data structures?
202201
This option is useful on multinode systems where a small CACHE_LINE
203202
setting leads to false sharing. This option is off by default.
204203

205-
-DUSE_VERSION_SYMBOLS=true|false
204+
-DLIBOMP_USE_VERSION_SYMBOLS=true|false
206205
Should versioned symbols be used for building the library?
207206
This option only makes sense for ELF based libraries where version
208207
symbols are supported (Linux, some BSD* variants). It is off
209208
by default for Windows and Mac, but on for other Unix based operating
210209
systems.
211210

212-
-DUSE_PREDEFINED_LINKER_FLAGS=true|false
211+
-DLIBOMP_USE_PREDEFINED_LINKER_FLAGS=true|false
213212
Should the predefined linker flags in CommonFlags.cmake be included
214213
in the link command? This is true by default and should work for
215214
Linux*, Mac*, and Windows*. The --version-script flag on Unix* based
@@ -225,22 +224,22 @@ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
225224

226225
---- With Various Options ----
227226
- Build the 32 bit Linux library using GCC*
228-
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -Dos=lin -Darch=32 ..
227+
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_OS=lin -DLIBOMP_ARCH=32 ..
229228

230229
- Build the 32 bit debug Mac library using Clang*
231-
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Dos=mac -Darch=32 -DCMAKE_BUILD_TYPE=Debug ..
230+
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBOMP_OS=mac -DLIBOMP_ARCH=32 -DCMAKE_BUILD_TYPE=Debug ..
232231

233232
- Build the library (architecture determined by probing compiler) using the
234233
Intel(R) C Compiler and the Intel(R) C++ Compiler. Also, create the fortran modules using
235234
the Intel(R) Fortran Compiler, enabling the libiomp-micro-tests target and using similar rules that build.pl
236235
would use to build the library.
237-
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -Dtests=on -Dcreate_fortran_modules=on -DUSE_BUILDPL_RULES=on ..
236+
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -DLIBOMP_MICRO_TESTS=on -DLIBOMP_FORTRAN_MODULES=on -DLIBOMP_USE_BUILDPL_RULES=on ..
238237

239238
- Have CMake Find the C/C++ compiler, and specify additional flags for the C compiler, preprocessor, and C++ compiler.
240-
cmake -DLIBIOMP_CFLAGS='Werror' -DLIBIOMP_CPPFLAGS='-DNEW_FEATURE=1 -DOLD_FEATURE=0' -DLIBIOMP_CXXFLAGS='-Werror -Wsign-compare' ..
239+
cmake -DLIBOMP_CFLAGS='Werror' -DLIBOMP_CPPFLAGS='-DNEW_FEATURE=1 -DOLD_FEATURE=0' -DLIBOMP_CXXFLAGS='-Werror -Wsign-compare' ..
241240

242241
---- Build the stubs library ----
243-
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -Dlib_type=stubs ..
242+
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_LIB_TYPE=stubs ..
244243

245244
=========
246245
Footnotes

0 commit comments

Comments
 (0)
Please sign in to comment.