2012-05-23 1 views
2

내가, 내 코드는 오류를 제공하지 않습니다하는 openmpi와 프로그램을 컴파일하기 위해 노력하고있어 대신 MPI 헤더 중 하나 "숫자 상수 전에 예상 식별자는"수행합니다하는 openmpi 컴파일 오류 : mpicxx.h

/usr/include/openmpi-x86_64/openmpi/ompi/mpi/cxx/mpicxx.h:168: error: expected identifier before numeric constant 
/usr/include/openmpi-x86_64/openmpi/ompi/mpi/cxx/mpicxx.h:168: error: expected unqualified id before numeric constant 

헤더 코드의 해당 줄은 단순히 읽 나는 mpiCC 컴파일러를 사용하고

namespace MPI { 

. 내가 뭔가 잘못하고 있는거야? 또는 이것은 openmpi의 버그입니까? 사전에

감사합니다.

/*                    
* Conditional MPI 2 C++ bindings support. Include if: 
* - The user does not explicitly request us to skip it (when a C++ compiler 
*  is used to compile C code). 
* - We want C++ bindings support 
* - We are not building OMPI itself 
* - We are using a C++ compiler 
*/ 
#if !defined(OMPI_SKIP_MPICXX) && OMPI_WANT_CXX_BINDINGS && !OMPI_BUILDING 
#if defined(__cplusplus) || defined(c_plusplus) 
#include "openmpi/ompi/mpi/cxx/mpicxx.h" 
#endif 
#endif 

당신이 다음, ++ 바인딩을 사용되지 않는 C를 사용하지 않는 경우 : 당신이 직면 한 문제를 재현 할 수없는 생각이지만

+1

C 컴파일러 래퍼로 C++ 코드를 컴파일하려고합니까? –

+0

mpiCC로 컴파일 중입니다. – user1412135

+0

Open MPI는 어떻게 설치 되었습니까? –

답변

1

는 다음과 같은 코멘트 mpicxx.h 포함되는, mpi.h에서 찾을 수 있습니다 가능한 해결 방법은 CXXFLAGS

-DOMPI_SKIP_MPICXX 

를 추가하는 것입니다. 희망이 도움이 될 수 있습니다.