Skip to content

Commit 05a270b

Browse files
committed
ENH: Add ability to clean small parts of ITK build tree
Clean the build tree of items from vcl and hdf5 builds that can be left over from other build locations. These old file artifacts can cause build failures due to the old file location taking precidence over the new file location (vcl_compiler_header.h), or imcompatible library bulding due to a glob expression including a file that does not belong to the source tree any longer (hdf5).
1 parent 59ba73f commit 05a270b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

evaluate-itk-performance.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import socket
88
import json
99

10+
import glob
11+
1012

1113
def get_shell_output_as_string(commandlist):
1214
"""
@@ -309,6 +311,18 @@ def has_sha(filepath):
309311
os.environ['ITKPERFORMANCEBENCHMARK_AUX_JSON'] = \
310312
json.dumps(itk_information)
311313

314+
## Remove vcl_compiler.h in build dir that takes precidence over older non-generated
315+
## vcl_compiler.h in the source tree (older source code).
316+
if not os.path.exists( os.path.join( args.src, 'Modules','ThirdParty','VNL','src','vxl','vcl','vcl_compiler.h.in') ):
317+
generated_vcl_headers = glob.glob(os.path.join( args.bin, 'Modules','ThirdParty','VNL','src','vxl','vcl',"*.h"))
318+
for vcl_header_file in generated_vcl_headers:
319+
os.remove( vcl_header_file )
320+
321+
## HDF generates and tries to build .c files from other builds, clean these out
322+
hdf5_generated_files = os.path.join( args.bin, 'Modules','ThirdParty','HDF5','src','itkhdf5',"*.c")
323+
hdf5_bld_src_files = glob.glob( hdf5_generated_files )
324+
for hdf5_file in hdf5_bld_src_files:
325+
os.remove( hdf5_file )
312326

313327
print('\nBuilding ITK...')
314328
build_itk(args.src, args.bin)

0 commit comments

Comments
 (0)