OpenFOAM / ThirdParty-7

OpenFOAM-7 third-party library compilation scripts
GNU Lesser General Public License v3.0
11 stars 18 forks source link

Error when makeParaView #1

Closed 12Tall closed 4 years ago

12Tall commented 4 years ago

Hello, I am trying to install openfoam just follow http://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-7/Ubuntu/20.04. And there are some issues happened. I'm not good at python, nor openmpi. I'm very appreciate if anybody can help me.

I've got an error when I trying to execute the follow command:

./makeParaView -python -mpi -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 > log.makePV 2>&1

and the log file shows:

...........
/home/test/OpenFOAM/ThirdParty-7/ParaView-5.6.0/VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c: In function ‘__pyx_f_6mpi4py_3MPI_del_Datatype’:
/usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h:322:57: error: expected expression before ‘_Static_assert’
  322 | #define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0.  Use " #newfunc " instead.")
      |                                                         ^~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h:1112:24: note: in expansion of macro ‘THIS_SYMBOL_WAS_REMOVED_IN_MPI30’
 1112 | #        define MPI_UB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_UB, MPI_Type_create_resized);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/test/OpenFOAM/ThirdParty-7/ParaView-5.6.0/VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:14831:36: note: in expansion of macro ‘MPI_UB’
14831 |   __pyx_t_1 = (((__pyx_v_ob[0]) == MPI_UB) != 0);
      |                                    ^~~~~~
/usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h:322:57: error: expected expression before ‘_Static_assert’
  322 | #define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0.  Use " #newfunc " instead.")
      |                                                         ^~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h:1113:24: note: in expansion of macro ‘THIS_SYMBOL_WAS_REMOVED_IN_MPI30’
 1113 | #        define MPI_LB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_LB, MPI_Type_create_resized);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/test/OpenFOAM/ThirdParty-7/ParaView-5.6.0/VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:14844:36: note: in expansion of macro ‘MPI_LB’
14844 |   __pyx_t_1 = (((__pyx_v_ob[0]) == MPI_LB) != 0);
.........

System info: Ubuntu 20.04 LTS 64bits
openmpi:

MCA ras: slurm (MCA v2.1.0, API v2.0.0, Component v4.0.3)
MCA ras: simulator (MCA v2.1.0, API v2.0.0, Component v4.0.3)
MCA ras: gridengine (MCA v2.1.0, API v2.0.0, Component v4.0.3)
panda1100 commented 4 years ago

Hi 12Tall,

This patch works for my case(Ubuntu MATE 20.04 LTS, OpenMPI 4.0.3). https://bitbucket.org/mpi4py/mpi4py/commits/42f5e35a6a90454516c11131549a08cd766edbb0

Just after you got above error, modify your ThirdParty-7/ParaView-5.6.0/VTK/ThirdParty/mpi4py/vtkmpi4py/src/lib-mpi/config/openmpi.h as above patch mentioned lines.

like this.

-----------(omitted)----------------
#endif /* OMPI <= 1.7.5 */

#endif

#if OMPI_NUMVERSION >= 40000
#undef  PyMPI_HAVE_MPI_LB
#undef  PyMPI_HAVE_MPI_UB
#endif /* OMPI >= 4.0.0 */

#endif /* !PyMPI_CONFIG_OPENMPI_H */

Then, build ParaView again.

./makeParaView -python -mpi -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 2>&1 | tee log.makePV

I found this patch from issues on mpi4py repository. https://bitbucket.org/mpi4py/mpi4py/issues/123/mpi4py-does-not-build-with-openmpi4

Best,

12Tall commented 4 years ago

Hello panda1100 , Thanks a lot for such a detailed instruction. I've installed it successfully. Thanks again and Best wishes,