@@ -42,6 +42,8 @@ def pre_process_fypp(args):
42
42
kwd .append ("-DWITH_QP=True" )
43
43
if args .with_xdp :
44
44
kwd .append ("-DWITH_XDP=True" )
45
+ if args .with_ilp64 :
46
+ kwd .append ("-DWITH_ILP64=True" )
45
47
46
48
optparser = fypp .get_option_parser ()
47
49
options , leftover = optparser .parse_args (args = kwd )
@@ -78,32 +80,38 @@ def process_f(file):
78
80
return
79
81
80
82
81
- def deploy_stdlib_fpm ():
83
+ def deploy_stdlib_fpm (with_ilp64 ):
82
84
"""create the stdlib-fpm folder for backwards compatibility (to be deprecated)
83
85
"""
84
86
import shutil
85
87
prune = (
86
88
"test_hash_functions.f90" ,
87
89
"f18estop.f90" ,
88
90
)
89
- if not os .path .exists ('stdlib-fpm' + os .sep + 'src' ):
90
- os .makedirs ('stdlib-fpm' + os .sep + 'src' )
91
- if not os .path .exists ('stdlib-fpm' + os .sep + 'test' ):
92
- os .makedirs ('stdlib-fpm' + os .sep + 'test' )
93
- if not os .path .exists ('stdlib-fpm' + os .sep + 'example' ):
94
- os .makedirs ('stdlib-fpm' + os .sep + 'example' )
91
+
92
+ if with_ilp64 :
93
+ base_folder = 'stdlib-fpm-ilp64'
94
+ else :
95
+ base_folder = 'stdlib-fpm'
96
+
97
+ if not os .path .exists (base_folder + os .sep + 'src' ):
98
+ os .makedirs (base_folder + os .sep + 'src' )
99
+ if not os .path .exists (base_folder + os .sep + 'test' ):
100
+ os .makedirs (base_folder + os .sep + 'test' )
101
+ if not os .path .exists (base_folder + os .sep + 'example' ):
102
+ os .makedirs (base_folder + os .sep + 'example' )
95
103
96
104
def recursive_copy (folder ):
97
105
for root , _ , files in os .walk (folder ):
98
106
for file in files :
99
107
if file not in prune :
100
- if file .endswith (".f90" ) or file . endswith ( ".F90" ) or file . endswith ( ".dat" ) or file . endswith ( ".npy" ):
101
- shutil .copy2 (os .path .join (root , file ), 'stdlib-fpm' + os .sep + folder + os .sep + file )
108
+ if file .endswith (( ".f90" , ".F90" , ".dat" , ".npy" , ".c" ) ):
109
+ shutil .copy2 (os .path .join (root , file ), base_folder + os .sep + folder + os .sep + file )
102
110
recursive_copy ('src' )
103
111
recursive_copy ('test' )
104
112
recursive_copy ('example' )
105
113
for file in ['.gitignore' ,'fpm.toml' ,'LICENSE' ,'VERSION' ]:
106
- shutil .copy2 (file , 'stdlib-fpm' + os .sep + file )
114
+ shutil .copy2 (file , base_folder + os .sep + file )
107
115
return
108
116
109
117
def fpm_build (args ,unknown ):
@@ -122,11 +130,11 @@ def fpm_build(args,unknown):
122
130
flags = flags + unknown [idx + 1 ]
123
131
#==========================================
124
132
# build with fpm
125
- subprocess .run ([ "fpm build" ] +
126
- [ " --compiler " ] + [ FPM_FC ] +
127
- [ " --c-compiler " ] + [ FPM_CC ] +
128
- [ " --cxx-compiler " ] + [ FPM_CXX ] +
129
- [ " --flag " ] + [ flags ] , shell = True , check = True )
133
+ subprocess .run ("fpm build" +
134
+ " --compiler " + FPM_FC +
135
+ " --c-compiler " + FPM_CC +
136
+ " --cxx-compiler " + FPM_CXX +
137
+ " --flag \" {} \" " . format ( flags ) , shell = True , check = True )
130
138
return
131
139
132
140
if __name__ == "__main__" :
@@ -137,11 +145,12 @@ def fpm_build(args,unknown):
137
145
parser .add_argument ("--vpatch" , type = int , default = 0 , help = "Project Version Patch" )
138
146
139
147
parser .add_argument ("--njob" , type = int , default = 4 , help = "Number of parallel jobs for preprocessing" )
140
- parser .add_argument ("--maxrank" ,type = int , default = 7 , help = "Set the maximum allowed rank for arrays" )
148
+ parser .add_argument ("--maxrank" ,type = int , default = 4 , help = "Set the maximum allowed rank for arrays" )
141
149
parser .add_argument ("--with_qp" ,action = 'store_true' , help = "Include WITH_QP in the command" )
142
150
parser .add_argument ("--with_xdp" ,action = 'store_true' , help = "Include WITH_XDP in the command" )
151
+ parser .add_argument ("--with_ilp64" ,action = 'store_true' , help = "Include WITH_ILP64 to build 64-bit integer BLAS/LAPACK" )
143
152
parser .add_argument ("--lnumbering" ,action = 'store_true' , help = "Add line numbering in preprocessed files" )
144
- parser .add_argument ("--deploy_stdlib_fpm" ,action = 'store_true' , help = "create the stdlib-fpm folder" )
153
+ parser .add_argument ("--deploy_stdlib_fpm" ,action = 'store_true' , help = "create the stdlib-fpm folder" )
145
154
# external libraries arguments
146
155
parser .add_argument ("--build" , action = 'store_true' , help = "Build the project" )
147
156
@@ -158,8 +167,8 @@ def fpm_build(args,unknown):
158
167
# pre process the meta programming fypp files
159
168
pre_process_fypp (args )
160
169
if args .deploy_stdlib_fpm :
161
- deploy_stdlib_fpm ()
170
+ deploy_stdlib_fpm (args . with_ilp64 )
162
171
#==========================================
163
172
# build using fpm
164
173
if args .build :
165
- fpm_build (args ,unknown )
174
+ fpm_build (args ,unknown )
0 commit comments