CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OpenFOAM 4.1 on CentOS 7 using Intel Compilers (https://www.cfd-online.com/Forums/openfoam-installation/184787-openfoam-4-1-centos-7-using-intel-compilers.html)

fertinaz March 10, 2017 21:38

OpenFOAM 4.1 on CentOS 7 using Intel Compilers
 
Hi everyone

Subject is quite explanatory.

I am trying to compile OpenFOAM 4.1 version from git repo.
The OS: CentOS Linux release 7.3.1611
Compiler: Intel Parallel Studio XE 2017 Update 2 for Linux

Modifications to OpenFOAM:
  • I completed each step for Third Party compilations (until step 13) without making any modifications
  • Before proceeding to OpenFoam compilation, I first set WM_Compiler to Icc and WM_MPLIB to INTELMPI in OF/etc/bashrc
  • Then changes in OF/etc/config.sh/settings:
    • WM_CC=mpicc
    • WM_CXX=mpicxx
  • Changes in OF/etc/config.sh/mpi:
    • export MPI_ROOT=/opt/intel/impi/impi_version_dir
    • export MPI_ARCH_PATH=$MPI_ROOT
  • Changes in OF/wmake/rules/linux64Icc/c:
    • cc = mpicc
  • Then changes in OF/wmake/rules/linux64Icc/c++:
    • CC = mpicxx -std=c++0x
  • Changes in OF/wmake/rules/linux64Icc/mplibINTELMPI:
    • PFLAGS = -DMPICH_SKIP_MPICXX
      PINC = -I$(MPI_ARCH_PATH)/include64
      PLIBS = -L$(MPI_ARCH_PATH)/lib64 -lmpi

Now it is time to run Allwmake and when we do that two issues appear:
  • foamyMesh cannot be compiled due to the problem related with cgal and mpfr:
    • /home/hpcuser/OpenFOAM/ThirdParty-4.1/platforms/linux64Icc/CGAL-4.8/include/CGAL/GMP/Gmpz_type.h:33:18: fatal error: mpfr.h: No such file or directory
      #include <mpfr.h>
  • I skipped that and when compiling utilities in /OF/applications/utilities/mesh/manipulation another set of issues appeared
    • undefined reference to _intel_fast_memset
      undefined reference to __intel_sse2_strlen
      undefined reference to __intel_sse2_strncmp
      undefined reference to _intel_fast_memcmp
      undefined reference to _intel_fast_memmove
      undefined reference to __intel_sse2_strchr
      undefined reference to _intel_fast_memcpy

Anyone can help me with this issue?

// Fatih

fertinaz March 11, 2017 03:03

Quote:

Originally Posted by iqbalsk8 (Post 627980)
Hi Bruno,

Thank you for the reply. I will try to answer your every question one by one.
  • I have gcc-4.9.2 version available so I am exporting its path in the alias command in my local .bashrc.
My 'GMP' and 'MPFR' header path is $WM_THIRD_PARTY_DIR/platforms/linux64. So I extended my alias command to export the path as below i.e.

Code:

alias of1606+='export PATH=$PATH:/opt/gcc49/bin;
export MPFR_ARCH_PATH=/home/iqbalsk8/OpenFOAM/ThirdParty-v1606+OpenCFD/platforms/linux64/mpfr-3.1.2;
export GMP_ARCH_PATH=/home/iqbalsk8/OpenFOAM/ThirdParty-v1606+OpenCFD/platforms/linux64/gmp-5.1.2;
source $HOME/OpenFOAM/OpenFOAM-v1606+OpenCFD/etc/bashrc'

After that I ran Allwmake from $WM_PROJECT_DIR and the libraries were compiled successfully. However, I wanted to ask you whether exporting the
'MPFR_ARCH_PATH' and 'GMP_ARCH_PATH' using the alias is common practice. What is the standard way for exporting those path or in which files must those path be set to make it more clean/standard.

Regards

Sohail

I am experiencing a similar issue with mpfr and gmp.

I compiled CGAL following the steps in: https://openfoamwiki.net/index.php/I...CentOS_SL_RHEL

But when I try to compile foamyMesh (using OF41 and Intel compiler) I get:
Quote:

/....../OpenFOAM/ThirdParty-4.1/platforms/linux64Icc/CGAL-4.8/include/CGAL/gmp.h:30:17: fatal error: gmp.h: No such file or directory
#include <gmp.h>
However I checked the path and there exists the gmp.h file. I changed
Code:

#include <gmp.h>
with
Code:

#include "gmp.h"
it worked but now this time I get

Code:

/home/hpcuser/OpenFOAM/ThirdParty-4.1/platforms/linux64Icc/CGAL-4.8/include/CGAL/GMP/Gmpz_type.h:33:18: fatal error: mpfr.h: No such file or directory
 #include <mpfr.h>

I set the environment variables in .bashrc file however I copied the mpfr-5.1.2 and gmp-5.1.2 directories to linux64Icc directory from linux64 manually. Can it be the reason?

Or is it related to compiling ThirdParty/makeCGAL with Gcc and trying to compile foamyMesh with Intel compiler?

Many thanks

vlad October 26, 2017 11:59

Hello,
I haven't seen your post before, so I do not know if this is already solved. I've had a very similar problem in installing OpenFOAM 5.0 to scientific calculation cluster running on ScientificLinux 6.4 which is practically very similar to RHEL and Centos. When following the OpenFOAMwiki for installing without administrative privileges I was getting the same error as you.

This error actually comes from not properlly installed gcc, gmp mpfr and its applications. You are, as me getting the error :
Quote:

ThirdParty-5.0/platforms/linux64/CGAL-4.10/include/CGAL/GMP/Gmpz_type.h:33:18: fatal error: mpfr.h: No such file or directory
#include <mpfr.h>
or same for gmp.h
However the problem is not mpfr.h or gmp.h even the error log points to them as they are existing and findable but in their respective libraries: libmpfr.so and libgmp.so. See the 2 lines above the error log message you've posted. These 2 libraries needs to be placed in lib64 folder of mpfr and gmp directories. To compile them you should use:
Code:

./configure --prefix=$WM_THIRD_PARTY_DIR/platforms/linux64/mpfr-3.1.2
make
make install

same for the gmp. Then you could simply ren/move lib folders to lib64. After this no problems with CGAL or foamyMesh.

Next to successfully install mpc I used similarly in its extracted source dir:
Code:

\configure --prefix=$WM_THIRD_PARTY_DIR/platforms/linux64/mpc-1.0.5 --with-gmp=$WM_THIRD_PARTY_DIR/platforms/linux64/gmp-5.2.1 --with-mpfr=$WM_THIRD_PARTY_DIR/platforms/linux64/mpfr-3.1.2
make
make install

Then I have properly 'make install' gcc and its libraries with the same switches.

After installing this gcc and its subsidiaries no problem with rest of the installation done according to wiki.

naktu November 15, 2017 03:40

Hello,
I had encountered the same problem.
The problem is, the GMP_ARCH_PATH and MPFR_ARCH_PATH are some how not set by the OpenFOAM bashrc.

The solution I applied is to write the complete path of your thirdparty library in wmake/rules/General/CGAL script.

This will resolve the error.

olesen January 12, 2018 08:41

Quote:

Originally Posted by naktu (Post 671626)
Hello,
I had encountered the same problem.
The problem is, the GMP_ARCH_PATH and MPFR_ARCH_PATH are some how not set by the OpenFOAM bashrc.

The solution I applied is to write the complete path of your thirdparty library in wmake/rules/General/CGAL script.

This will resolve the error.

Your solution of changing the CGAL config file is correct. The problem is that gmp/mpfr are nominally for ThirdParty gcc (so they don't get seen for other combinations), but they may also be used for CGAL with other compilers if there aren't any system versions.

Another alternative, with more hacking. Build CGAL without gmp/mpfr and then remove the -lmpfr linkage in the corresponding CGAL wmake rule.


All times are GMT -4. The time now is 08:44.