You are not logged in.
So I was updating my local copy from the mORMot github repository (using SVN), and noticed just a hour ago, a commit stating this line:
FPC compilation under Linux ! - thanks Alf for the patches
I can't wait for Arnaud to explain in his blog on this Linux support! Does it mean I can write a web server for Linux now? What about Mac (I guess linux support will make it much easier to support Mac which is also from the *NIX family)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Wow this is great news!
Offline
This is a work in progress.
Not stable enough to be used on production yet.
But Alf did a lot of debugging to let the server compile on Linux with FPC.
We can thank him for his work!
We have one big issue with FPC which prevents to use interface based services.
See http://bugs.freepascal.org/view.php?id=26774
But the restful orm works great!
Offline
Hi Arnaud, that's great! Thank you and Alf for the amazing work!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
And I wish at the end somebody familiar with Lazarus can provide a step by step guide on cross-compiling for Linux on Windows - I can always hope, right
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
This is a work in progress.
Not stable enough to be used on production yet.
But Alf did a lot of debugging to let the server compile on Linux with FPC.
We can thank him for his work!We have one big issue with FPC which prevents to use interface based services.
See http://bugs.freepascal.org/view.php?id=26774But the restful orm works great!
Arnaud, I've got one new question, does the method-based interface work?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Look to the FPC-Bugtracker ... they clicked snooze button
Except ab did a complex workaround. Maybe you push the FPC core (which mostly intents to make endless discussions) by writing objections for the severity state, which btw. i do NOT understand.
Offline
Offline
Hi, thanks for the info.
If we write for Linux, do you think using Lazarus in Ubuntu in a VirtualBox is easier, or cross-compile from Windows?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Hello to all,
Yes, we can confirm very (very) good progress with FPC !
Please note that FPC has some limitations (see above).
We hope for and wait for reponse by the FPC development team.
mORMOt with FPC under Windows is nearly 100% complete.
Done with Lazarus and CodeTyphon under Win8.1.
Basic mORMot (ORM) runs also perfect on Linux i386 and Linux ARM (Raspberry Pi / BBB).
I will supply some new patches for Arnaud tomorrow.
These pathes should/could make full blown mORMOt possible on Linux i386 and ARM.
(but I am not yet quite sure about the quality of these patches)
All (cross-)compiling is done under Windows, with CodeTyphon and/or Lazarus.
CodeTyphon makes crosscompiling very easy !
So, I expect mORMot to be FPC ready for Windows in a few days.
Linux i386 and ARM will follow shortly ... some testing has still to be done.
Thanks to Arnaud for his great work and assistance !
Alfred.
Sample 27 on Linux ARM (left) and Linux i386 (right): https://drive.google.com/file/d/0B96fg3 … sp=sharing
Part of self test of mORMot compiled with FPC: https://drive.google.com/file/d/0B96fg3 … sp=sharing
Offline
Great Job。 Thanks
Offline
Hi Alfred, that's so great! amazing!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
That's really nice.
I've installed today Lazarus 1.2.4 with FPC 2.6.4 i386 Linux and
JSONconsole and LCLClient is running very fast under linux
Unfortunately, I couldn't compile server RegressionTestsServer.lpr under linux to test RegressionTests
warley@root:~/proj27$ ./RegressionTests
Cross Platform Units for mORMot
---------------------------------
1. Running "Iso8601DateTime"
30003 tests passed in 00:00:089
2. Running "Base64Encoding"
304 tests passed in 00:00:001
3. Running "JSON"
18628 tests passed in 00:00:542
4. Running "Model"
1013 tests passed in 00:00:040
5. Running "Cryptography"
4 tests passed in 00:00:000
Tests failed: 0 / 49952
Time elapsed: 00:00:675
2014-10-05T11:22:48
Cross Platform Client for mORMot using TSQLRestServerAuthenticationDefault
----------------------------------------------------------------------------
1. Running "Connection"
!!! 1 test(s) failed / 1 [Exception ERestException raised with message "Impossible to connect to localhost:888 server"]
2. Running "ORM"
!!! 1 test(s) failed / 1 [Exception EAccessViolation raised with message "Access violation"]
3. Running "ORMBatch"
!!! 1 test(s) failed / 1 [Exception EAccessViolation raised with message "Access violation"]
4. Running "Services"
!!! 1 test(s) failed / 1 [Exception EServiceException raised with message "TServiceCalculator.Create(nil)"]
5. Running "CleanUp"
1 tests passed in 00:00:000
Tests failed: 4 / 5
Time elapsed: 00:00:005
2014-10-05T11:22:49
Some tests failed... please fix it ASAP!
Press [Enter] to quit
warley@root:~/proj27$
Offline
Still working on it...
See https://drive.google.com/file/d/0B96fg3 … RvVVE/view
Even compiles for Linux / ARM, and (somewhat) running on Raspebery Pi !
Offline
hi all
I recently discovered mORMot, an impressive tool, first of all, great compliments for the work.
I use fpc on linux and I'd like try to experiment this framework. I read the porting will be completed only when troubles with fpc's RTTI will be solved (however ORM and SOA should be testable).
I know works are in progress... it is planned the publication of the script to compile on linux with fpc?
Thanks in advantage
nomorelogic
Offline
You can already retrieve the latest unstable version of the source code tree, and compile it with FPC 2.7.1.
I have CodeTyphon installed, for the debugging on Windows.
You need to have the Synapse library available (which is used for cross-platform HTTP process).
We have one big issue with FPC which prevents to use interface based services, so our SOA process.
See http://bugs.freepascal.org/view.php?id=26774
We just need the RTTI as available in Delphi 6, more than 12 years ago!
Sadly, the FPC team does not seem willing to fix it soon.
But the restful ORM works great, under Linux!
Feel free to post here any question about installation with FPC.
Offline
You can already retrieve the latest unstable version of the source code tree, and compile it with FPC 2.7.1.
......
But the restful ORM works great, under Linux!Feel free to post here any question about installation with FPC.
Fantastic news ! Congratulations !
Offline
If you want the "proof by Alf", take a look at https://drive.google.com/file/d/0B96fg3 … sp=sharing
Offline
I have Lazarus 1.2.4 installed on Ubuntu 12.10 and Free Pascal Compiler version 2.7.1-r1:28746M [2014/10/05] for i386... and project "RegressionTestsServer" successfully built, but unfortunately, I can not test "RegressionTests" yet.
warley@root:~/Dev/lib/SQLite3/Samples/27 - CrossPlatform Clients$ sudo ./RegressionTestsServer
Running Cross-Platform mORMot Server on port 8888
Using TSQLRestServerAuthenticationDefault
You can now run FPC or SMS client applications
This binary has no thread support compiled in.
Recompile the application with a thread-driver in the program uses clause before other units
using thread.
Runtime error 232 at $0805E9E2
$0805E9E2
$0805E6B8
$0805E689
$0812E659
$0812E9A7
$0816F6C3 THTTPSERVER__CREATE, line 2890 of /home/warley/Dev/lib/SynCrtSock.pas
$0811ED90 TSQLHTTPSERVER__CREATE, line 579 of /home/warley/Dev/lib/SQLite3/mORMotHttpServer.pas
$0811EFB5 TSQLHTTPSERVER__CREATE, line 617 of /home/warley/Dev/lib/SQLite3/mORMotHttpServer.pas
$08067CF7 STARTSERVER, line 163 of PeopleServer.pas
$08048B59 main, line 27 of RegressionTestsServer.lpr
-------------------------------
Offline
Note that FPC does not allow to write interface-based services, due to a severe restriction in its RTTI support.
So sample 27 won't work directly.
You should better try to run first TestSQL3.dpr.
Offline
For Linux, you need a few things more !
In your dpr-file:
uses
{$ifdef Linux}
// if you use threads in your application
cthreads,
// widestring manager for Linux, if needed !!
// could also be put in another unit ... but doc states: as early as possible
// cwstring,
{$endif Linux}
Good luck !
Offline
Almost there
warley@root:~/Dev/lib/SQLite3/Samples/27 - CrossPlatform Clients$ ./RegressionTests
Cross Platform Units for mORMot
---------------------------------
1. Running "Iso8601DateTime"
30003 tests passed in 00:00:098
2. Running "Base64Encoding"
304 tests passed in 00:00:000
3. Running "JSON"
18628 tests passed in 00:00:545
4. Running "Model"
1013 tests passed in 00:00:040
5. Running "Cryptography"
4 tests passed in 00:00:001
Tests failed: 0 / 49952
Time elapsed: 00:00:687
2014-10-20T14:50:20Cross Platform Client for mORMot using TSQLRestServerAuthenticationDefault
----------------------------------------------------------------------------
1. Running "Connection"
0 tests passed in 00:00:021
2. Running "ORM"
4549 tests passed in 00:05:351
3. Running "ORMBatch"
4564 tests passed in 00:03:250
4. Running "Services"
!!! 1 test(s) failed / 1 [Exception EServiceException raised with message "Invalid contract "" for TServiceCalculator: expected "B68768749138E69E""]
5. Running "CleanUp"
1 tests passed in 00:00:043
Tests failed: 1 / 9115
Time elapsed: 00:08:6772014-10-20T14:50:21
Some tests failed... please fix it ASAP!
Press [Enter] to quit
Offline
@warleyalex
As we wrote several times, interfaces are NOT supported with FPC, due to an awful FPC limitation/bug/issue.
See http://bugs.freepascal.org/view.php?id=26774
So SOA process would never work until the FPC team fixes the problem..
Offline
@warleyalex
You are there !! As far as you can currently go with mORMot on Linux with FPC !!
Thanks for testing. More feedback is welcome.
You should be able to do anything you like, use nearly all features of mORMot, on Linux.
Except using variant late binding and interface based services.
All other features are available.
We wait for the FPC team to implement the RTTI feature request and solve the variant problem.
For me, I am very happy now being able to run full featured mORMot servers on small Linux hardware. Even ARM.
Offline
For me, I am very happy now being able to run full featured mORMot servers on small Linux hardware. Even ARM.
What's your FPC development setup? Do you develop on Windows or on Linux? If it's the latter, which version of Linux are you using? Last time I tried the latest Ubuntu 14 in a Virtualbox (on a quite decent Windows host), it's slow... I might try Ubuntu 12 later...
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
My FPC development setup is CodeTyphon 5.0 32 bit on Win 8.1 64 bit.
And Lazarus 1.2.4 / FPC 2.6.4 32 bit for checking backwards compatibility of some software.
My deployment setups are:
1)
Arch Linux i386 in a Oracle virtual box on my Win 8.1 pc (just for mORMot).
2)
Arch Linux on a BeagleBone Black (ARMV7).
3)
Arch Linux on a Raspberry Pi (ARMV6).
This is also the reason why I am interested in running mORMot on Linux:
I have many small ARM-clients for data acquisition. Running 24/7. Years.
Billions of numbers (long term battery test measurements).
These store data on a central server, also ARM.
All these running Arch. Most with GUI. Servers just command line.
mORMot allows for datastorage in a very structured and portable manner.
My first steps with mORMot, I used MongoDB, because I like the NoSQL way of storing data.
And MongoDB offers more or less JSON out of the box.
And data is available without any knowledge of relational maps. In most cases, there are no maps !!
All data is just there. At the cost of more storage size. But storage is cheap nowadays.
Everybody can read and understand the data due to this simple storage method.
(nested) fields and dynamic records and arrays can easily be added, removed, changed
But mORMot makes ORM very easy. So I am going to use mORMot for easy and simple ORM.
And mORMot forces me to think better about (structured) data storage.
I have only one (future) concern with mORMot: dynamic arrays.
Again, MongoDB makes dynamic arrays very easy and readable without any prior knowledge.
AFAIR, mORMot uses binary storage when storing dynamic arrays. I hope that, at one time it will be JSON.
But correct me if I am wrong (Ab) !!!
Greetings, Alfred.
Last edited by AOG (2014-10-22 07:49:56)
Offline
@AOG
In current implementation, dynamic arrays are stored as blob in SQL databases, but as BSON when using MongoDB backend.
There is a feature request http://synopse.info/fossil/tktview?name=27353dad25 asking for optional JSON storage (with a "stored AS_JSON" attribute at published property definition).
Offline
@Alfred, Thanks for the info!
CodeTyphon never worked for me - maybe due to my Windows login contains non-ASCII characters - what a bad thing I've done when setting up my PC :<
And I voted that feature request about storing dynamic arrays in JSON in the DB.
Last edited by edwinsn (2014-10-22 15:23:46)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
You can also use plain Lazarus with FPC (2.6.4) !
On Windows, everything works fine (for me, on codepage 1252) !
On Linux, some codepage issues remain.
But the mORMot core runs 100% !
Also, there is no dependency on LCL anymore.
So, you can compile mORMot by command line with just FPC.
Offline
Can you confirm that URI parameters are not working as expected on Linux?
f.i.:
DB.URIPagingParameters.StartIndex := 'START=';
DB.URIPagingParameters.Results := 'LIMIT=';
Offline
@warleyalex
Please help me by providing the most simple (console) program demonstration your problem !
And please add some info about the error: what do you expect errorfree / what is the error.
Offline
I'm Awfully sorry, URI paging parameters is working as expected on Linux! I've created an small video showing paging with linux http://youtu.be/qj2LjIxPm9Q In my experiments, DB.CreateMissingTables is raising an AV on linux, if I comment this line everything seems to be fine.
Offline
Some latest war stories:
Report on your newest patch:
Compiling on Win 8.1:
Delphi 32 : 100%
Delphi 64: 100%
CodeTyphon FPC 2.7.1 for Win 100%
CodeTyphon FPC 2.7.1 for Linux i386 : 100%
Lazarus FPC 2.6.4 for Win : 100%Compiling on Arch Linux i386 VM:
Lazarus 1.2.6 FPC 2.6.4.:
compiling 100%
running: some codepage failures, but that is to be expected !Conclusion:
Overall result: perfect !!!!Alfred.
Offline
That's great! Actually, when compiling and running under Linux, which project file (I guess it's a .lpr file) does Alfred is talking about? I want to try it.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Testing mORMot is done by running the available self test : SynSelfTests.pas
And this is the LPR
program LinuxSynTestFPCLinuxi386;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER
{$APPTYPE CONSOLE}
uses
{$ifdef Linux}
cthreads,
// widestring manager for Linux !!
// could also be put in another unit ... but doc states: as early as possible
cwstring,
{$endif}
mORMotSelfTests;
begin
SQLite3ConsoleTests;
end.
Offline
Thanks Alfred.
I tried compiling the tests with Lazarus 1.2.6 under both Windows 7 and Ubuntu 14.4, I got the same error:
D:\fpclibs\mORMot\Synopse.inc(174,4) Error: Mode switch "DELPHI" not allowed here
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Inside Synopse.inc, do this:
Orig: {$MODE DELPHI} // e.g. for asm syntax
New: {.$MODE DELPHI} // e.g. for asm syntax
So, place a dot in front of this define, to disable it !
Offline
What do you think of using http://gwan.com/ as our HTTP server under Linux?
Sounds like a great and proven system, to be used instead of http.sys (which sounds the best under Windows) and any FastCGI processes (e.g. Apache/NGinx/Lighttpd) under Linux.
Take a look at http://www.wikivs.com/wiki/G-WAN_vs_Nginx
Offline
What do you think of using http://gwan.com/ as our HTTP server under Linux?
Sounds like a great and proven system, to be used instead of http.sys (which sounds the best under Windows) and any FastCGI processes (e.g. Apache/NGinx/Lighttpd) under Linux.
Take a look at http://www.wikivs.com/wiki/G-WAN_vs_Nginx
Sorry to interrupt this thread but could you help to comment on the recommended way to build Linux exetuables ?
For example,:
(1) CodeTyphon on Win to cross-compile ? Or CodeTyphon on Linux ?
(2) Which Linux distro ? 32bit or 64bit OS?
(3) Some screen shots or kickstart video ?
Offline
What do you think of using http://gwan.com/ as our HTTP server under Linux?
I think you could use libuv to build a webserver http://synopse.info/forum/viewtopic.php?pid=7896#p7896
Offline
What do you think of using http://gwan.com/ as our HTTP server under Linux?
Sounds like a great and proven system, to be used instead of http.sys (which sounds the best under Windows) and any FastCGI processes (e.g. Apache/NGinx/Lighttpd) under Linux.
Take a look at http://www.wikivs.com/wiki/G-WAN_vs_Nginx
mORMot already runs on Linux (OSS) under Lazarus/FPC (OSS) G-WAN is closed source, so if I may I would prefer a server technology based also on OSS
Offline
I think you could use libuv to build a webserver http://synopse.info/forum/viewtopic.php?pid=7896#p7896
GWan runs faster, and is much higher level (like http.sys).
Offline
Googling around you can find some posts like this:
https://lonewolfer.wordpress.com/2011/10/11/side-track/
On the comments there is also a reference to another and so on:
http://weblambdazero.blogspot.mx/2011/0 … actor.html
It's been a long time since then but maybe is worth that you take a look at those.
Offline
Bench G-WAN vs. other:
http://joshitech.blogspot.sg/2012/04/pe … ppcms.html
http://nbonvin.wordpress.com/2011/03/24 … er-to-use/
Michal
Last edited by miab3 (2014-10-26 18:51:46)
Offline
AB, G-Wan was active developed in 2012 and performance tests was questionable in the forum. After that forum was closed and deleted. The last version is from Mar 14 2013. It looks nice but don't have marked share. Core is epoll linux kernel lib.
libuv core of node.js is c++ tcp, multithreding, signalig lib, use IOCP in win and epoll on linux. Not easy to use in pascal.
Do you try lNet library?
http://lnet.wordpress.com/
Use IOCP in windows, epoll in linux and Qevent in BSD.
You can test small http server, great performance on linux. Try sample source from svn repo.
Need some work in multithreding and polishing. lthreadevents.pp have some work for worker threads.
Open Source, FreePascal, my vote.
Offline
Yes, GWan seems a dead end..
From the source, lNet library sounds perhaps better than the "pure socket" server available in our SynCrtSock.pas unit (which has a thread pool, and works not badly under Linux).
Since lNet does support IOCP.
If we add (libuv or) epoll to our SynCrtSock.pas server, we may have something much integrated.
Or even FastCGI should be a good idea, in the short term. We would have to finish/test SynFastCGI.pas.
Yes, lNet is worth trying...
Which HTTP server is to be used under Linux?
Offline
"Since lNet does support IOCP"
My mistake. Windows use select, will be nice to implement IOCP/http.sys.
http://bugs.freepascal.org/view.php?id=23475
Offline
Inside Synopse.inc, do this:
Orig: {$MODE DELPHI} // e.g. for asm syntax
New: {.$MODE DELPHI} // e.g. for asm syntaxSo, place a dot in front of this define, to disable it !
Thanks Alfred, so I tried it again, under Windows I got:
D:\fpclibs\mORMot\SynLZO.pas(315,1) Fatal: Syntax error, "BEGIN" expected but "ASM" found
I'm new to FPC and at this stage I'm just trying out compiling mORMot with Lazarus, so I did not dig deeper, so this is a new bie question.
I suggest to include a .LPR project file that can be directly compiled with Lazarus under both Windows and Linux
I appreciate your great work all the same!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline