[1/2] config: fix RHEL7.6 build errors on Power 9 systems

Message ID 1565807801-72546-2-git-send-email-drc@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series fixes to resolve meson build issues on Power systems |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-Compile-Testing success Compile Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

David Christensen Aug. 14, 2019, 6:36 p.m. UTC
  gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
Power 9 code when the "-mcpu=native" command line argument is used. Test
whether the compiler can generate Power 9 code and adjust the machine
setting appropriately.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 config/ppc_64/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

David Christensen Oct. 25, 2019, 6:52 p.m. UTC | #1
> gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
> Power 9 code when the "-mcpu=native" command line argument is used. Test
> whether the compiler can generate Power 9 code and adjust the machine
> setting appropriately.
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---

Ping
  
David Marchand Oct. 27, 2019, 10:04 a.m. UTC | #2
On Wed, Aug 14, 2019 at 8:37 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
> Power 9 code when the "-mcpu=native" command line argument is used. Test
> whether the compiler can generate Power 9 code and adjust the machine
> setting appropriately.
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  config/ppc_64/meson.build | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
> index 0e65f9d..495ef6f 100644
> --- a/config/ppc_64/meson.build
> +++ b/config/ppc_64/meson.build
> @@ -7,6 +7,16 @@ endif
>  dpdk_conf.set('RTE_ARCH', 'ppc_64')
>  dpdk_conf.set('RTE_ARCH_PPC_64', 1)
>
> +# RHEL 7.x uses gcc 4.8.X which doesn't generate code for Power 9 CPUs,
> +# though it will detect a Power 9 CPU when the "-mcpu=native" argument
> +# is used, resulting in a build failure.
> +power9_supported = cc.has_argument('-mcpu=power9')
> +if not power9_supported
> +       machine = 'power8'
> +       machine_args = ['-mcpu=power8', '-mtune=power8']
> +  dpdk_conf.set('RTE_MACHINE','power8')

Fixed indent.

> +endif
> +
>  # overrides specific to ppc64
>  dpdk_conf.set('RTE_MAX_LCORE', 1536)
>  dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
> --
> 1.8.3.1
>

Applied, thanks.


--
David Marchand
  

Patch

diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
index 0e65f9d..495ef6f 100644
--- a/config/ppc_64/meson.build
+++ b/config/ppc_64/meson.build
@@ -7,6 +7,16 @@  endif
 dpdk_conf.set('RTE_ARCH', 'ppc_64')
 dpdk_conf.set('RTE_ARCH_PPC_64', 1)
 
+# RHEL 7.x uses gcc 4.8.X which doesn't generate code for Power 9 CPUs,
+# though it will detect a Power 9 CPU when the "-mcpu=native" argument
+# is used, resulting in a build failure.
+power9_supported = cc.has_argument('-mcpu=power9')
+if not power9_supported
+	machine = 'power8'
+	machine_args = ['-mcpu=power8', '-mtune=power8']
+  dpdk_conf.set('RTE_MACHINE','power8')
+endif
+
 # overrides specific to ppc64
 dpdk_conf.set('RTE_MAX_LCORE', 1536)
 dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)