SConstruct (14044:f0737a28cd4a) SConstruct (14209:7efe1c187149)
1# -*- mode:python -*-
2
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015-2017, 2019 ARM Limited
3# Copyright (c) 2013, 2015-2019 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating
9# to a hardware implementation of the functionality of the software
10# licensed hereunder. You may use the software subject to the license
11# terms below provided that you ensure that this notice is replicated

--- 574 unchanged lines hidden (view full) ---

586 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS']
587 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR']
588 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB']
589
590if sys.platform == 'cygwin':
591 # cygwin has some header file issues...
592 main.Append(CCFLAGS=["-Wno-uninitialized"])
593
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating
9# to a hardware implementation of the functionality of the software
10# licensed hereunder. You may use the software subject to the license
11# terms below provided that you ensure that this notice is replicated

--- 574 unchanged lines hidden (view full) ---

586 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS']
587 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR']
588 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB']
589
590if sys.platform == 'cygwin':
591 # cygwin has some header file issues...
592 main.Append(CCFLAGS=["-Wno-uninitialized"])
593
594
595have_pkg_config = readCommand(['pkg-config', '--version'], exception='')
596
594# Check for the protobuf compiler
595protoc_version = readCommand([main['PROTOC'], '--version'],
596 exception='').split()
597
598# First two words should be "libprotoc x.y.z"
599if len(protoc_version) < 2 or protoc_version[0] != 'libprotoc':
600 print(termcap.Yellow + termcap.Bold +
601 'Warning: Protocol buffer compiler (protoc) not found.\n' +

--- 13 unchanged lines hidden (view full) ---

615 main['PROTOC'] = False
616 else:
617 # Attempt to determine the appropriate include path and
618 # library path using pkg-config, that means we also need to
619 # check for pkg-config. Note that it is possible to use
620 # protobuf without the involvement of pkg-config. Later on we
621 # check go a library config check and at that point the test
622 # will fail if libprotobuf cannot be found.
597# Check for the protobuf compiler
598protoc_version = readCommand([main['PROTOC'], '--version'],
599 exception='').split()
600
601# First two words should be "libprotoc x.y.z"
602if len(protoc_version) < 2 or protoc_version[0] != 'libprotoc':
603 print(termcap.Yellow + termcap.Bold +
604 'Warning: Protocol buffer compiler (protoc) not found.\n' +

--- 13 unchanged lines hidden (view full) ---

618 main['PROTOC'] = False
619 else:
620 # Attempt to determine the appropriate include path and
621 # library path using pkg-config, that means we also need to
622 # check for pkg-config. Note that it is possible to use
623 # protobuf without the involvement of pkg-config. Later on we
624 # check go a library config check and at that point the test
625 # will fail if libprotobuf cannot be found.
623 if readCommand(['pkg-config', '--version'], exception=''):
626 if have_pkg_config:
624 try:
625 # Attempt to establish what linking flags to add for protobuf
626 # using pkg-config
627 main.ParseConfig('pkg-config --cflags --libs-only-L protobuf')
628 except:
629 print(termcap.Yellow + termcap.Bold +
630 'Warning: pkg-config could not get protobuf flags.' +
631 termcap.Normal)

--- 276 unchanged lines hidden (view full) ---

908 return False
909
910
911# Check if the exclude_host attribute is available. We want this to
912# get accurate instruction counts in KVM.
913main['HAVE_PERF_ATTR_EXCLUDE_HOST'] = conf.CheckMember(
914 'linux/perf_event.h', 'struct perf_event_attr', 'exclude_host')
915
627 try:
628 # Attempt to establish what linking flags to add for protobuf
629 # using pkg-config
630 main.ParseConfig('pkg-config --cflags --libs-only-L protobuf')
631 except:
632 print(termcap.Yellow + termcap.Bold +
633 'Warning: pkg-config could not get protobuf flags.' +
634 termcap.Normal)

--- 276 unchanged lines hidden (view full) ---

911 return False
912
913
914# Check if the exclude_host attribute is available. We want this to
915# get accurate instruction counts in KVM.
916main['HAVE_PERF_ATTR_EXCLUDE_HOST'] = conf.CheckMember(
917 'linux/perf_event.h', 'struct perf_event_attr', 'exclude_host')
918
919def check_hdf5():
920 return \
921 conf.CheckLibWithHeader('hdf5', 'hdf5.h', 'C',
922 'H5Fcreate("", 0, 0, 0);') and \
923 conf.CheckLibWithHeader('hdf5_cpp', 'H5Cpp.h', 'C++',
924 'H5::H5File("", 0);')
916
925
926def check_hdf5_pkg(name):
927 print("Checking for %s using pkg-config..." % name, end="")
928 if not have_pkg_config:
929 print(" pkg-config not found")
930 return False
931
932 try:
933 main.ParseConfig('pkg-config --cflags-only-I --libs-only-L %s' % name)
934 print(" yes")
935 return True
936 except:
937 print(" no")
938 return False
939
940# Check if there is a pkg-config configuration for hdf5. If we find
941# it, setup the environment to enable linking and header inclusion. We
942# don't actually try to include any headers or link with hdf5 at this
943# stage.
944if not check_hdf5_pkg('hdf5-serial'):
945 check_hdf5_pkg('hdf5')
946
947# Check if the HDF5 libraries can be found. This check respects the
948# include path and library path provided by pkg-config. We perform
949# this check even if there isn't a pkg-config configuration for hdf5
950# since some installations don't use pkg-config.
951have_hdf5 = check_hdf5()
952if not have_hdf5:
953 print("Warning: Couldn't find any HDF5 C++ libraries. Disabling")
954 print(" HDF5 support.")
955
917######################################################################
918#
919# Finish the configuration
920#
921main = conf.Finish()
922
923######################################################################
924#

--- 88 unchanged lines hidden (view full) ---

1013 have_tuntap),
1014 BoolVariable('BUILD_GPU', 'Build the compute-GPU model', False),
1015 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
1016 all_protocols),
1017 EnumVariable('BACKTRACE_IMPL', 'Post-mortem dump implementation',
1018 backtrace_impls[-1], backtrace_impls),
1019 ('NUMBER_BITS_PER_SET', 'Max elements in set (default 64)',
1020 64),
956######################################################################
957#
958# Finish the configuration
959#
960main = conf.Finish()
961
962######################################################################
963#

--- 88 unchanged lines hidden (view full) ---

1052 have_tuntap),
1053 BoolVariable('BUILD_GPU', 'Build the compute-GPU model', False),
1054 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
1055 all_protocols),
1056 EnumVariable('BACKTRACE_IMPL', 'Post-mortem dump implementation',
1057 backtrace_impls[-1], backtrace_impls),
1058 ('NUMBER_BITS_PER_SET', 'Max elements in set (default 64)',
1059 64),
1060 BoolVariable('USE_HDF5', 'Enable the HDF5 support', have_hdf5),
1021 )
1022
1023# These variables get exported to #defines in config/*.hh (see src/SConscript).
1024export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 'TARGET_ISA', 'TARGET_GPU_ISA',
1025 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP',
1026 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_VALGRIND',
1027 'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG',
1061 )
1062
1063# These variables get exported to #defines in config/*.hh (see src/SConscript).
1064export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 'TARGET_ISA', 'TARGET_GPU_ISA',
1065 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP',
1066 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_VALGRIND',
1067 'HAVE_PERF_ATTR_EXCLUDE_HOST', 'USE_PNG',
1028 'NUMBER_BITS_PER_SET']
1068 'NUMBER_BITS_PER_SET', 'USE_HDF5']
1029
1030###################################################
1031#
1032# Define a SCons builder for configuration flag headers.
1033#
1034###################################################
1035
1036# This function generates a config header file that #defines the

--- 273 unchanged lines hidden ---
1069
1070###################################################
1071#
1072# Define a SCons builder for configuration flag headers.
1073#
1074###################################################
1075
1076# This function generates a config header file that #defines the

--- 273 unchanged lines hidden ---