Solutions of online judgement
Default gcc
in CentOS 7 is 4.8.x
, to use development tools like AddressSanitizer, we need to upgrade gcc
.
Two way to do this task:
- use source code
- use SCLo
# install base package
$ sudo yum install centos-release-scl
# install gcc7
$ sudo yum install devtoolset-7-gcc
# install libasan for gcc7
$ sudo yum install devtoolset-7-libasan-devel
# activate
$ source /opt/rh/devtoolset-7/enable
Query
# see the path of package installation
$ rpm -ql devtoolset-7libasan-devel
# see runtime info
$ rpm -qf /opt/rh/devtoolset-7/enable