You are not logged in.
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 !
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.
Did you try with -O0 and/or -O1 optimizations ?
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).
@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.
@ab
Allright !
Latest commit: everything working as expected, with and without interface RTTI !
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
@Chaa
I could help.
But tell me how to generate an exception as you would expect ?
I just tested it with OpenUI5.
Works 100% !
With a 500% speed gain !!
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.
Here is a first try !
Reports are welcome.
https://github.com/LongDirtyAnimAlf/fpc … otBase.zip
Edit:
Forgot to mention, that you HAVE to follow the install rules !!!
https://github.com/LongDirtyAnimAlf/fpc … s/tag/v1.0
@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.
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.
@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.
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.
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) !
@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.
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 !)
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 !
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
Bidirectional sockets now working under FPC 64 bit !
Just a single type change ... but consuming so many hours ... ;-)
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.
@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 !
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.
@ab.
Do you mean with Delphi, or with FPC or with both ?
@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.
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 !
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.
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.
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
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}Look here ...
http://bugs.freepascal.org/view.php?id=30112
I think my answer for this bug will answer yours too !
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 !
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.
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 !
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 ?
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.
Try:
initialization
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TStTaxRate), 'taxRate string');
end.So, replace "word" with "string" .....
@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.
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.
@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.
@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.
The new interfacertti branch is ok now !
Again a big step forwards to enjoy the full mORMot power with FPC !!
At the moment, the new interfacertti branch does not compile on my system (Win8.1).
I would welcome reports !
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.
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 !
I did give it a try ... have a look:
https://github.com/LongDirtyAnimAlf/OpenUI5_mORMot
When working with the mORMot, I would advice to always use
{$MODE DELPHI}Then this "HTTPServer.OnRequest := HTTPServerRequest;" would have worked !
@hnb
IMHO, it would be better to do
SockString = type RawByteString;with current FPC trunk.
See: http://synopse.info/forum/viewtopic.php … 840#p19840
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.