-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathconfigure
executable file
·150 lines (146 loc) · 5.57 KB
/
configure
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
#!/bin/bash
#-----------------------------------------------------------------------
# Name: configure
#
# Purpose: Globally disable or enable features prior to compiling.
#
# This script should be called after setup but prior to compiling in order
# to enable or disable particular compile time features. This version of the
# script must be called from the pscfpp/ root directory, and applies all
# changes configuration files used during compiled in both the bld/
# directory (for out-of-source compilation) and code compiled in the src/
# directory (for in-source compilation). To instead apply changes only to
# code compiled in one build directory (i.e., only bld/ or src/), one must
# change directory (cd) to that directory and invoke the local configure
# script from there.
#
# This "global" version of the configure script works by simply recursively
# invoking the local configure scripts in the bld/ and src/ directories.
# It accepts all of the same options that are accepted by the configure
# scripts in the src/ and bld/ directories.
#
# Synopsis:
# --------
#
# configure [options]
#
# Command Line Options:
# ---------------------
#
# The -q and -h command line options take no arguments, and both provide
# information:
#
# -q query: prints report of options that are enabled / disabled.
# -h help: prints a list of available options
#
# The -d and -c options each enable or disable a feature. Each such option
# takes a 0 or 1 as a required argument, using 1 to enable the feature or
# 0 to disable it:
#
# -d (0|1) debugging (defines/undefines UTIL_DEBUG)
# -c (0|1) CUDA code (defines/undefines PSCF_CUDA)
#
# This -a option sets an identifier for the NVIDIA GPU architecture to be
# targeted by the NVIDIA CUDA compiler. The argument of this command line
# option is passed as the argument of the "-arch" option of the NVIDIA
# C++ / CUDA compiler. Allowed values are string of the form sm_NN, where
# NN is a number that gives the major and minor version number for the CUDA
# "compute capability" for the target GPU. For example, the K40 GPU has a
# compute capability 3.5, and requires an architecture code sm_35.
#
# -a (architecture code) (defines NVARCH)
#
# Examples:
# ---------
#
# To enable debugging
#
# > ./configure -d1
#
# To disable debugging
#
# > ./configure -d0
#
# To enable conditional compilation of CUDA code (disabled by default)
# and set the GPU architecture option to sm_70 (compute capability 7.0,
# appropriate for a V100 chip) one could enter
#
# > ./configure -c1 -a sm_70
#
#-----------------------------------------------------------------------
ROOT=$PWD
opt=""
OPTARG=""
while getopts "a:c:d:qh" opt; do
if [[ "$opt" != "?" ]]; then
if [[ "$opt" != "h" ]]; then
cd $ROOT
cd bld/;
echo "In build directory $PWD":
./configure -"$opt" "$OPTARG"
cd $ROOT
cd src/;
echo "In build directory $PWD":
./configure -"$opt" "$OPTARG"
opt=""
OPTARG=""
else
echo " "
echo " Purpose and usage:"
echo " ------------------"
echo " "
echo " The configure script may be called prior to compiling to enable"
echo " or disable specific compile time features, set compiler options,"
echo " and/or query which features are currently set to be enabled."
echo " This script must be called from the directory that contains the"
echo " script file. The copy in the pscfpp/ root directory queries and"
echo " applies the same changes to configurations built in the bld/"
echo " and src/ directories"
echo " "
echo " Command Line Options:"
echo " ----------------------"
echo " "
echo " The -q and -h command line options both provide information,"
echo " and take no arguments:"
echo " "
echo " -q query: prints list of options that are enabled / disabled"
echo " -h help: prints a list of available options"
echo " "
echo " The -d and -c options each enable or disable a feature. Each"
echo " such option takes 0 or 1 as a required argument, using 1 to"
echo " enable and 0 to disable the feature"
echo " "
echo " -d (0|1) debugging (defines/undefines UTIL_DEBUG)"
echo " -c (0|1) CUDA code (defines/undefines PSCF_CUDA)"
echo " "
echo " The -a option sets an identifier for the NVIDIA GPU architecture"
echo " to be targeted by the NVIDIA CUDA compiler. The argument of this"
echo " command line option is passed as the argument of the -arch"
echo " option of the C++ / CUDA compiler. Allowed values are strings"
echo " of the form sm_NN, where NN is a number that gives the major and"
echo " minor version number for the CUDA compute capability for the"
echo " target architecture. For example, the K40 GPU has a compute"
echo " compute capability 3.5, and requires an architecture code sm_35."
echo " "
echo " -a [architecture code] (defines NVARCH)"
echo " "
echo " Examples:"
echo " ---------"
echo " "
echo " To enable debugging"
echo " "
echo " > ./configure -d1"
echo " "
echo " To disable debugging"
echo " "
echo " > ./configure -d0"
echo " "
echo " To enable conditional compilation of CUDA code (disabled by"
echo " default) and set the GPU architecture option to sm_70 (compute"
echo " capability 7.0, appropriate for a V100 chip) one could enter"
echo " "
echo " > ./configure -c1 -a sm_70"
echo " "
fi
fi
done