0

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.

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.