LoginSignup
0
0

More than 5 years have passed since last update.

WRF > setup > error: expected identifier or ‘(’ before ‘int’ > 対処: mpicc -DMPI2_SUPPORTにする

Last updated at Posted at 2018-02-23
動作環境
CentOS 6.8 (64bit)
on VMWare workstation
for WRF3.9, WPS3.9
  Open MPI v2.1.1
  gcc version 4.9.2 (とgfortran; devtoolset-3使用)
 NetCDF v4.4.1.1, NetCDF (Fortran API) v4.4.4

WRF v3.9をVMWare上のCentOS6.8上に構築中 (2年前の環境構築の再現)。

error:

WRFのem_realをcompile実行中に下記のようなエラーが出た。

In file included from buf_for_proc.c:63:0:
/usr/local/openmpi-2.1.1_gcc492/include/mpi.h:194:32: error: expected identifier or ‘(’ before ‘int’
 #define ompi_fortran_integer_t int
                                ^
...
In file included from c_code.c:27:0:
/usr/local/openmpi-2.1.1_gcc492/include/mpi.h:194:32: error: two or more data types in declaration specifiers
 #define ompi_fortran_integer_t int
                                ^
/usr/local/openmpi-2.1.1_gcc492/include/mpi.h:220:18: note: in expansion of macro ‘ompi_fortran_integer_t’
 #define MPI_Fint ompi_fortran_integer_t
                  ^

ompi_fortran_integer_tをint_tとしているだけの実装でエラーが出ている。

以下のオプションでの回避策が有効なのだろうか?
https://stackoverflow.com/questions/10716528/openmpi-compiling-error-mpicxx-h-expected-identifier-before-numeric-constant

mpicc -DMPI2_SUPPORT

下記にも似たような質問がある。
http://forum.wrfforum.com/viewtopic.php?f=5&t=3660

以下としてみた。

configure.wrf
DM_CC           =       mpicc -DMPI2_SUPPORT
$ ./compile em_real >& log.compile_180223_t0938
$ tail log.compile_180223_t0938 

--->                  Executables successfully built                  <---

-rwxrwxr-x. 1 wrf wrf 36481595 Feb 23 01:39 main/ndown.exe
-rwxrwxr-x. 1 wrf wrf 36350423 Feb 23 01:39 main/real.exe
-rwxrwxr-x. 1 wrf wrf 35996995 Feb 23 01:39 main/tc.exe
-rwxrwxr-x. 1 wrf wrf 39996106 Feb 23 01:38 main/wrf.exe

==========================================================================

成功した。

再確認

http://forum.wrfforum.com/viewtopic.php?f=5&t=7093
を再度見ると、WRFのDM_CCとWPSのDM_CCの指定を混同していたようだ。

DM_CC           = mpicc -DMPI2_SUPPORT
DM_CC           = mpicc
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0