Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Van Canneyt



On Thu, 24 Sep 2015, Sven Barth wrote:


Am 24.09.2015 09:44 schrieb "Michael Van Canneyt" :




On Thu, 24 Sep 2015, Sven Barth wrote:


Am 24.09.2015 05:24 schrieb "Bo Berglund" :





Since you plan to port to Linux a word of caution: the "Windows" unit
doesn't exist there (and "GetTickCount" does neither), so you either need
to use platform specific functionality from the "BaseUnix" unit or cross
platform one from "SysUtils" and friends.



GetTickCount(64) exists in sysutils.



You should maybe also tale a look into using conditional compilation

using

"$ifdef" and the defines the compiler already provides for you (e.g.
"windows", "linux", "unix", "cpui386", "cpuarm", etc.).
Note: in 3.0.0 TThread provides the cross platform class functions
TThread.GetTickCount and TThread.GetTickCount64.



Which simply refer to sysutils.getTickCount(64).


Ehm right... I forgot about them despite having added them myself. :P


Indeed. That is why I was slightly surprised to read your answer :)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Sven Barth
Am 24.09.2015 09:44 schrieb "Michael Van Canneyt" :
>
>
>
> On Thu, 24 Sep 2015, Sven Barth wrote:
>
>> Am 24.09.2015 05:24 schrieb "Bo Berglund" :
>>>
>>>
>>
>> Since you plan to port to Linux a word of caution: the "Windows" unit
>> doesn't exist there (and "GetTickCount" does neither), so you either need
>> to use platform specific functionality from the "BaseUnix" unit or cross
>> platform one from "SysUtils" and friends.
>
>
> GetTickCount(64) exists in sysutils.
>
>
>> You should maybe also tale a look into using conditional compilation
using
>> "$ifdef" and the defines the compiler already provides for you (e.g.
>> "windows", "linux", "unix", "cpui386", "cpuarm", etc.).
>> Note: in 3.0.0 TThread provides the cross platform class functions
>> TThread.GetTickCount and TThread.GetTickCount64.
>
>
> Which simply refer to sysutils.getTickCount(64).

Ehm right... I forgot about them despite having added them myself. :P Like
TThread.GetTickCount(64) however they are only available in 3.0.0 and newer
(they were added at the same time as the TThread ones).

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Schnell

On 09/24/2015 05:28 AM, Bo Berglund wrote:
The only caveat here would be if Indy10 will actually build and 
function correctly in RaspBian.

Does you project including Indy 10 already run decently on PC-Linux ?

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Sven Barth
Am 24.09.2015 05:24 schrieb "Bo Berglund" :
>
> On Wed, 23 Sep 2015 17:48:24 -0400, Bo Berglund
>  wrote:
> I added code into the DoRun procedure of the new project so it looks
> like this:
> [code]
> procedure TSSCommTest.DoRun;
> var
>   FComm: TIdTCPClient;
>   T1, T2: Cardinal;
> begin
>   { add your program here }
>   Writeln('Creating TCP client');
>   FComm := TIdTCPClient.Create;
>   try
> Writeln('Connecting to 10.0.0.7 on port 2401 (CVS)');
> T1 := GetTickCount;
> FComm.Connect('10.0.0.7', 2401);
> T2 := GetTickCount;
> T2 := T2 - T1;
> Writeln('Connection succeeded in ' + IntToStr(T2) + ' ms, now
> closing down');
>   finally
> if FComm.Connected then
>FComm.Disconnect;
> FComm.Free;
>   end;
>   // stop program loop
>   Writeln('End of run');
>   Terminate;
> end;
> [/code]
> It compiled fine after I added Windows (for GetTickCount) and
> IdTCPClient to the uses clause.

Since you plan to port to Linux a word of caution: the "Windows" unit
doesn't exist there (and "GetTickCount" does neither), so you either need
to use platform specific functionality from the "BaseUnix" unit or cross
platform one from "SysUtils" and friends.
You should maybe also tale a look into using conditional compilation using
"$ifdef" and the defines the compiler already provides for you (e.g.
"windows", "linux", "unix", "cpui386", "cpuarm", etc.).
Note: in 3.0.0 TThread provides the cross platform class functions
TThread.GetTickCount and TThread.GetTickCount64.

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Van Canneyt



On Thu, 24 Sep 2015, Sven Barth wrote:


Am 24.09.2015 05:24 schrieb "Bo Berglund" :




Since you plan to port to Linux a word of caution: the "Windows" unit
doesn't exist there (and "GetTickCount" does neither), so you either need
to use platform specific functionality from the "BaseUnix" unit or cross
platform one from "SysUtils" and friends.


GetTickCount(64) exists in sysutils.


You should maybe also tale a look into using conditional compilation using
"$ifdef" and the defines the compiler already provides for you (e.g.
"windows", "linux", "unix", "cpui386", "cpuarm", etc.).
Note: in 3.0.0 TThread provides the cross platform class functions
TThread.GetTickCount and TThread.GetTickCount64.


Which simply refer to sysutils.getTickCount(64).

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Schnell

On 09/24/2015 05:24 AM, Bo Berglund wrote:
It compiled fine after I added Windows (for GetTickCount) and 
IdTCPClient to the uses clause.
So I say that this is milestone #1 on my way. 



Now I have to create a server...


IMHO milestone #2 should be to run the same project on a Linux PC

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Schnell

On 09/24/2015 02:22 PM, Bo Berglund wrote:
My first test was aginst our CVS server on port 2401 
Just for testing if a socket can receive data you can use any server in 
the Internet port 80 :-)


-Michael


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Michael Schnell

On 09/24/2015 02:55 PM, Michael Schnell wrote:

any server in the Internet port 80 :-)

or even better set up the Linux that you will need anyway. Linux always 
comes with telnet to a command line installed. You just need to activate 
it.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Bo Berglund
On Thu, 24 Sep 2015 08:04:26 +0200, Sven Barth
 wrote:

>
>Since you plan to port to Linux a word of caution: the "Windows" unit
>doesn't exist there (and "GetTickCount" does neither), so you either need
>to use platform specific functionality from the "BaseUnix" unit or cross
>platform one from "SysUtils" and friends.

I know...
I only added the GetTickCount in order to get something to display
with connection timing info. The test server is across a VPN channel
into the company network about 1500 miles away. So 62 ms is
acceptable.
 
>You should maybe also take a look into using conditional compilation using
>"$ifdef" and the defines the compiler already provides for you (e.g.
>"windows", "linux", "unix", "cpui386", "cpuarm", etc.).

Right you are!
BTW is there a define for FPC itself too so I can differentiate
between Delphi and FPC? THat way I could possibly use the exact same
sources and not have to make a copy.
Maybe there is a complete list of the defines in FPC?

>Note: in 3.0.0 TThread provides the cross platform class functions
>TThread.GetTickCount and TThread.GetTickCount64.

Is FPC 3.0 stable yet and does it exist on ARM?


-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Graeme Geldenhuys
On 2015-09-24 13:27, Bo Berglund wrote:
> into the company network about 1500 miles away. So 62 ms is
> acceptable.

If only we could travel that fast! :)

> BTW is there a define for FPC itself too so I can differentiate
> between Delphi and FPC?

Yes, "FPC".  ;-)

{$ifdef FPC}...{$ELSE}..{$endif}


There is also FPC versions which include major, minor etc.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Bo Berglund
On Thu, 24 Sep 2015 09:31:06 +0200, Michael Schnell
 wrote:

>On 09/24/2015 05:24 AM, Bo Berglund wrote:
>> It compiled fine after I added Windows (for GetTickCount) and 
>> IdTCPClient to the uses clause.
>> So I say that this is milestone #1 on my way. 
>
>> Now I have to create a server...
>
>IMHO milestone #2 should be to run the same project on a Linux PC
>
Exactly!
But I will first build a decent simulation server on Windows so I have
something to talk to while developing the application. I cannot keep
the data collection system on hand during that phase.
My first test was aginst our CVS server on port 2401


-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Sven Barth
Am 24.09.2015 11:59 schrieb "Michael Van Canneyt" :
>>> Which simply refer to sysutils.getTickCount(64).
>>
>>
>> Ehm right... I forgot about them despite having added them myself. :P
>
>
> Indeed. That is why I was slightly surprised to read your answer :)

I blame that my mind is filled by generics and dynamic packages, there's no
place anymore to remember such a small insignificant function :P

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cross-compiling for Raspberry Pi2

2015-09-24 Thread Sven Barth
Am 24.09.2015 14:28 schrieb "Bo Berglund" :
> >You should maybe also take a look into using conditional compilation
using
> >"$ifdef" and the defines the compiler already provides for you (e.g.
> >"windows", "linux", "unix", "cpui386", "cpuarm", etc.).
>
> Right you are!
> BTW is there a define for FPC itself too so I can differentiate
> between Delphi and FPC? THat way I could possibly use the exact same
> sources and not have to make a copy.
> Maybe there is a complete list of the defines in FPC?

The define is "FPC" ;)
The most important defines are available in the programmer's guide:
http://www.freepascal.org/docs-html/prog/progap7.html#x333-348000G

>
> >Note: in 3.0.0 TThread provides the cross platform class functions
> >TThread.GetTickCount and TThread.GetTickCount64.
>
> Is FPC 3.0 stable yet and does it exist on ARM?

We have already released the RC and thus only small fixes are still
expected to take place. AFAIK I've also seen a RC for the RPi somewhere...

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] FPC on OpenIndiana...

2015-09-24 Thread Liyuan García Caballero

Hi guys,

The install.sh script is missing for 
http://www.freepascal.org/down/x86_64/solaris-austria.var


Have a nice day

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FPC on OpenIndiana...

2015-09-24 Thread Mattias Gaertner
On Thu, 24 Sep 2015 14:11:34 -0400
Liyuan García Caballero  wrote:

> Hi guys,
> 
> The install.sh script is missing for 
> http://www.freepascal.org/down/x86_64/solaris-austria.var

I'm not sure if the Solaris maintainer of FPC is reading this list.
Please create a bug report.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus