fppimenta/rheoTool

error of compile rheoTool in centos

samech-git opened this issue · 6 comments

Hello, fppimenta
Thank you for developing such a useful tool,
when I try to compile rheoTool in centos-6, I've had some problems.
I follow this link to compile OpenFOAM-6 in centos-6, everything works fine
https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-6/CentOS_SL_RHEL#CentOS_6.10_.28without_SCL.29

when I compile rheoTool, the following problems were encountered:
(1) The first problem:

         Configuring PETSc to compile on your system                       

===============================================================================
TESTING: checkMPICompilerOverride from config.setCompilers(config/BuildSystem/co*******************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

--with-fc=/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpifort is specified along with --with-mpi-dir=/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1 which implies using /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpif90.
configure is confused and does not know which compiler to select and use! Please specify either [mpi] compilers or --with-mpi-dir - but not both!
In most cases, specifying --with-mpi-dir - and not explicitly listing compilers could be preferable.


to solve this problem, I delete "with-mpi-dir ", the configure is look like this:
./configure --with-debugging=0 --download-hypre --download-parmetis --download-metis --download-ptscotch --download-mumps --download-scalapack --with-precision=double --with-shared-libraries=1 --with-scalar-type=real --with-fc=$mpiFort --with-cc=$mpiCC --with-cxx=$mpiCXX CXX_LINKER_FLAGS=-Wl,--no-as-needed CFLAGS="-g -O2 -fPIC -fstack-protector-strong -Wformat -Werror=format-security" CXXFLAGS="-g -O2 -fPIC -fstack-protector-strong -Wformat -Werror=format-security" FCFLAGS="-g -O2 -fstack-protector-strong" FFLAGS="-g -O2 -fstack-protector-strong" CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2" LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" MAKEFLAGS=w

But I had the following problem:
(2) ===============================================================================
Configuring PETSc to compile on your system

TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCo*******************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

C compiler you provided with -with-cc=/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpicc cannot be found or does not work.
Cannot compile C with /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpicc.


Could you give me some hint?

Try the script I am attaching instead of the default one provided (remove the .txt extension before running it). Then simply follow the user-guide. Note that ubuntu != centos (yum vs apt, etc.), although the issues reported are related with openmpi. If it runs without error, then you will probably be able to compile rheoTool, although some functionalities related with matrix solvers will have some options limited (no MUMPS, etc.). Basically, the new script provides you a light installation of Petsc+hypre (hope not too light that it doesn't work...).

installPetscCentos6.txt

I've tried using the “installPetscCentos6”, but still encounter the following problems:

         Configuring PETSc to compile on your system                       

===============================================================================
TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCo*******************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

C compiler you provided with -with-cc=/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpicc cannot be found or does not work.
Cannot compile C with /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin/mpicc.


I'm confused as to why the error is "mpicc cannot be found or does not work", I'm using the installed OpenFoam-6 with no error, including mpirun

That it is quite strange, as I cannot reproduce your error. Do the following:

1- what is the ls of /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin ? Somewhere in the middle it should retrieve mpicc, if not something is wrong.

2 - try again this script. In the previous one it was saved in DOS and you might have done something wrong in the conversion. Note: when you are prompted by the script to delete any previous installation/dir of petsc, you should always accept it.

installPetscCentos6.zip

3- if (2) does not work, source your openfoam env vars and go to the dir echoed by: echo $MPI_ARCH_PATH. Then copy directories 'bin, 'lib64' and 'include' (and 'lib' if it exists) and copy them to the directory echoed by: echo $WM_THIRD_PARTY_DIR/openmpi-2.1.1. Then run this alternative version of the script:

installPetscCentos6_v2.zip

(1) the ls of /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin:
[lzh@localhost bin]$ pwd
/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin
[lzh@localhost bin]$ ls
mpic++ mpif90 ompi-ps orte-clean orte-server oshrun
mpicc mpifort ompi-server orted orte-submit shmemcc
mpiCC mpirun ompi-submit orte-dvm orte-top shmemfort
mpicxx ompi-clean ompi-top orte-info oshcc shmemrun
mpiexec ompi-dvm opal_wrapper orte-ps oshfort
mpif77 ompi_info ortecc orterun oshmem_info
[lzh@localhost bin]$ ls -al
total 468
drwxrwxr-x. 2 lzh lzh 4096 Nov 11 14:15 .
drwxrwxr-x. 7 lzh lzh 4096 Nov 11 14:15 ..
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpic++ -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpicc -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpiCC -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpicxx -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 7 Nov 11 14:15 mpiexec -> orterun
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpif77 -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpif90 -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 mpifort -> opal_wrapper
lrwxrwxrwx. 1 lzh lzh 7 Nov 11 14:15 mpirun -> orterun
lrwxrwxrwx. 1 lzh lzh 10 Nov 11 14:15 ompi-clean -> orte-clean
lrwxrwxrwx. 1 lzh lzh 8 Nov 11 14:15 ompi-dvm -> orte-dvm
-rwxr-xr-x. 1 lzh lzh 23934 Nov 11 14:15 ompi_info
lrwxrwxrwx. 1 lzh lzh 7 Nov 11 14:15 ompi-ps -> orte-ps
lrwxrwxrwx. 1 lzh lzh 11 Nov 11 14:15 ompi-server -> orte-server
lrwxrwxrwx. 1 lzh lzh 11 Nov 11 14:15 ompi-submit -> orte-submit
lrwxrwxrwx. 1 lzh lzh 8 Nov 11 14:15 ompi-top -> orte-top
-rwxr-xr-x. 1 lzh lzh 23964 Nov 11 14:14 opal_wrapper
lrwxrwxrwx. 1 lzh lzh 12 Nov 11 14:15 ortecc -> opal_wrapper
-rwxr-xr-x. 1 lzh lzh 15267 Nov 11 14:15 orte-clean
-rwxr-xr-x. 1 lzh lzh 8111 Nov 11 14:15 orted
-rwxr-xr-x. 1 lzh lzh 53524 Nov 11 14:15 orte-dvm
-rwxr-xr-x. 1 lzh lzh 36787 Nov 11 14:15 orte-info
-rwxr-xr-x. 1 lzh lzh 21291 Nov 11 14:15 orte-ps
-rwxr-xr-x. 1 lzh lzh 123115 Nov 11 14:15 orterun
-rwxr-xr-x. 1 lzh lzh 16118 Nov 11 14:15 orte-server
-rwxr-xr-x. 1 lzh lzh 73802 Nov 11 14:15 orte-submit
-rwxr-xr-x. 1 lzh lzh 31255 Nov 11 14:15 orte-top
lrwxrwxrwx. 1 lzh lzh 5 Nov 11 14:15 oshcc -> mpicc
lrwxrwxrwx. 1 lzh lzh 7 Nov 11 14:15 oshfort -> mpifort
-rwxr-xr-x. 1 lzh lzh 23899 Nov 11 14:15 oshmem_info
lrwxrwxrwx. 1 lzh lzh 6 Nov 11 14:15 oshrun -> mpirun
lrwxrwxrwx. 1 lzh lzh 5 Nov 11 14:15 shmemcc -> mpicc
lrwxrwxrwx. 1 lzh lzh 7 Nov 11 14:15 shmemfort -> mpifort
lrwxrwxrwx. 1 lzh lzh 6 Nov 11 14:15 shmemrun -> mpirun

(2)the second step show the same error as the script "installPetscCentos6"

(3)the third step:
[lzh@localhost of60]$ echo $MPI_ARCH_PATH
/home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1
[lzh@localhost of60]$ echo $WM_THIRD_PARTY_DIR/openmpi-2.1.1
/home/lzh/OpenFOAM/ThirdParty-6/openmpi-2.1.1
then copied directories 'bin, 'lib64' and 'include'
the script "installPetscCentos6_v2" show the following error:

         Configuring PETSc to compile on your system                       

===============================================================================
TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCo*******************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

MPI compiler wrappers in /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin cannot be found or do not work. See https://www.mcs.anl.gov/petsc/documentation/faq.html#mpi-compilers


(4) I think the problem might be with the openmpi compilation.
In Ubuntu-16.04, I successfully compiled the OpenFOAM-6 and rheoTool, the soft link of mpicc point to the openmpi of system (mpicc -> /usr/bin/mpicc.openmpi), but in Centos-6, the soft link of mpicc point to opal_wrapper (mpicc -> opal_wrapper, opal_wrapper and mpicc in the same directory, which is /home/lzh/OpenFOAM/ThirdParty-6/platforms/linux64Gcc48/openmpi-2.1.1/bin)
may be because of the mpicc of openfoam in ubuntu use the system mpicc, while the mpicc of openfoam in centos use the openmpi of thirdParty ?

In ubuntu, I have successfully installed and used openfoam + rheoTool + Petsc for different mpi: systemopenmpi, third party openmpi, mvapich2, mpich, among others. As long as the mpi system is functional and the links correct, all should work.

The issue is for sure related to mpi, but not directly to the fact that you are using the third party and not the system installed, as both should work. Also, although not being an usual centos user, I have created one VM with that os, have followed the link you provided to install openfoam and had no problems to install Petsc (still with the third party openmpi 2.1.1) using either of the scripts provided. You can try it also. In your case the ls clearly show that the wrappers (mpifort, mpicc,...) exist, thus the option left is that they are not functional, i.e. they do not work/link well. I would perhaps suggest you to compile/link a dumb (hello world) program using any of these wrappers to check if they are functional. You can also install openmpi with yum (i.e. a systemopenmpi) to check if it works, although you might have compatibility issues with openfoam (don't know which openmpi version will be installed by yum for centos 6). Other option is to use --download-mpich in the configure script of petsc and then use that mpi to compile openfoam, after changing the bashrc of openfoam (I did it with success in ubuntu). Still another option is using an older rheoTool version not needing Petsc (check the changelog file and use git to look into the tags).

However, if you already have it working in ubuntu, it is perhaps simpler to stick to that.

PS: you can check more info about Petsc error at the of the configure.log file generated.

Re-open if needed.