Skip to content

Commit b309ca0

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 66947f3 commit b309ca0

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
"""
@@ -331,6 +333,18 @@ def has_sha(filepath):
331333
os.environ['ITKPERFORMANCEBENCHMARK_AUX_JSON'] = \
332334
json.dumps(itk_information)
333335

336+
## Remove vcl_compiler.h in build dir that takes precidence over older non-generated
337+
## vcl_compiler.h in the source tree (older source code).
338+
if not os.path.exists( os.path.join( args.src, 'Modules','ThirdParty','VNL','src','vxl','vcl','vcl_compiler.h.in') ):
339+
generated_vcl_headers = glob.glob(os.path.join( args.bin, 'Modules','ThirdParty','VNL','src','vxl','vcl',"*.h"))
340+
for vcl_header_file in generated_vcl_headers:
341+
os.remove( vcl_header_file )
342+
343+
## HDF generates and tries to build .c files from other builds, clean these out
344+
hdf5_generated_files = os.path.join( args.bin, 'Modules','ThirdParty','HDF5','src','itkhdf5',"*.c")
345+
hdf5_bld_src_files = glob.glob( hdf5_generated_files )
346+
for hdf5_file in hdf5_bld_src_files:
347+
os.remove( hdf5_file )
334348

335349
print('\nBuilding ITK...')
336350
build_itk(args.src, args.bin)

0 commit comments

Comments
 (0)