KirillX86
KirillX86

Reputation: 49

OpenMPI How to override include compiler option prefix

Hello I try to compile openmpi application in Eclipse. But it returned error

gcc.exe: Error: /IC:\OpenMPI/include: Invalid argument

As I understand gcc need dash "-" as argument prefix insetade of slash "/". (I have overrided compiler from ms-cl to gcc)

Could you ask me where I must specify "-I" as include prefix.

Upvotes: 0

Views: 537

Answers (2)

Optionparty
Optionparty

Reputation: 101

In Eclipse, highlight the project name in the "Project Explorer" (screen left). Then right click on it and select "Properties" (bottom of the list). On the left side of the popup window select "C/C++ Build", within that group select "Settings". Within the "GCC C Linker" select "Libraries"(center section). On the right side of this window you can add your library names, they will prefix with "lib" and "-l" so don't include that (ei: mpi). Scrolling down will revel an area to add "Library search path(-L)" if you should need that. When completed select the "Apply and Close" button, and "Build" again.

Upvotes: 0

Hristo Iliev
Hristo Iliev

Reputation: 74435

The compiler wrappers (mpicc, mpic++, etc.) in Open MPI are C++ programs that read in text configuration files found in <install dir>/share/openmpi (on Unix system) and probably in <install dir>\share\openmpi on Windows. These files are called <wrapper name>-wrapper-data.txt where <wrapper name> is the name of the compiler wrapper. For example for mpicc the wrapper confiration file is called mpicc-wrapper-data.txt. Inside you'd find something similar to:

...
preprocessor_flags=-I/opt/MPI/openmpi-1.6.1/linux/intel/include ...
compiler_flags=-fexceptions -pthread -I${prefix}/lib/lib32 ...
linker_flags= -L/opt/lsf/8.0/linux2.6-glibc2.3-x86/lib ...
libs=-lmpi -losmcomp -lrdmacm -libverbs ...
...

Modify these to match your compiler flags.

Upvotes: 1

Related Questions