#201 Re: Free Pascal Compiler » [SOLVED] How to use CompressSynLZO function? » 2016-06-20 05:01:14

AOG

Yes, this function always returns "synlzo".

SynSelfTests.pas is often a good place to have an idea about how to use a function.
Line 8179 (TTestCompression._SynLZO) and further of this file.

You will see that the anistring s is compressed and decompressed !

#202 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-18 15:27:39

AOG

Strange indeed.

I was thinking about asking for a FPC_HAS_PPTYPEINFO flag.
But I presume this is a "feature" that will become a standard for everything after FPC 3.0.
So, if VER>3_0 : PPTypeInfo. Perhaps this is the reason for not adding a flag.

And FPC core will argue that FPC trunk is a running target, I expect.

Thanks for undefining HASDIRECTTYPEINFO. mORMot will work out-of-the-box again with current trunk.

#204 Re: Free Pascal Compiler » FPC parameter passing for dynamic arrays » 2016-06-18 10:14:48

AOG

If the weather remains as bad as it is right now, I will have a look at it again ... ;-)
Tests will be done with FPC fixes (3.0.1/3.0.2) and FPC trunk (with PPTypeInfo).

#205 Re: mORMot 1 » TestSQL3.exe - Lazarus_fpcup 1.7-Win32 fpc 3.1.1 (2016-06-17) » 2016-06-18 05:45:35

AOG

@miab3
Please note that the errors in 2.11. DDD shared units are caused by optimizations problems in FPC.
Using -O0 or -O1 under i386 would be ok.
See: http://bugs.freepascal.org/view.php?id=30255

edit
My bad, this FPC bug was already solved: http://svn.freepascal.org/cgi-bin/viewv … sion=33948
Using -O2 on x86_64 is ok however.

#206 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-18 05:21:18

AOG

@ab
Allright !
Latest commit: everything working as expected, with and without interface RTTI !

#207 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-17 10:29:09

AOG

Working as expected.
I get a nice "Hello World" exception while debugging with MinGW GDB under Win64/FPC64.
See: https://drive.google.com/open?id=0B96fg … TdtRGp1cGs

#208 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-17 07:30:25

AOG

@Chaa
I could help.
But tell me how to generate an exception as you would expect ?

#209 Re: mORMot 1 » Memcached Boilerplate HTTP Server for Synopse mORMot Framework » 2016-06-09 13:29:08

AOG

I just tested it with OpenUI5.
Works 100% !
With a 500% speed gain !!

#210 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-01 08:10:31

AOG

Unfortunately (installing in any folder) is not that easy !
The config-files of FPC and Lazarus are full of paths.
These have to be set beforehand.
That is why there is the prescribed directory.

But the zip also contains fpclazup and all the necessary batchfiles.
And alll crosslibs and crosstoolchains
So, users can also perform the whole setup by themselves.
In any directory they want.
If needed, I will give extra instruction to do so.

#212 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-06-01 04:40:24

AOG

@hnb
Keep faith ! You are doing good work.
But opensource means compromise and patience.
Which is sometimes hard.
Although I must commit that three years is very looooong ... ;-) ... and indeed frustrating ...

Opensource also means: freedom to fork. So lets move forward and don't look back !!

@all
About the binary, I propose the following (I have good experience with this).

Many people are interested in the mORMot / FPC combi. If we help them, they will become mORMot users.
Many have difficulty with cross-compiling. If we help them, they will become mORMot/crossFPC users.
mORMot is now fully cross-platform. mORMot running on Linux64 is a MAJOR plus.

For a start, I can make a Windows zip with a fully self-contained FPC (with RTTI)/Lazarus/mORMot.
No install, just an unpack in a (prescribed) directory. Click the start-shortcut and you are ready to go !
With cross-compiling enabled for Win64, Linux32/64, ARM (RPi2) and aarch64 (Odroid-C2).

The self-contained means no install and no changes in the system of the user.
Just unzip. It also means that the users can use this in parrallel with his own FPC/Laz install. They will never touch.
(at the moment, I have 5 different installs on my system)

This is the most easy for me to make. A real install will consume time. I could dive into it.
But I think that the install has to be self-contained. Just use it and remove it at will, without any consequences.

@hnb
We can use your FPC version with the nice features you described.
Patch it with RTTI (easy), put it on Github and maintain it for important (trunk) changes that are necessary for the mORMot.
I can build the cross package, and also put it online. And off-we-go ! We go forward, the rest will follow.
This special FPC version can also be added to fpc(laz)up, making it in easy reach of many more users.

All the above is just a proposal.
But also a way for an easy start. For ourselves and the users !
In due time, I hope that FPC core developers will follow us.

#213 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-31 08:11:46

AOG

The special interface RTTI branch of FPC has been updated, but still does not compile.
I am trying to solve this together with the maintainer.

In the meantime, I have created a branch of FPC trunk with RTTI on GitHub.
https://github.com/LongDirtyAnimAlf/fpctrunkrtti

The latest version of fpc(laz)up will use this repo.

If you want to use it without updating fpc(laz)up:
change
RTTI=http://svn.freepascal.org/svn/fpc/branches/interfacertti
into
RTTI=https://github.com/LongDirtyAnimAlf/fpctrunkrtti.git/trunk
inside of fpcup.ini

I hope you will succeed.

#214 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-30 08:45:53

AOG

@ab
Thanks for refactoring and including latest changes. mORMot (interfaces) now runs 100% on aarch64 !

I used movlpd because FPC warns for possible errors when loading a 64bit value into a 128bit register.
Thats it. As it seems, FPC does not detect the fact that zero-extension is used by movsd.

I will ask again to take over the RTTI branch on the FPC svn server. That will be the most easy way.
I will also work on more systems for RTTI: a patch (working) for aarch64 is already made.

#215 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-29 13:24:01

AOG

Good news ... I hope and wish they will include ... I have extra RTTI patch available for aarch64.

At https://github.com/LongDirtyAnimAlf/mORMot/ some more (minor) tweaks for the previous commit.

Especially, the (large) stack-tests revealed some problems.
And FPC aarch64 does not (yet) use the last float register for passing params .. I will report as a bug ... curious if this is a bug.

#216 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-29 07:48:21

AOG

Ok.

Added some necessary changes into the latest commit.
Can be found at: https://github.com/LongDirtyAnimAlf/mORMot
This also answers question 2.

Question 1:

The original code of AddrAllocMem can be found at:
https://github.com/RRUZ/Delphi-IDE-Colo … etours.pas
https://github.com/RRUZ/vcl-styles-util … etours.pas

The FakeStubs use relative jumps.
But FPC maps the requested memory too far away for a relative jump.
This code finds a piece of memory close by.

Naturally, there is room for improvement (speed-up) !

#217 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-29 07:31:11

AOG

@ab
I think I just did something wrong on GitHub.
But I made a new fork, of your recent commit.
Will add some necessary changes soon, to solve some regressions !
Be back soon.

#218 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-27 20:16:09

AOG

I am maintaining a separate uptodate branch of the mORMot, with all the necessary (minor) bug-fixes for the great mORMot.

https://github.com/LongDirtyAnimAlf/mORMot/

You can try this branch. I think it will work for you. The reported problems will be solved.

(I even added low level asm for aarch64 today !)

#219 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-23 12:18:14

AOG

ARM implementation for interfaces (SOA services) ready and working !

About Mac OS.
I do have some GUI clients for Mac. Working fine.
But I am not yet in the need for more.
Besides, a code refactoring should be done to distinguish better between Linux, Unix and Darwin.
And that is a lot of (debug) work.

Next target: aarch64 !

#220 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-21 07:37:53

AOG

Interfaces now working 100% on Linux 64 bit (and FPC Win64 and Delphi .... no regressions detected yet) !!!
Major goal reached with mORMot on Linux 64 bit !!!
This means that code change for FP-registers is ok and working.

Path towards ARM and Aarch64 now open.

Please test.
https://github.com/LongDirtyAnimAlf/mORMot

#221 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-19 08:53:04

AOG

Bidirectional sockets now working under FPC 64 bit !
Just a single type change ... but consuming so many hours ... ;-)

#222 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-18 17:37:19

AOG

Not mandatory. Just safety.

This FPC/mORMot bug-hunting makes me (slightly) crazy. Code that should work, does not work.
Work-arounds that are non-logical make things work. So, I am getting a bit paranoid, and add more safety than perhaps needed. Does not do a lot of harm however.

Thats it.

#223 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-18 17:09:29

AOG

@ab@edwinsn

New version for FPC mORMot fork.
Interfaces under FPC 64 bit Windows work. Without regression for Delphi.
CallMethod works under Linux64 bit. FakeCall also, but not yet 100%.
A code review / test would be welcome !

#224 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-16 16:51:14

AOG

Hi Ab,

ARM (and aarch64) invoke support is not yet finished !
It was just copy/past of old code. To get placeholders for the new ARM/aarch64 opcodes. CallMethod is started but still a lot of work-in-progress.

Thanks for your integration effort.

Main review should be about the introduction of separate floating point registers.
My tests show no regressions with Delphi.
And less errors with FPC.
In fact, the CallMethod assembler for FPC with FPR registers and stack-loop also works 100% with Delphi.

But still much work to be done.

There are some hard to solve (minor) bugs in the 64bit compiler of FPC that have to be circumvented.
As you can see from my fork, there are patches that are non-logical, but still needed for 64 bit FPC.

(My) Timeline:
Full integration of separate floating point registers, without regression for (Delphi) 64 bit, and with your code-review-ok.
Port to FPC Win64.
Port to FPC Linux64.
Port to FPC ARM.
Port to FPC aarch64.

#225 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-16 09:38:14

AOG

@ab.
Do you mean with Delphi, or with FPC or with both ?

#226 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-16 09:17:37

AOG

@ab
Thanks ! I will await your code-approval on further changes !

@edwinsn
For my main project(s), I am using a javascript framework for user interaction: OpenUI5 by SAP. Many mobile clients. So, I only need a REST server.
Server connects directly to Internet.
I am using a T2 micro. Free of charge for 1 year. Cheap after that. With a custom (very lean) Arch Linux x64.
Due to the CPU scaling and bandwidth and price (three year contract) , very hard to beat.
But I am also studying (and using) the Odroid-C2 for server purposes. Aarch64. Very quick. On my private fiber onto the Internet.

#227 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-16 05:58:34

AOG

I have changed SynCrypto.pas to work on Linux 64 bit. Please test (with the MVC server) !
https://github.com/LongDirtyAnimAlf/mORMot

1: No, no MVC in use here.
2: My server(s) are running in a Amazon T2 instance under Linux 64 bit. I must say I am very happy with that !!! Runs smooth, with enormous bandwidth and on demand CPU power.
3: No monitoring at the moment. Still no need for it !

#228 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-15 11:00:44

AOG

No. These are not fixes, but hacks.

But I will adapt (fix) the special branch of mORMot in one way or another to get things running by:
change the assembler into working assembler for FPC 64 bit
or
fallback to pure-pascal

I will do the latter first. And, when more time is available, the former.

#229 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-15 10:02:21

AOG

Ok.
I got it running with these two changes.

Line 1750

{$ifndef DELPHI5OROLDER}

This forces the use of pascal code instead of assembler.
But not all assembly is disabled.

Line 1416

{$ifndef CPUINTEL}

This will disable the swap assembly.

Remember, these are ugly hacks !!!
Just to get your server running on Linux 64.

#230 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-15 08:21:06

AOG

It seems that this is an assembler problem.

You could try to disable the assembler by:

{$define AES_PASCAL}

somewhere around line 1750 in SynCrypto.pas

#231 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-15 04:56:27

AOG

Yep ! All done with fpclazup !!

Concerning cross-compiling.
All my dpr/lpr files start with this:

{$ifdef Linux}
  {$ifdef FPC_CROSSCOMPILING}
    {$ifdef CPUARM}
      //if GUI, then uncomment
      //{$linklib GLESv2}
    {$endif}
    {$linklib libc_nonshared.a}
  {$endif}
{$endif}

#233 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-14 14:45:33

AOG

Ok. Here you go again.

File is named fpclazrtticross.zip.txt
Its a zip file ... so just remove the .txt extension ... its needed for our friendly Windows virus detector.

Again, it is self-contained.
And MUST be installed in c:\fpclazrtticross
And must be started by the startup script inside the fpcup directory (Lazarus_fpclazrtticross).

As a bonus, I have added the possibility to cross-compile.
You can compile for:
win32
win64
linux_x86
linux_x86_64
linux_armhf

Have fun.

ps: the remaining errors you detected are expected: some mORMot debugging work has to be done still !

#234 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-14 09:12:37

AOG

Don't worry about sharing (and disturbing) configurations.
The libraries contain FPC/Lazarus versions that are self-contained.
No paths are changed. No config changed. Just copy files.
That is also why you need to use the startup-script.

Besides, Lazarus is of no importance for mORMot.
mORMot only needs FPC.
And FPC trunk has some very important bug-fixes that are important for mORMot.

#235 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-14 06:17:21

AOG

All right. Here you go.

https://drive.google.com/folderview?id= … sp=sharing

Three files: two archives, one startup script.

The archives contain a complete trunk FPC/Lazarus with RTTI for Linux i386.
No package, just raw files.

They (to be more exact: one of them) MUST be installed (extracted) in /usr/lib/newfpc, due to the fact that they are self-contained.
Lazarus MUST be started with the supplied script, due to the fact that they are self-contained.
(all paths have to be set correct)

Small does not contain the svn archive, big does. So, just start with small.

For mORMot, you only need FPC. But Lazarus is included for convenience.

Good luck ! I hope it will work for you.

Edit: added x64 versions !

#236 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-13 14:25:09

AOG

Well, you need FPC and Lazarus trunk sources to build FPC and Lazarus trunk.
If you can get the latest sources, fpc(laz)up can do the (dirty) patch and build work for you !
But you need the sources.

Can you download from Google Drive ?

#237 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-13 13:51:21

AOG

FPC/Lazarus RTTI distro is just the normal FPC with extra interface RTTI.
It enables the use of interfaces, without the need of generating extra info first with Delphi.
To get the most out of mORMot.

http://svn.freepascal.org/cgi-bin/viewv … rfacertti/

https://github.com/LongDirtyAnimAlf/Rei … rtti.patch

It would be also interesting as to why fpcup does not work for you.
A working fpcup would ease FPC things considerable.

#238 Re: mORMot 1 » Json serialization of a class » 2016-05-13 13:19:13

AOG

Try:

initialization
  TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TStTaxRate), 'taxRate string');
end.

So, replace "word" with "string" .....

#239 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-13 11:47:05

AOG

@edwinsn

Inspired by your post, I am now maintaining a fork of the mORMot, that has the necessary changes for running with FPC on win/linux 64 bit, arm and aarch64.

https://github.com/LongDirtyAnimAlf/mORMot/

Again, not 100% yet, but your reports would be welcome.

The RTTI branch of FPC is worked on.
I have offered to take over.

If you want, I can add a complete trunk FPC/Lazarus RTTI distro into this fork. If I know your dev-system.

#240 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2016-05-12 15:03:52

AOG

Well .... you could press Ab a bit ... ;-)

I did send him a huge patch / mod to get mORMot running on Linux 64bit.
Not yet 100% correct. But enough for a bit of mORMot on Aarch64 ! And that is Linux 64bit !
I am waiting for his code-review before I go on with the last 64 bits and pieces.

#241 Re: mORMot 1 » Is a good idea mix ORM access and SynDBRemote? » 2016-05-12 05:48:48

AOG

@edwinsn

I am using this:

T:=TSQLTableJSON.CreateWithColumnTypes([sftID,sftUTF8Text,sftUTF8Text,sftFloat,sftFloat,sftFloat,sftFloat,sftFloat,sftFloat,sftFloat,sftFloat],'',jsonresult);
LDS.DataSet:=TSynSQLTableDataSet.CreateOwnedTable(Owner,T);

Perhaps it helps.

#242 Re: mORMot 1 » mORMot and ZEOS, RawUTF8 double encoded » 2016-05-09 07:14:39

AOG

@shobits1

Can confirm !

For now, just use something like

fpclazup --installdir="C:/yourdirectory" --fpcURL="trunk" --lazURL="trunk" --verbose  --getfullrepo --fpcPATCH="fpctrunkrtti.patch"

The trunk rtti patch can also be found on the fpclazup github.
This will give you trunk + RTTI needed by mORMot.

#243 Re: mORMot 1 » mORMot and ZEOS, RawUTF8 double encoded » 2016-05-03 18:23:43

AOG

The new interfacertti branch is ok now !
Again a big step forwards to enjoy the full mORMot power with FPC !!

#244 Re: mORMot 1 » mORMot and ZEOS, RawUTF8 double encoded » 2016-05-03 14:38:17

AOG

At the moment, the new interfacertti branch does not compile on my system (Win8.1).
I would welcome reports !

#245 Re: mORMot 1 » mORMot and ZEOS, RawUTF8 double encoded » 2016-05-03 14:22:34

AOG

Steve has updated the interfacertti branch to trunk (rev 33634) !!
Now this change can also be accepeted for this branch:

property SizeIn: {$ifdef FPC}qword{$else}cardinal{$endif} read FStrm.total_in;
property SizeOut: {$ifdef FPC}qword{$else}cardinal{$endif} read FStrm.total_out;

And on some other places, RawByteString can now be used, the same as valid for Delphi.

#246 Re: mORMot 1 » mORMot and ZEOS, RawUTF8 double encoded » 2016-05-03 08:37:08

AOG

Yep !
Because of this bug, I asked for an update of the RTTI branch.
Unfortunately, Steve updated to 33592. So I asked again, for at least 33597 !

#248 Re: mORMot 1 » Error in unstable version » 2016-04-06 12:19:47

AOG

When working with the mORMot, I would advice to always use

{$MODE DELPHI}

Then this "HTTPServer.OnRequest := HTTPServerRequest;" would have worked !

#249 Re: mORMot 1 » ESynCrypto and server method problems with empty body » 2016-04-06 12:11:24

AOG

@hnb
IMHO, it would be better to do

SockString = type RawByteString;

with current FPC trunk.
See: http://synopse.info/forum/viewtopic.php … 840#p19840

#250 Re: mORMot 1 » Error in unstable version » 2016-04-06 12:08:13

AOG

I use this (with FPC):

TMyHttpServer = class(TSQLHttpServer)
  protected
    function Request(Ctxt: THttpServerRequest): cardinal; override;
  end; 

function TMyHttpServer.Request(Ctxt: THttpServerRequest): cardinal;
begin
  .. your code
  result := inherited Request(Ctxt);
  .. your code
end;

Hope it helps.

Board footer

Powered by FluxBB