~ubuntu-branches/debian/experimental/cubew/experimental

« back to all changes in this revision

Viewing changes to vendor/common/build-config/m4/ac_scorep_compiler_and_flags.m4

  • Committer: Package Import Robot
  • Author(s): Andreas Beckmann
  • Date: 2017-12-22 10:16:20 UTC
  • Revision ID: package-import@ubuntu.com-20171222101620-5kgzz922neq7h2ho
Tags: upstream-4.4~rc1
ImportĀ upstreamĀ versionĀ 4.4~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## -*- mode: autoconf -*-
 
2
 
 
3
##
 
4
## This file is part of the Score-P software (http://www.score-p.org)
 
5
##
 
6
## Copyright (c) 2009-2011,
 
7
## RWTH Aachen University, Germany
 
8
##
 
9
## Copyright (c) 2009-2011,
 
10
## Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
 
11
##
 
12
## Copyright (c) 2009-2011,2014
 
13
## Technische Universitaet Dresden, Germany
 
14
##
 
15
## Copyright (c) 2009-2011,
 
16
## University of Oregon, Eugene, USA
 
17
##
 
18
## Copyright (c) 2009-2014, 2017,
 
19
## Forschungszentrum Juelich GmbH, Germany
 
20
##
 
21
## Copyright (c) 2009-2011,
 
22
## German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
 
23
##
 
24
## Copyright (c) 2009-2011,
 
25
## Technische Universitaet Muenchen, Germany
 
26
##
 
27
## This software may be modified and distributed under the terms of
 
28
## a BSD-style license.  See the COPYING file in the package base
 
29
## directory for details.
 
30
##
 
31
 
 
32
## file ac_scorep_compiler_and_flags.m4
 
33
 
 
34
 
 
35
AC_DEFUN([AC_SCOREP_CONVERT_FOR_BUILD_FLAGS],
 
36
[
 
37
if test "x${ac_cv_env_[$1]_FOR_BUILD_set}" != "xset"; then
 
38
   # don't use the default flags if nothing is specified for the frontend
 
39
   unset [$1]
 
40
else
 
41
   # use the FOR_BUILD flags
 
42
   [$1]="$ac_cv_env_[$1]_FOR_BUILD_value"
 
43
fi
 
44
])
 
45
 
 
46
AC_DEFUN([AC_SCOREP_CONVERT_MPI_FLAGS],
 
47
[
 
48
if test "x${ac_cv_env_MPI_[$1]_set}" != "xset"; then
 
49
   # don't use the default flags if nothing is specified for MPI
 
50
   unset [$1]
 
51
else
 
52
   # use the MPI flags
 
53
   [$1]="$ac_cv_env_MPI_[$1]_value"
 
54
fi
 
55
])
 
56
 
 
57
AC_DEFUN([AC_SCOREP_CHECK_COMPILER_VAR_SET],
 
58
[
 
59
if test "x${ac_cv_env_[$1]_set}" != "xset"; then
 
60
    AC_MSG_ERROR([argument $1 not provided in configure call.], [1])
 
61
fi
 
62
])
 
63
 
 
64
 
 
65
AC_DEFUN([AC_SCOREP_CONVERT_FOR_BUILD_COMPILER],
 
66
[
 
67
if test "x${ac_cv_env_[$1]_FOR_BUILD_set}" != "xset"; then
 
68
    # don't use the default compiler if nothing is specified for the frontend
 
69
    unset [$1]
 
70
else
 
71
    [$1]="$ac_cv_env_[$1]_FOR_BUILD_value"
 
72
fi
 
73
])
 
74
 
 
75
AC_DEFUN([AC_SCOREP_CONVERT_MPI_COMPILER],
 
76
[
 
77
if test "x${ac_cv_env_MPI[$1]_set}" != "xset"; then
 
78
    # don't use the default compiler if nothing is specified for MPI
 
79
    unset [$1]
 
80
else
 
81
    [$1]="$ac_cv_env_MPI[$1]_value"
 
82
fi
 
83
])
 
84
 
 
85
 
 
86
dnl do not use together with AC_SCOREP_WITH_NOCROSS_COMPILER_SUITE
 
87
AC_DEFUN([AC_SCOREP_WITH_COMPILER_SUITE],
 
88
[
 
89
AC_REQUIRE([AC_SCOREP_DETECT_PLATFORMS])
 
90
AS_IF([test "x${ac_compiler_suite_detected}" != "xyes"],
 
91
      [
 
92
       ac_scorep_compilers_frontend="platform-frontend-${ac_scorep_platform}"
 
93
       ac_scorep_compilers_backend="platform-backend-${ac_scorep_platform}"
 
94
      ])
 
95
# ac_scorep_compilers_mpi set in AC_SCOREP_WITH_MPI_COMPILER_SUITE
 
96
 
 
97
m4_pattern_allow([AC_SCOREP_WITH_COMPILER_SUITE])
 
98
m4_pattern_allow([AC_SCOREP_WITH_NOCROSS_COMPILER_SUITE])
 
99
AS_IF([test "x${ac_scorep_compiler_suite_called}" != "x"],
 
100
    [AC_MSG_ERROR([cannot use [AC_SCOREP_WITH_COMPILER_SUITE] and [AC_SCOREP_WITH_NOCROSS_COMPILER_SUITE] in one configure.ac.])],
 
101
    [ac_scorep_compiler_suite_called="yes"])
 
102
 
 
103
AC_ARG_WITH([nocross-compiler-suite],
 
104
            [AS_HELP_STRING([--with-nocross-compiler-suite=(gcc|ibm|intel|pgi|studio|open64|clang|pathscale)], 
 
105
                            [The compiler suite used to build this package in non cross-compiling environments. Needs to be in $PATH [gcc].])],
 
106
            [AS_IF([test "x${ac_scorep_cross_compiling}" = "xno"],
 
107
                   [ac_scorep_compilers_backend="compiler-nocross-gcc" # default
 
108
                    AS_CASE([$withval],
 
109
                            ["gcc"],       [ac_scorep_compilers_backend="compiler-nocross-gcc"],
 
110
                            ["ibm"],       [ac_scorep_compilers_backend="compiler-nocross-ibm"],
 
111
                            ["intel"],     [ac_scorep_compilers_backend="compiler-nocross-intel"],
 
112
                            ["pgi"],       [ac_scorep_compilers_backend="compiler-nocross-pgi"],
 
113
                            ["studio"],    [ac_scorep_compilers_backend="compiler-nocross-studio"],
 
114
                            ["open64"],    [ac_scorep_compilers_backend="compiler-nocross-open64"],
 
115
                            ["clang"],     [ac_scorep_compilers_backend="compiler-nocross-clang"],
 
116
                            ["pathscale"],     [ac_scorep_compilers_backend="compiler-nocross-pathscale"],
 
117
                            ["no"],        [AC_MSG_ERROR([option --without-nocross-compiler-suite makes no sense.])],
 
118
                            [AC_MSG_ERROR([compiler suite "${withval}" not supported by --with-nocross-compiler-suite.])])],
 
119
                   [AC_MSG_WARN([option --with-nocross-compiler-suite ignored in cross-compiling mode. You may use --with-frontend-compiler-suite to customize the frontend compiler.])])])
 
120
AS_IF([test -f "AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_backend}"],
 
121
      [ac_scorep_compilers_backend="AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_backend}"],
 
122
      [ac_scorep_compilers_backend="AFS_COMPILER_FILES_COMMON/${ac_scorep_compilers_backend}"])
 
123
 
 
124
 
 
125
AC_ARG_WITH([frontend-compiler-suite],
 
126
            [AS_HELP_STRING([--with-frontend-compiler-suite=(gcc|ibm|intel|pgi|studio|open64|clang|pathscale)], 
 
127
                            [The compiler suite used to build the frontend parts of this package in cross-compiling environments. Needs to be in $PATH [gcc].])],
 
128
            [AS_IF([test "x${ac_scorep_cross_compiling}" = "xyes"],
 
129
                   [ac_scorep_compilers_frontend="compiler-frontend-gcc"
 
130
                    AS_CASE([$withval],
 
131
                            ["gcc"],       [ac_scorep_compilers_frontend="compiler-frontend-gcc"],
 
132
                            ["ibm"],       [ac_scorep_compilers_frontend="compiler-frontend-ibm"],
 
133
                            ["intel"],     [ac_scorep_compilers_frontend="compiler-frontend-intel"],
 
134
                            ["pgi"],       [ac_scorep_compilers_frontend="compiler-frontend-pgi"],
 
135
                            ["studio"],    [ac_scorep_compilers_frontend="compiler-frontend-studio"],
 
136
                            ["open64"],    [ac_scorep_compilers_frontend="compiler-frontend-open64"],
 
137
                            ["clang"],     [ac_scorep_compilers_frontend="compiler-frontend-clang"],                            
 
138
                            ["pathscale"],     [ac_scorep_compilers_frontend="compiler-frontend-pathscale"],                            
 
139
                            ["no"],        [AC_MSG_ERROR([option --without-frontend-compiler-suite makes no sense.])],
 
140
                            [AC_MSG_ERROR([compiler suite "${withval}" not supported by --with-frontend-compiler-suite.])])],
 
141
                   [AC_MSG_ERROR([Option --with-frontend-compiler-suite not supported in non cross-compiling mode. Please use --with-nocross-compiler-suite instead.])])])
 
142
AS_IF([test -f "AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_frontend}"],
 
143
      [ac_scorep_compilers_frontend="AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_frontend}"],
 
144
      [ac_scorep_compilers_frontend="AFS_COMPILER_FILES_COMMON/${ac_scorep_compilers_frontend}"])
 
145
])# AC_SCOREP_WITH_COMPILER_SUITE
 
146
 
 
147
 
 
148
AC_DEFUN([AC_SCOREP_WITH_MPI_COMPILER_SUITE],
 
149
[
 
150
AC_REQUIRE([AC_SCOREP_DETECT_PLATFORMS])
 
151
 
 
152
scorep_mpi_user_disabled="no"
 
153
AC_ARG_WITH([mpi],
 
154
    [AS_HELP_STRING([--with-mpi=(bullxmpi|hp|ibmpoe|intel|intel2|intel3|intelpoe|lam|mpibull2|mpich|mpich2|mpich3|openmpi|platform|scali|sgimpt|sgimptwrapper|sun)],
 
155
         [The MPI compiler suite to build this package in non cross-compiling mode. Usually autodetected. Needs to be in $PATH.])],
 
156
    [AS_IF([test "x${withval}" = xno],
 
157
         [scorep_mpi_user_disabled=yes
 
158
          ac_scorep_compilers_mpi="compiler-mpi-without"
 
159
         ],
 
160
         [AS_IF([test "x${ac_scorep_cross_compiling}" = "xno" && test "x${ac_scorep_platform}" != "xaix"],
 
161
              [AS_CASE([$withval],
 
162
                   ["bullxmpi"], [ac_scorep_compilers_mpi="compiler-mpi-bullxmpi"],
 
163
                   ["hp"], [ac_scorep_compilers_mpi="compiler-mpi-hp"],
 
164
                   ["ibmpoe"], [ac_scorep_compilers_mpi="compiler-mpi-ibmpoe"],
 
165
                   ["intel"], [ac_scorep_compilers_mpi="compiler-mpi-intel"],
 
166
                   ["intel2"], [ac_scorep_compilers_mpi="compiler-mpi-intel2"],
 
167
                   ["intel3"], [ac_scorep_compilers_mpi="compiler-mpi-intel3"],
 
168
                   ["impi"], [AC_MSG_WARN([option 'impi' to --with-mpi deprecated, use 'intel2' instead.])
 
169
                              ac_scorep_compilers_mpi="compiler-mpi-intel2"],
 
170
                   ["intelpoe"], [ac_scorep_compilers_mpi="compiler-mpi-intelpoe"],
 
171
                   ["lam"], [ac_scorep_compilers_mpi="compiler-mpi-lam"],
 
172
                   ["mpibull2"], [ac_scorep_compilers_mpi="compiler-mpi-mpibull2"],
 
173
                   ["mpich"], [ac_scorep_compilers_mpi="compiler-mpi-mpich"],
 
174
                   ["mpich2"], [ac_scorep_compilers_mpi="compiler-mpi-mpich2"],
 
175
                   ["mpich3"], [ac_scorep_compilers_mpi="compiler-mpi-mpich3"],
 
176
                   ["openmpi"], [ac_scorep_compilers_mpi="compiler-mpi-openmpi"],
 
177
                   ["platform"], [ac_scorep_compilers_mpi="compiler-mpi-platform"],
 
178
                   ["scali"], [ac_scorep_compilers_mpi="compiler-mpi-scali"],
 
179
                   ["sgimpt"], [ac_scorep_compilers_mpi="compiler-mpi-sgimpt"],
 
180
                   ["sgimptwrapper"], [ac_scorep_compilers_mpi="compiler-mpi-sgimptwrapper"],
 
181
                   ["sun"], [ac_scorep_compilers_mpi="compiler-mpi-sun"],
 
182
                   [AC_MSG_ERROR([MPI compiler suite "${withval}" not supported by --with-mpi.])])
 
183
              ])
 
184
         ])
 
185
     # omit check "if in PATH" for now. Will fail in build-mpi configure.
 
186
    ],
 
187
    [AS_IF([test "x${ac_scorep_cross_compiling}" = "xno" && test "x${ac_scorep_platform}" != "xaix"],
 
188
         [AFS_COMPILER_MPI
 
189
          ac_scorep_compilers_mpi="compiler-mpi-${afs_compiler_mpi}"])
 
190
    ])
 
191
 
 
192
AS_IF([test "x${scorep_mpi_user_disabled}" = xno],
 
193
    [AS_IF([test "x${ac_scorep_cross_compiling}" = "xyes" || test "x${ac_scorep_platform}" = "xaix"],
 
194
         [ac_scorep_compilers_mpi="platform-mpi-${ac_scorep_platform}"])])
 
195
 
 
196
AS_IF([test -f "AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_mpi}"],
 
197
      [ac_scorep_compilers_mpi="AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_mpi}"],
 
198
      [ac_scorep_compilers_mpi="AFS_COMPILER_FILES_COMMON/${ac_scorep_compilers_mpi}"])
 
199
# sanity checks missing
 
200
])# AC_SCOREP_WITH_MPI_COMPILER_SUITE
 
201
 
 
202
 
 
203
AC_DEFUN([AC_SCOREP_PRECIOUS_VARS_MPI],
 
204
[
 
205
AC_ARG_VAR(MPICC,[MPI C compiler command])
 
206
AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
 
207
AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
 
208
AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
 
209
AC_ARG_VAR(MPI_CPPFLAGS, [MPI (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir>])
 
210
AC_ARG_VAR(MPI_CFLAGS, [MPI C compiler flags])
 
211
AC_ARG_VAR(MPI_CXXFLAGS, [MPI C++ compiler flags])
 
212
AC_ARG_VAR(MPI_FFLAGS, [MPI Fortran 77 compiler flags])
 
213
AC_ARG_VAR(MPI_FCFLAGS, [MPI Fortran compiler flags])
 
214
AC_ARG_VAR(MPI_LDFLAGS, [MPI linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>])
 
215
AC_ARG_VAR(MPI_LIBS, [MPI libraries to pass to the linker, e.g. -l<library>])
 
216
])
 
217
 
 
218
AC_DEFUN([AC_SCOREP_PRECIOUS_VARS_FOR_BUILD],
 
219
[
 
220
AC_ARG_VAR(CC_FOR_BUILD, [C compiler command for the frontend build])
 
221
AC_ARG_VAR(CXX_FOR_BUILD, [C++ compiler command for the frontend build])
 
222
AC_ARG_VAR(F77_FOR_BUILD, [Fortran 77 compiler command for the frontend build])
 
223
AC_ARG_VAR(FC_FOR_BUILD, [Fortran compiler command for the frontend build])
 
224
AC_ARG_VAR(CPPFLAGS_FOR_BUILD, [(Objective) C/C++ preprocessor flags for the frontend build, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir>])
 
225
AC_ARG_VAR(CFLAGS_FOR_BUILD, [C compiler flags for the frontend build])
 
226
AC_ARG_VAR(CXXFLAGS_FOR_BUILD, [C++ compiler flags for the frontend build])
 
227
AC_ARG_VAR(FFLAGS_FOR_BUILD, [Fortran 77 compiler flags for the frontend build])
 
228
AC_ARG_VAR(FCFLAGS_FOR_BUILD, [Fortran compiler flags for the frontend build])
 
229
AC_ARG_VAR(LDFLAGS_FOR_BUILD, [linker flags for the frontend build, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>])
 
230
AC_ARG_VAR(LIBS_FOR_BUILD, [libraries to pass to the linker for the frontend build, e.g. -l<library>])
 
231
])
 
232
 
 
233
 
 
234
dnl --------------------------------------------------------------------
 
235
 
 
236
 
 
237
AC_DEFUN([AFS_WITH_SHMEM_COMPILER_SUITE],
 
238
[
 
239
AC_REQUIRE([AC_SCOREP_DETECT_PLATFORMS])
 
240
 
 
241
scorep_shmem_user_disabled="no"
 
242
AC_ARG_WITH([shmem],
 
243
    [AS_HELP_STRING([--with-shmem=(openshmem|openmpi|sgimpt|sgimptwrapper)],
 
244
         [The SHMEM compiler suite to build this package in non cross-compiling mode. Usually autodetected. Needs to be in $PATH.])],
 
245
    [AS_IF([test "x${withval}" = xno],
 
246
         [scorep_shmem_user_disabled=yes
 
247
          ac_scorep_compilers_shmem="compiler-shmem-without"
 
248
         ],
 
249
         [AS_IF([test "x${ac_scorep_cross_compiling}" = "xno" && test "x${ac_scorep_platform}" != "xaix"],
 
250
              [AS_CASE([$withval],
 
251
                   ["openshmem"], [ac_scorep_compilers_shmem="compiler-shmem-openshmem"],
 
252
                   ["openmpi"], [ac_scorep_compilers_shmem="compiler-shmem-openmpi"],
 
253
                   ["sgimpt"], [ac_scorep_compilers_shmem="compiler-shmem-sgimpt"],
 
254
                   ["sgimptwrapper"], [ac_scorep_compilers_shmem="compiler-shmem-sgimptwrapper"],
 
255
                   [AC_MSG_ERROR([SHMEM compiler suite "${withval}" not supported by --with-shmem.])])
 
256
              ])
 
257
         ])
 
258
     # omit check "if in PATH" for now.
 
259
    ],
 
260
    [AS_IF([test "x${ac_scorep_cross_compiling}" = "xno" && test "x${ac_scorep_platform}" != "xaix"],
 
261
         [AFS_COMPILER_SHMEM
 
262
          ac_scorep_compilers_shmem="compiler-shmem-${afs_compiler_shmem}"])
 
263
    ])
 
264
 
 
265
AS_IF([test "x${scorep_shmem_user_disabled}" = xno],
 
266
      [AS_IF([test "x${ac_scorep_cross_compiling}" = "xyes"],
 
267
             [AS_CASE([${ac_scorep_platform}],
 
268
                [cray*],
 
269
                    [ac_scorep_compilers_shmem="platform-shmem-${ac_scorep_platform}"],
 
270
                [ac_scorep_compilers_shmem=""])])])
 
271
 
 
272
AS_IF([test "x${ac_scorep_compilers_shmem}" != "x" && test -f "AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_shmem}"],
 
273
      [ac_scorep_compilers_shmem="AFS_COMPILER_FILES_PACKAGE/${ac_scorep_compilers_shmem}"],
 
274
      [ac_scorep_compilers_shmem="AFS_COMPILER_FILES_COMMON/${ac_scorep_compilers_shmem}"])
 
275
# sanity checks missing
 
276
])# AFS_WITH_SHMEM_COMPILER_SUITE
 
277
 
 
278
 
 
279
AC_DEFUN([AFS_PRECIOUS_VARS_SHMEM],
 
280
[
 
281
AC_ARG_VAR(SHMEMCC,[SHMEM C compiler command])
 
282
AC_ARG_VAR(SHMEMCXX,[SHMEM C++ compiler command])
 
283
AC_ARG_VAR(SHMEMF77,[SHMEM Fortran 77 compiler command])
 
284
AC_ARG_VAR(SHMEMFC,[SHMEM Fortran compiler command])
 
285
AC_ARG_VAR(SHMEM_CPPFLAGS, [SHMEM (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir>])
 
286
AC_ARG_VAR(SHMEM_CFLAGS, [SHMEM C compiler flags])
 
287
AC_ARG_VAR(SHMEM_CXXFLAGS, [SHMEM C++ compiler flags])
 
288
AC_ARG_VAR(SHMEM_FFLAGS, [SHMEM Fortran 77 compiler flags])
 
289
AC_ARG_VAR(SHMEM_FCFLAGS, [SHMEM Fortran compiler flags])
 
290
AC_ARG_VAR(SHMEM_LDFLAGS, [SHMEM linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>])
 
291
AC_ARG_VAR(SHMEM_LIBS, [SHMEM libraries to pass to the linker, e.g. -l<library>])
 
292
AC_ARG_VAR(SHMEM_LIB_NAME, [name of the SHMEM library])
 
293
AC_ARG_VAR(SHMEM_NAME, [name of the implemented SHMEM specification])
 
294
])
 
295
 
 
296
AC_DEFUN([AFS_CONVERT_SHMEM_COMPILER],
 
297
[
 
298
if test "x${ac_cv_env_SHMEM[$1]_set}" != "xset"; then
 
299
    # don't use the default compiler if nothing is specified for SHMEM
 
300
    unset [$1]
 
301
else
 
302
    [$1]="$ac_cv_env_SHMEM[$1]_value"
 
303
fi
 
304
])
 
305
 
 
306
AC_DEFUN([AFS_CONVERT_SHMEM_FLAGS],
 
307
[
 
308
if test "x${ac_cv_env_SHMEM_[$1]_set}" != "xset"; then
 
309
   # don't use the default flags if nothing is specified for SHMEM
 
310
   unset [$1]
 
311
else
 
312
   # use the SHMEM flags
 
313
   [$1]="$ac_cv_env_SHMEM_[$1]_value"
 
314
fi
 
315
])