Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-09

The use of FPC and Lazarus for simulation software

10 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author
to P. van der Velde: Hello people If all goes well I will be starting my PhD work in a few months. For my PhD…
P. van der Velde wrote 9 lines
Now I had some questions with regards to the possibilities of FPC and Lazarus. If these are way off topic please let me know and I'll take my questions elsewhere. First I would like to know if it is possible to do dynamic package loading in Lazarus and FPC. I know static package loading is possible (loading a package at compile time). However I really want to do dynamic loading for my project. As far as I know this is not (yet) possible in FPC or am I wrong here? If it is not available any idea on how long it will take before it will be available or if it will be available at all?

It depends. There is limited support for writing dynamical libraries, on Linux. Libraries on Win32 work just fine. Loading external libraries works OK on both platforms.

But there is nothing yet in the line of the package system as it exists in Delphi. This is not likely to appear in the nearest year.

Show quoted text 10 lines
Another question is with regards to Synchronisation objects. I will be using multi-threading quite heavily and as a concequence I will need some Sync Objects. I notices that there are a few of them in the FP library but I'm kinda missing the MREWS (MultipleReadExclusiveWriteSynchroniser). Chances are that I will need it because the user interface and some other objects only need to read the data while there will probably only be one data generator. Therefore it should be more efficient to use a MREWS but as far as I know that is not present in the FP lib, or is it?

1.1 has support for multithreading. You can easily implement the needed classes yourself.

Show quoted text 10 lines
The third question is with regards to the current functionallity of Lazarus. How well does Lazarus actually work on Windows machines at this moment. I have tried to find a download but can't find one. I also tried to download the latest snapshot but I can't seem to get the CVS working on my machine (probably due to the fact that I'm doing something really stupid because I followed the instructions on the Lazarus website but it is still not working). So if anybody has a simple download link for me I would be really thankfull. Is it already possible to just download an installable version or do I have to compile Lazarus after downloading?

Here, mileage may vary. The IDE runs but is unstable, but most generated applications will work probably fine with the GTK interface, to a lesser degree the Win32 interface. It may take some time to get the win32 interface to the same level of stability. The practical upshot of this is that you can develop on Linux, and recompile on Windows, and the generated application should work. (some bugs aside, only actual use will tell).

Work on Win32 has been progressing quite well the last months, so chances are that it won't take long for it to be 100% OK.

Show quoted text 6 lines
Finally I would like to know if the the DUnit testing system (http://www.dunit.sourceforge.net) works with FPC and Lazarus? I have been using this system to test my classes for some time now I have found that it is one of the best testing systems. It has helped me remove loads of bugs from my source code.

If it works, only with 1.1, because it makes heavy use of interfaces.

Michael.

P. van der Velde

Hello people

If all goes well I will be starting my PhD work in a few months. For my PhD research I will be designing and developing a platform for multi-physics simulations. This platform will consist of two main items. The first is a number of libraries with standard base objects from which new components can be derrived. The second is the actual application that can load components and then allow them to perform their task. The aplication can thus be seen as a platform for numerical simulations and the library sort of as a API. If all goes well the platform should become somewhat of a standard for numerical simulation software.

The main reason I am interested in FPC and Lazarus is that FPC allows one to write a single source file that can be compiled on many different systems (Windows, Linux etc.). This would be great for the application I am going to develop. I would want to use Lazarus as my code editor given that I am used to writing my source code in Delphi (and am thus extremely spoiled with silly things like a working IDE, code completion, object inspectors, simple GUI design etc. etc. ;-).

Now I had some questions with regards to the possibilities of FPC and Lazarus. If these are way off topic please let me know and I'll take my questions elsewhere.
First I would like to know if it is possible to do dynamic package loading in Lazarus and FPC. I know static package loading is possible (loading a package at compile time). However I really want to do dynamic loading for my project. As far as I know this is not (yet) possible in FPC or am I wrong here? If it is not available any idea on how long it will take before it will be available or if it will be available at all?

Another question is with regards to Synchronisation objects. I will be using multi-threading quite heavily and as a concequence I will need some Sync Objects. I notices that there are a few of them in the FP library but I'm kinda missing the MREWS
(MultipleReadExclusiveWriteSynchroniser). Chances are that I will need it because the user interface and some other objects only need to read the data while there will probably only be one data generator. Therefore it should be more efficient to use a MREWS but as far as I know that is not present in the FP lib, or is it?

The third question is with regards to the current functionallity of Lazarus. How well does Lazarus actually work on Windows machines at this moment. I have tried to find a download but can't find one. I also tried to download the latest snapshot but I can't seem to get the CVS working on my machine (probably due to the fact that I'm doing something really stupid because I followed the instructions on the Lazarus website but it is still not working). So if anybody has a simple download link for me I would be really thankfull. Is it already possible to just download an installable version or do I have to compile Lazarus after downloading?

Finally I would like to know if the the DUnit testing system (http://www.dunit.sourceforge.net) works with FPC and Lazarus? I have been using this system to test my classes for some time now I have found that it is one of the best testing systems. It has helped me remove loads of bugs from my source code.

Thanks for your help

Regards Petrik

Vincent Snijders
to P. van der Velde
Show quoted text 13 lines
On Fri, 19 Sep 2003, P. van der Velde wrote: > Finally I would like to know if the the DUnit testing system > (http://www.dunit.sourceforge.net) works with FPC and Lazarus? I > have been using this system to test my classes for some time now I > have found that it is one of the best testing systems. It has helped > me remove loads of bugs from my source code. If it works, only with 1.1, because it makes heavy use of interfaces. Michael.

Last year I took the code of dunit (version 5.02, I think) and changed it so that the testframework unit and the texttestrunner work. I still miss some features, such as saving settings and error trace back. I don't know if I can give those units to you as I don't understand the licence very well. The code is based on dunit, but I wouldn't want to call it dunit anymore, because I amputated so much. Last week I give a try to make the guitestrunner compile and run. I had the following problems:
- AFAIK, Actions are not fully implemented in the LCL.
- I ran into a compiling problem, I had no solution for: Error: Symbol can't be published, can be only a class" The only reference on the mailinglist told it was possibly a compiler bug and that you should retry with fpc 1.1. Unfortunately 1.1 is not stable enough this week, due to the reorganization of the linux, unix and unixbase units.

Regards,
Vincent.

Mattias Gaertner
to P. van der Velde: Hello people If all goes well I will be starting my PhD work in a few months. For my PhD…
I had the following problems: - AFAIK, Actions are not fully implemented in the LCL.

What part of Actions do you need?

- I ran into a compiling problem, I had no solution for: Error: Symbol can't be published, can be only a class" The only reference on the mailinglist told it was possibly a compiler bug and that you should retry with fpc 1.1.

I had the same problem with turbopower's ipro. It is a compiler bug. It seems to have something to do with the Delphi mode. Mine vanished, after fixing all warnings and reducing the unit circles.

Mattias

Show quoted text 11 lines
Unfortunately 1.1 is not stable enough this week, due to the reorganization of the linux, unix and unixbase units. Regards, Vincent. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Vincent Snijders
to Vincent Snijders: On Sat, 20 Sep 2003 12:02:59 +0200 (CEST) Last year I took the code of dunit (version…
Show quoted text 31 lines
> On Sat, 20 Sep 2003 12:02:59 +0200 (CEST) > wrote: > > On Fri, 19 Sep 2003, P. van der Velde wrote: > > > > > Finally I would like to know if the the DUnit testing system > > > (http://www.dunit.sourceforge.net) works with FPC and Lazarus? I > > > have been using this system to test my classes for some time now > > > I have found that it is one of the best testing systems. It has > > > helped me remove loads of bugs from my source code. > > > > If it works, only with 1.1, because it makes heavy use of > > interfaces. > > > Last year I took the code of dunit (version 5.02, I think) and > changed it so that the testframework unit and the texttestrunner > Last week I give a try to make the guitestrunner compile and run. > I had the following problems: > - AFAIK, Actions are not fully implemented in the LCL. > - I ran into a compiling problem, I had no solution for: > Error: Symbol can't be published, can be only a class" > The only reference on the mailinglist told it was possibly a > compiler bug and that you should retry with fpc 1.1. Unfortunately > 1.1 is not stable enough this week, due to the reorganization of the > linux, unix and unixbase units. This is starting to work again, rtl-compiler-basepackages-fcl works, however there are still some makefiles to update.

ATM I can't compile the 1.1 RTL with fpc 1.0.10, so I can't cycle a new compiler.
/home/vsds/lazarus/bin/ppc386-release -dUNIX -Ur -Xs -OG2p3 -n -Fi../inc -Fi../i386 -Fi../unix -Fii386 -FE. -gl -di386 -dRELEASE ../unix/linux.pp liunsysc.inc(66,26) Error: Incompatible type for arg no. 2: Got LONGINT, expected PCINT liunsysc.inc(442,17) Error: Incompatible type for arg no. 2: Got LONGINT, expected PCINT liunsysc.inc(456,17) Error: Incompatible type for arg no. 2: Got LONGINT, expected PCINT linux.pp(32,1) Fatal: There were 3 errors compiling module, stopping

Last time I tried, the LCL couldn't be compiled with fpc 1.1, synedit couldn't, so Lazarus cannot be compiled with fpc 1.1. That doesn't stop us to use fpc 1.1 with Lazarus, though.

Vincent.

Marco van de Voort
to Vincent Snijders: On Sat, 20 Sep 2003 12:02:59 +0200 (CEST) Last year I took the code of dunit (version…
Show quoted text 16 lines
On Sat, 20 Sep 2003 12:02:59 +0200 (CEST) wrote: > On Fri, 19 Sep 2003, P. van der Velde wrote: > > > Finally I would like to know if the the DUnit testing system > > (http://www.dunit.sourceforge.net) works with FPC and Lazarus? I > > have been using this system to test my classes for some time now I > > have found that it is one of the best testing systems. It has helped > > me remove loads of bugs from my source code. > > If it works, only with 1.1, because it makes heavy use of interfaces. > Last year I took the code of dunit (version 5.02, I think) and changed it so that the testframework unit and the texttestrunner
File testframework.pas not changed so no update needed.
bash-2.05b# ppc386 testframework.pas  -Sd
Free Pascal Compiler version 1.1 [2003/09/20] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling testframework.pas
testframework.pas(62,19) Error: No matching implementation for interface method "ITest.Run:TTestResult" found
testframework.pas(63,19) Error: No matching implementation for interface method "ITest.LoadConfiguration(const AnsiString,const Boolean)" found
testframework.pas(63,19) Error: No matching implementation for interface method "ITest.SaveConfiguration(const AnsiString,const Boolean)" found
testframework.pas(63,19) Error: No matching implementation for interface method "ITest.LoadConfiguration(const AnsiString,const Boolean)" found
testframework.pas(63,19) Error: No matching implementation for interface method "ITest.SaveConfiguration(const AnsiString,const Boolean)" found
testframework.pas(460,40) Error: Procedure directive "ASSEMBLER" not allowed in interface section
testframework.pas(473,1) Fatal: There were 6 errors compiling module, stopping
bash-2.05b#
Show quoted text 9 lines
Last week I give a try to make the guitestrunner compile and run. I had the following problems: - AFAIK, Actions are not fully implemented in the LCL. - I ran into a compiling problem, I had no solution for: Error: Symbol can't be published, can be only a class" The only reference on the mailinglist told it was possibly a compiler bug and that you should retry with fpc 1.1. Unfortunately 1.1 is not stable enough this week, due to the reorganization of the linux, unix and unixbase units.

This is starting to work again, rtl-compiler-basepackages-fcl works, however there are still some makefiles to update.

I could import the current version of dunit into the contrib part of CVS?

It is one of the pkgs on my list (the ones that I use for delphi compability testing from time to time)

Marco van de Voort
to Vincent Snijders: On Sat, 20 Sep 2003 17:50:05 +0200 (CEST) ATM I can't compile the 1.1 RTL with fpc…
Show quoted text 12 lines
On Sat, 20 Sep 2003 17:50:05 +0200 (CEST) (Marco van de Voort) wrote: > > The only reference on the mailinglist told it was possibly a > > compiler bug and that you should retry with fpc 1.1. Unfortunately > > 1.1 is not stable enough this week, due to the reorganization of the > > linux, unix and unixbase units. > > This is starting to work again, rtl-compiler-basepackages-fcl works, > however there are still some makefiles to update. > ATM I can't compile the 1.1 RTL with fpc 1.0.10, so I can't cycle a new compiler.

That's fixed meanwhile. I did check 1.1, but forget to commit it.

Last time I tried, the LCL couldn't be compiled with fpc 1.1, synedit couldn't, so Lazarus cannot be compiled with fpc 1.1. That doesn't stop us to use fpc 1.1 with Lazarus, though.

As soon as it is fully stable again, I'll start playing with it.

To ease the transition, I'm creating an "oldlinux" unit for the Unix platforms, which should more or less match 1.0.x linux unit.

The problem is only that the linuxerror constant will behave a little differently. It would be a lot of work to fix that for all calls, so I want to keep that limited to the functions that really need that.

P. van der Velde
to Unknown author: It depends. There is limited support for writing dynamical libraries, on Linux. Libraries…
Show quoted text 23 lines
On Fri, 19 Sep 2003, P. van der Velde wrote: >Now I had some questions with regards to the possibilities of FPC and >Lazarus. If these are way off topic please let me know and I'll take my >questions elsewhere. >First I would like to know if it is possible to do dynamic package >loading in Lazarus and FPC. I know static package loading is possible >(loading a package at compile time). However I really want to do dynamic >loading for my project. As far as I know this is not (yet) possible in >FPC or am I wrong here? If it is not available any idea on how long it >will take before it will be available or if it will be available at all? > > It depends. There is limited support for writing dynamical libraries, on Linux. Libraries on Win32 work just fine. Loading external libraries works OK on both platforms. But there is nothing yet in the line of the package system as it exists in Delphi. This is not likely to appear in the nearest year.

Ok that is to bad. Any idea on when it will be available?

To give you an idea why I think I need dynamic package loading I will quickly explain the idea. The base idea of my research is that I will develop an application which contains basic knowledge about the components it controls (compiled with the application are a number of abstract base classes which form the base for the components). To allow a developer to use the application without having to recompile if he develops a new component I thought that it would be best if these new components (a collection of classes) would be stored in a package. The application can then dynamically load the package, locate the different classes and use them. All without recompiling etc. Now can I also do this with normal external libraries (i.e. store classes in them and extract these for use)? And how could I achieve this.

Regards Petrik

Michael Van Canneyt
to Unknown author: It depends. There is limited support for writing dynamical libraries, on Linux. Libraries…
P. van der Velde wrote 28 lines
wrote: >On Fri, 19 Sep 2003, P. van der Velde wrote: > > > >>Now I had some questions with regards to the possibilities of FPC and >>Lazarus. If these are way off topic please let me know and I'll take my >>questions elsewhere. >>First I would like to know if it is possible to do dynamic package >>loading in Lazarus and FPC. I know static package loading is possible >>(loading a package at compile time). However I really want to do dynamic >>loading for my project. As far as I know this is not (yet) possible in >>FPC or am I wrong here? If it is not available any idea on how long it >>will take before it will be available or if it will be available at all? >> >> > >It depends. There is limited support for writing dynamical libraries, >on Linux. Libraries on Win32 work just fine. Loading external libraries >works OK on both platforms. > >But there is nothing yet in the line of the package system as it exists in >Delphi. This is not likely to appear in the nearest year. > Ok that is to bad. Any idea on when it will be available?

No. Like I said, definitely not in the nearest year.

Show quoted text 13 lines
To give you an idea why I think I need dynamic package loading I will quickly explain the idea. The base idea of my research is that I will develop an application which contains basic knowledge about the components it controls (compiled with the application are a number of abstract base classes which form the base for the components). To allow a developer to use the application without having to recompile if he develops a new component I thought that it would be best if these new components (a collection of classes) would be stored in a package. The application can then dynamically load the package, locate the different classes and use them. All without recompiling etc. Now can I also do this with normal external libraries (i.e. store classes in them and extract these for use)? And how could I achieve this.

I think you can do this by using interfaces.
This kind of problems is why they were invented, I suppose.

All you need is a registration routine which is exported by your library, and a routine which creates a requested class/interface.

It shouldn't be that hard. The only caveat will be that IS and AS operators won't work correctly as the VMTs will be different.

Michael.

P. van der Velde
to Unknown author: It depends. There is limited support for writing dynamical libraries, on Linux. Libraries…
Michael Van Canneyt wrote 12 lines
[snip] I think you can do this by using interfaces. This kind of problems is why they were invented, I suppose. All you need is a registration routine which is exported by your library, and a routine which creates a requested class/interface. It shouldn't be that hard. The only caveat will be that IS and AS operators won't work correctly as the VMTs will be different.

Ok thanx. I didn't think about that. The only thing that puzzles me is why the vmt's will be different? If you allways use the creator routine (which is exported by the library) aren't all classes created in the same memory space etc? Shouldn't that also mean that the VMTs are the same? Or am I missing the crucial point here?

Thanx

Petrik