resources: Fix gcc_dir for spec-2017 installation

gcc_dir is a variable in spec-2017 installation config script
specifying the location of the compiler binaries.
For example, if
    gcc_dir = /usr
then spec-2017 will look for gcc in /usr/bin/gcc.

Currently, in our spec-2017 installation script, the way
gcc_dir is specified is to replace
"gcc_dir=/opt/rh/devtoolset-7/root/usr" by "gcc_dir=/usr".

As reported here,
https://www.mail-archive.com/gem5-users@gem5.org/msg19506.html,
the default gcc_dir is "/opt/rh/devtoolset-9/root/usr".
Thus ,the current way of changing gcc_dir is sensitive to the
change of version of spec 2017.

In this change, instead of changing gcc_dir in the spec-2017
config script, gcc_dir is now specified in the `runcpu` command
line building the workloads.

JIRA: https://gem5.atlassian.net/browse/GEM5-996

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: Ib098a3431c2ceb144c78e7d762ef2f39970da703
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5-resources/+/45959
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: Jason Lowe-Power <power.jg@gmail.com>
diff --git a/src/spec-2017/disk-image/spec-2017/install-spec2017.sh b/src/spec-2017/disk-image/spec-2017/install-spec2017.sh
index 2d6a87d..28f4b6a 100644
--- a/src/spec-2017/disk-image/spec-2017/install-spec2017.sh
+++ b/src/spec-2017/disk-image/spec-2017/install-spec2017.sh
@@ -17,9 +17,6 @@
 # use the example config as the template
 cp /home/gem5/spec2017/config/Example-gcc-linux-x86.cfg /home/gem5/spec2017/config/myconfig.x86.cfg
 
-# use sed command to replace the default gcc_dir
-sed -i "s/\/opt\/rh\/devtoolset-7\/root\/usr/\/usr/g" /home/gem5/spec2017/config/myconfig.x86.cfg
-
 # use sed command to remove the march=native flag when compiling
 # this is necessary as the packer script runs in kvm mode, so the details of the CPU will be that of the host CPU
 # the -march=native flag is removed to avoid compiling instructions that gem5 does not support
@@ -33,7 +30,9 @@
 sed -i "s/command_add_redirect = 1/sysinfo_program =\ncommand_add_redirect = 1/g" /home/gem5/spec2017/config/myconfig.x86.cfg
 
 # build all SPEC workloads
-runcpu --config=myconfig.x86.cfg --define build_ncpus=$(nproc) --action=build all
+# build_ncpus: number of cpus to build the workloads
+# gcc_dir: where to find the compilers (gcc, g++, gfortran)
+runcpu --config=myconfig.x86.cfg --define build_ncpus=$(nproc) --define gcc_dir="/usr" --action=build all
 
 # the above building process will produce a large log file
 # this command removes the log files to avoid copying out large files unnecessarily