[MPICH] Compiling and using under WinXP/cygwin - use lib*.a in MPICH2\lib

Jayesh Krishna jayesh at mcs.anl.gov
Thu Jan 24 10:06:16 CST 2008


Hi,
 The command below should be able to compile an MPI program written in C (or
set the appropriate env vars -- see g++ doc for details),

    g++ -I<INCLUDE-DIR> -L<LIB-DIR> icpi.c -lmpi -o cpi_cygwin.exe

(eg:This is what I do, g++ -I/cygdrive/c/Progra~1/MPICH2/include
-L/cygdrive/c/Progra~1/MPICH2/lib icpi.c -lmpi -o cpi_cygwin.exe) 

Regards,
Jayesh

-----Original Message-----
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of madfran
Sent: Wednesday, January 23, 2008 4:50 PM
To: mpich-discuss at mcs.anl.gov
Subject: RE:RE: RE: RE: [MPICH] Compiling and using under WinXP/cygwin - use
lib*.a in MPICH2\lib

Hi,...

I changed from mpicc to gcc and

BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples $ make hellow gcc
-I../src/include -I../src/include -O2  -c hellow.c
hellow.c:8:17: mpi.h: No such file or directory
hellow.c: In function `main':
hellow.c:16: error: `MPI_COMM_WORLD' undeclared (first use in this function)
hellow.c:16: error: (Each undeclared identifier is reported only once
hellow.c:16: error: for each function it appears in.)
make: *** [hellow.o] Error 1

*******************************************************************
It seems are not able to find mpi.h
I modify the PATH

BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/cygwin/lib:/cygdrive
/c
/P
erl/bin/:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/Syst
em
32
/Wbem:/cygdrive/c/Program Files/HPQ/IAM/bin:/cygdrive/c/Program Files/Common
Fil es/Autodesk Shared/:/cygdrive/c/program files/IXOS/IXOS-
eCONtext/bin:/cygdrive/c /program files/IXOS/IXOS-
eCONtext/opt/ORA/bin:/cygdrive/c/Oracle/ora8iclient/bin
:/cygdrive/c/Program
Files/Oracle/jre/1.1.7/bin:/cygdrive/c/Oracle/ora81/bin:/cy
gdrive/c/pgp:/cygdrive/c/Program Files/Common Files/AspenTech
Shared/:/cygdrive/ c/DJGPP/BIN:/cygdrive/c/Program
files/MPICH2/bin:/usr/bin:/cygdrive/c/Program
Fi
les/Nmap:/cygdrive/c/Program
files/MPICH2/bin:/cygdrive/c/PGP:/bin:/cygdrive/c/P
rogram Files/MPICH2/include/:/cygdrive/c/Program Files/MPICH2/lib/

********************************************************************
Without succes. I don't know the reason.

I copied the mpi.h from c:\Program Files\MPICH2\include\ to
c:\cygwin\...\src\include\

Result,

BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples $ make hellow gcc
-I../src/include -I../src/include -O2  -c hellow.c In file included from
hellow.c:8:
../src/include/mpi.h:1108:18: mpio.h: No such file or directory
make: *** [hellow.o] Error 1


********************************************************************
I copied the mpio.h from c:\Program Files\MPICH2\include\ to
c:\cygwin\...\src\include\


BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples $ make hellow gcc
-I../src/include -I../src/include -O2  -c hellow.c
make: *** No rule to make target `../lib/libmpich.a', needed by `hellow'.  
Stop.
BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples

********************************************************************

But libmpich.a doesn't exist in any place

Any idea?

madfran


********************************************************************
********************************************************************
Hi,

>>>I remove c:\cygwin\home\yo\MPICH2\... Then, I am not able to compile
under cygwin

mpicc is a script provided with MPICH2 installation to compile MPI programs.
You should use gcc/g++ directly to compile programs after removing the
MPICH2 installation.

>>>...found under c:\Program Files\MPICH2\lib\ must be copied under cygwin?

You can access the files in windows without copying them.
(/cygdrive/c/Progra~1/MPICH2/lib)

Regards,
Jayesh

-----Original Message-----
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of madfran
Sent: Tuesday, January 22, 2008 4:18 PM
To: mpich-discuss at mcs.anl.gov
Subject: RE: RE: RE: [MPICH] Compiling and using under WinXP/cygwin - use
lib*.a in MPICH2\lib

Hi,...

>
>>>>> 1-Can you send me a procedure ?
>Just remove the MPICH2 install directory under cygwin (or modify the 
>PATH accordingly). Install MPICH2 using the MSI installer.

I remove c:\cygwin\home\yo\MPICH2\
and remove the related information in $PATH I erase also all the build
directory ...Then, I am not able to compile under cygwin

This is the output,

BE04845 at NOHW8156 /tmp/mpi/mpich2-1.0.6p1/examples $ make cpi ../bin/mpicc
-I../src/include -I../src/include -O2  -c cpi.c
make: ../bin/mpicc: Command not found
make: *** [cpi.o] Error 127

>>>>> 2-I will be able to compile other programs under cygwin if MPICH2 
>>>>> it is
>not installed under cygwin?
>As I mentioned in my previous email, "You should make sure that you use 
>the libraries (lib*.a)provided with the windows installation of MPICH2 
>(in MPICH2\lib) when compiling your program under cygwin (if you want 
>to run the program using the windows version of MPICH2)." You are 
>provided a set of libraries, MPICH2\lib\lib*.a, with the MPICH2 
>installation (MSI
>installation) to be used with cygwin gcc. See the windows developer's 
>guide for more details 
>(http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.ph
>p?s=d
>ocs).

In mpich2-doc-windev.pdf they are not any information about compiling under
cygwin

When you say "You should make sure that you use the libraries (lib*.a)
provided with the windows installation of MPICH2 (in MPICH2\lib) when
compiling your program under cygwin (if you want to run...."

It seems that the files,
libfmpich2g.a
libmpi.a
libmpicxx.a
found under c:\Program Files\MPICH2\lib\ must be copied under cygwin?

madfran

************************************************************************
-----Original Message-----
From: owner-mpich-discuss at mcs.anl.gov
[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of madfran
Sent: Monday, January 21, 2008 4:50 PM
To: mpich-discuss at mcs.anl.gov
Subject: RE: RE: [MPICH] Compiling and using under WinXP/cygwin

Hi,..

I am sure I use the mpiexec from MSI, but however with the mpiexec from
cygwin I obtain the same result.

smpd.exe -status, say me,
"smpd running on NOHW8156"

Well. I think will be necessary to remove the installation of MPICH2 from
cygwin and remain only with the installation from msi.

1-Can you send me a procedure ?
2-I will be able to compile other programs under cygwin if MPICH2 it is not
installed under cygwin?

madfran

>Hi,
>Can you make sure that you are using the mpiexec installed using the 
>MSI installer when running your program, compiled under cygwin, on 
>windows ? You should make sure that you use the libraries (lib*.a) 
>provided with the windows installation of MPICH2 (in MPICH2\lib) when 
>compiling your program under cygwin (if you want to run the program 
>using the windows version of MPICH2).
>We recommend windows users to only install MPICH2 using the MSI 
>installer (and not recompile under cygwin). The user can then compile 
>his/her programs using the cygwin compiler suite and headers/libs 
>provided with the MPICH2 installation (using the MSI installer).
>Also make sure that you have the process manager running on your system 
>(After making sure that you are running smpd.exe installed using the 
>MSI installer, type "smpd.exe -status" to get the status of the process 
>manager).
>
>Regards,
>Jayesh
>-----Original Message-----
>From: owner-mpich-discuss at mcs.anl.gov
>[mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of madfran
>Sent: Friday, January 18, 2008 3:10 PM
>To: mpich-discuss at mcs.anl.gov
>Subject: [MPICH] Compiling and using under WinXP/cygwin
>
>Hi,...
>
>Situation.
>OS Windows XP
>cygwin
>Over XP I install mpich2 using "mpich2-1.0.6p1-win32-ia32.msi"
>Over cygwin install mpich2 using "mpich2-1.0.6p1.tar.gz"
>
>Facts
>I can't compile any software under cygwin that work under pmi but its 
>work well.
>
>Example.
>I compile the soft "hellow" found under the 
>.../mpich2-1.0.6p1/examples/ and created the "hellow.exe"
>
>I launch hellow.exe without problems under cygwin 
>/tmp/mpi/mpich2-1.0.6p1/examples $ ./hellow.exe Hello world from 
>process 0 of 1
>
>But with mpiexec the result is,
>/tmp/mpi/mpich2-1.0.6p1/examples
>$ mpiexec -n 2 ./hellow.exe
>[unset]: unable to decode hostport from 1245
>[unset]: aborting job:
>Fatal error in MPI_Init: Other MPI error, error stack:
>MPIR_Init_thread(294): Initialization failed
>MPID_Init(82)........: channel initialization failed
>MPID_Init(333).......: PMI_Init returned -1
>[unset]: unable to decode hostport from 1252
>[unset]: aborting job:
>Fatal error in MPI_Init: Other MPI error, error stack:
>MPIR_Init_thread(294): Initialization failed
>MPID_Init(82)........: channel initialization failed
>MPID_Init(333).......: PMI_Init returned -1
>
>**********************************************************************
>Same result under cmd WinXP
>
>C:\cygwin\tmp\mpi\mpich2-1.0.6p1\examples>hellow.exe
>Hello world from process 0 of 1
>
>C:\cygwin\tmp\mpi\mpich2-1.0.6p1\examples>mpiexec -n 2 -localroot 
>hellow.exe
>[unset[unset]: unable to decode hostport from 1318
>[]: unable to decode hostport from 1325
>[unsetunset]: aborting job:
>Fatal error in MPI_Init: Other MPI error, error stack:
>MPIR_Init_thread(294): Initialization failed
>MPID_Init(82)........: channel initialization failed
>MPID_Init(333).......: PMI_Init returned -1
>]: aborting job:
>Fatal error in MPI_Init: Other MPI error, error stack:
>MPIR_Init_thread(294): Initialization failed
>MPID_Init(82)........: channel initialization failed
>MPID_Init(333).......: PMI_Init returned -1
>
>madfran







More information about the mpich-discuss mailing list