# Building ParaView 5.7.0 and 5.8.0 on the Power 9 Architecture under Linux (Update)

**URL:** <https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364>\
**Category:** Tips and Tricks\
**Created:** [May 19, 2020, 1:51am UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364 "2020-05-19T01:51:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeh](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@joeh](https://discourse.paraview.org/u/joeh)\
**Post date:** [May 19, 2020, 1:51am UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/1 "2020-05-19T01:51:56Z")

</div>

Here is revised version of my previous post

Building ParaView 5.8.0 on the Power 9 Architecture under Linux

in which I have narrowed down the compilation problems, and improved my fixes,  
based on feedback from the previous post to allow easier building of the Mesa and OSMesa versions of ParaView 5.8.0 while adding the issues and fixes that will also allow building ParaView 5.7.0 Mesa and OSMesa versions on the Power 9 architecture as well.

- **5.8.0**

The following changes were necessary to compile ParaView 5.8.0 Mesa and OSMesa versions  
on the Power 9 Architecture under Linux.

I used the ParaView superbuild with these flags to build Python 3

```
-DENABLE_python3=ON
-DENABLE_python=ON
-DUSE_SYSTEM_python=OFF

```

It was necesary to add `-Dmesa_USE_SWR=OFF` to one’s cmake build script or otherwise Mesa and OSMesa will try to build with SWR which requires AVX

For the files `superbuild/python3/src/Lib/shutil.py` and `install/lib/python3.7/shutil.py`, I found an error within the `_copyxattr` function making it necessary to replace lines 167-169:

```
if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
                   errno.EINVAL):
    raise

```

with

```
if e.errno is 13 :
    print("Please fix this Python OSError errno.EACCES on Power 9 Architecture")
elif e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
                   errno.EINVAL):
    raise

```

I do not know why that this is throwing an error here on the Power 9 Architecture

For Silo support it was necessary to add the lines

```
ppc64le:Linux:*:*)
    echo powerpc64-unknown-linux-gnu
    exit ;;

```

after line 954 of the file `superbuild/silo/src/config/config.guess`

For the Mesa version of ParaView 5.8.0 (the OSMesa version does not need use this) it was necessary to modify file `superbuild/paraview/src/Qt/Core/pqServerConfiguration.cxx`  
starting on line 216 changing this:  
`#if defined(__linux)`  
to this  
`#if defined( __linux__ )`  
as it seems that \_\_linux is a typo and it should have been **linux**.

These changes will allow compilation but should really be replaced with better detection routines,  
and fixes for missing or broken functions.

- **5.7.0**

I have also succeeded in building the Mesa and OSmesa versions of ParaView version 5.7.0

It was again necessary again to add `-Dmesa_USE_SWR=OFF` to one’s cmake build script or otherwise Mesa and OSMesa will try to build with SWR which requires AVX.

I used these flags with the ParaView 5.7.0 superbuild script to build Python 2 for ParaView

```
-DENABLE_python3=OFF
-DENABLE_python=ON
-DUSE_SYSTEM_python=OFF

```

as I ran into an issue when attempting to build ffi in version 5.7.0 for Python 3

ffi was not detecting the system architecture of Power 9 in the file `superbuild/ffi/src/config.guess`. So, I attempted to correct it as follows. After line 913 adding:

ppc64le:Linux:_:_)  
echo powerpc64-unknown-linux-gnu  
exit ;;

but, ffi still failed to build, with error `ABI version 1 is not compatible with ABI version 2 output`, so I disabled ffi with `-DENABLE_ffi=OFF` for 5.7.0 which also forced a switch to Python 2 as ffi is  
required for Python 3 but not for Python 2.

I also had to disable boxlib for Paraview version 5.7.0 `-DENABLE_boxlib=OFF` as attempting to build boxlib failed with the error: `"We do not yet support FAB I/O on this machine"`

For Silo support it was necessary to add the lines

```
ppc64le:Linux:*:*)
    echo powerpc64-unknown-linux-gnu
    exit ;;

```

after line 954 of the file `superbuild/silo/src/config/config.guess`.

Again, for the Mesa version of ParaView 5.7.0 (the OSMesa version does not need use this)  
it was necessary to modify file `superbuild/paraview/src/Qt/Core/pqServerConfiguration.cxx`  
starting on line 216 changeing this  
`#if defined(__linux)`  
to this  
`#if defined( __linux__ )`  
as it seems that \_\_linux is a typo and it should have been **linux**.  
So it seems this error has been around for awhile as the error effects versions  
5.7.0 - 5.8.0 at least.

for xmdf3 support in the OSMesa version of ParaView 5.7.0 it was necessary to correct the file  
`install/lib/cmake/paraview-5.7/vtk/VTK-targets.cmake`  
by changing line 833 from  
`INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/paraview-5.7/vtkxdfm3/core"`  
to  
` INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/paraview-5.7/vtkxdmf3/core"`  
to fix what seems to be a typo.

Again, these changes will allow compilation but should really be replaced with better detection routines,  
and fixes for missing or broken functions.

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)\
**Post date:** [May 19, 2020, 2:05am UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/2 "2020-05-19T02:05:31Z")

</div>

Thanks @joeh. I took the liberty to edit and improve the formatting.

Also, I think some of these should be sourced back into ParaView.

---

<div class="post-metadata">

**Author:** ![joeh](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@joeh](https://discourse.paraview.org/u/joeh)\
**Post date:** [May 19, 2020, 1:10pm UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/3 "2020-05-19T13:10:37Z")

</div>

Mathieu,

Thanks for improving the formatting, I agree that some of these fixes should be sourced back into ParaView. Others will take more effort to track down the underlying issues. But at least I have made some reasonable subsets of ParaView’s functionality available on the Power 9 Architecture.

Thanks,

Joe

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)\
**Post date:** [July 2, 2020, 9:07pm UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/4 "2020-07-02T21:07:58Z")

</div>

Joe,

Thanks for the detailed changes. For your ParaView 5.8 fixes, I have pushed the following changes:

- [Fix check for ` __linux__ `](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/4236)
- [silo: patch config.guess for ppc64le](https://gitlab.kitware.com/paraview/paraview-superbuild/-/merge_requests/738) - issue filed [upstream](https://github.com/markcmiller86/silo-issues/issues/207)

Python’s master branch does not handle `errono.EACCESS` as far as I can tell (see [here](https://github.com/python/cpython/blob/master/Lib/shutil.py#L328)]. I don’t understand the change well enough to submit a patch to upstream Python.

---

<div class="post-metadata">

**Author:** ![joeh](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@joeh](https://discourse.paraview.org/u/joeh)\
**Post date:** [August 13, 2020, 4:21pm UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/5 "2020-08-13T16:21:01Z")

</div>

Cory,

I have found that ParaView 5.8.1 builds much easier on the Power 9 Architecture with these changes pushed then ParaView 5.8.0 did without them.

Thanks,

Joe

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)\
**Post date:** [August 13, 2020, 5:15pm UTC](https://discourse.paraview.org/t/building-paraview-5-7-0-and-5-8-0-on-the-power-9-architecture-under-linux-update/4364/6 "2020-08-13T17:15:40Z")

</div>

Awesome, thanks for the feedback, Joe!
