Dear Mattias,
Sorry for my late answer, but I took the last days of 2007 for vacation. Anyway happy new year to all.
Returning our discussion about the MPICH on Windows. I used the gdb as listed in the tutorial to run the program helloworld.exe
As described below I installed the package MPICH2 and it was successfully instaled. So I runned the example below:
program HelloWorld;
{$mode objfpc}{$H+}
{$IFDEF Unix}
{$linklib c}
{$ENDIF}
uses MPI, MPICH2;
var myid: integer;
begin
MPI_Init(@argc,@argv);
MPI_Comm_rank(MPI_COMM_WORLD,@myid);
writeln('id=',myid);
MPI_Finalize;
end.
I got the error described in the attachment.
As it asked for a mpich.dll I tought that the H2Pas generated an DLL, but as you said the H2Pas does not generated an DLL, so why does it ask for a DLL? This DLL is the DLL that came from the MPICH2 ? On Windows MPICH2 installs the follwoing DLL on %WINDIR%\System32
mpich2.dll
mpich2mtp.dll
mpich2p.dll
mpich2shm.dll
mpich2shmp.dll
mpich2ssm.dll
mpich2ssmp.dll
Looking into this I do believe that the mpich.dll that the example is asking is for the mpich2.dll, so probably it should be inserted in the -l option the mpich2 instead of mpich. So it read the mpich2.dll instead of creating, is it right?
Also the resulting from the gbd from the CMD is:
Directory of G:\MPICH2_FPC_Lazarus\mpich2\examples
01/07/2008 03:07p <DIR> .
01/07/2008 03:07p <DIR> ..
01/07/2008 03:07p <DIR> backup
11/09/2007 09:14a 1,614 cpi.lpi
11/09/2007 09:14a 1,340 cpi.lpr
01/07/2008 03:07p 372 helloworld.compiled 01/07/2008 03:07p 1,128,432 helloworld.exe 01/07/2008 03:07p 1,893 helloworld.lpi 01/07/2008 03:07p 250 helloworld.lpr 01/07/2008 03:07p 1,476 helloworld.lps 01/07/2008 03:07p 8,060 helloworld.o 12/19/2007 02:12p 8 libimphelloworld.a 12/19/2007 11:33a 8,283 link.res
12/19/2007 11:33a 509 ppas.bat
11 File(s) 1,152,237 bytes
3 Dir(s) 4,372,066,304 bytes free
G:\MPICH2_FPC_Lazarus\mpich2\examples>gdb helloworld.exe GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-cygwin"...
(gdb) break fpc_raiseexception
Breakpoint 1 at 0x40661f: file except.inc, line 193. (gdb) run
Starting program: /cygdrive/g/MPICH2_FPC_Lazarus/mpich2/examples/helloworld.exe
Program received signal SIGSEGV, Segmentation fault.
Program received signal SIGSEGV, Segmentation fault.
Program exited with code 0200.
You can't do that without a process to debug.
(gdb) backtrace
No stack.
(gdb) quit
G:\MPICH2_FPC_Lazarus\mpich2\examples>
Thanks
Lourival
2007/12/21, Mattias Gaertner :
Show quoted text 52 lines
On Thu, 20 Dec 2007 08:58:49 -0300
"Lourival Mendes" wrote:
> Dear Mattias,
>
> Replacing the {$linklib c} with
> {$IFDEF Unix}
> {$linklib c}
> {$ENDIF}
>
> It really worked, thanks...
>
> Now some other interesting stuff happended, as you probably did on
> the -l option you created the mpich.dll but the program, even
> successufully compiled, it doens find the mpich.dll.
>
> Here is my tryes:
>
> 1) I tryed to compile from the MPICH2 package from the inside of the
> Lazarus; I got the same error
>
> 2) I followed your tutorial on the wiki
> (
http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries)
> installing the H2Pas and creating the mpich.dll with the mpi.h and
> mpio.h; it runs but I get:
h2pas does not create a mpich.dll.
> File not Open
>
> Press OK to ignore and risk data corruption
> Press Cancel to kill to program
Hmm. Maybe you can create a backtrace for me?
http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB
> 3) The same thing happens when I try to open the mpich2.h2p file that
> cames with the lazarus package.
>
> Do you know if someone got the same error?
No.
Mattias
_______________________________________________
fpc-pascal maillist -
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Lourival J. Mendes Neto