#1 2014-09-30 11:12:11

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Wow! Full FPC support now??!!

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

#2 2014-09-30 11:17:14

cheemeng
Member
From: Malaysia
Registered: 2011-08-09
Posts: 61

Re: Wow! Full FPC support now??!!

Wow this is great news!

Offline

#3 2014-09-30 16:30:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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!
smile

Offline

#4 2014-09-30 17:20:21

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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

#5 2014-09-30 17:31:12

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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 smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#6 2014-10-04 12:31:13

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

ab wrote:

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!
smile

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

#7 2014-10-04 12:48:15

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: Wow! Full FPC support now??!!

Look to the FPC-Bugtracker ... they clicked snooze button sad
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

#8 2014-10-04 13:13:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

Yes method based services do work.

I am a bit afraid the FPC team would delay the fix.
The issue was tagged as "feature request" whereas it is IMHO a big compatibility issue with Delphi 6....

Offline

#9 2014-10-04 14:50:27

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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

#10 2014-10-04 21:04:10

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#11 2014-10-05 02:42:21

ChinaPeng
Member
Registered: 2014-10-02
Posts: 15

Re: Wow! Full FPC support now??!!

Great Job。 Thanks

Offline

#12 2014-10-05 03:04:30

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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

#13 2014-10-05 14:38:04

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

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 smile
Unfortunately, I couldn't compile server RegressionTestsServer.lpr under linux sad 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

#14 2014-10-05 16:17:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

FPC 2.7.1 only is supported by now.

FPC 2.6 will be soon (RTTI did change for strings, e.g.)

Offline

#15 2014-10-13 16:24:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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

#16 2014-10-13 17:50:29

nomorelogic
Member
Registered: 2014-10-13
Posts: 14

Re: Wow! Full FPC support now??!!

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

#17 2014-10-14 08:13:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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

#18 2014-10-15 07:56:13

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: Wow! Full FPC support now??!!

ab wrote:

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

#19 2014-10-15 15:23:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

If you want the "proof by Alf", take a look at https://drive.google.com/file/d/0B96fg3 … sp=sharing

Offline

#20 2014-10-20 14:14:01

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

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
smile
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

#21 2014-10-20 14:28:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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

#22 2014-10-20 15:39:41

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#23 2014-10-20 16:53:26

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

Almost there smile
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:20

Cross 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:677

2014-10-20T14:50:21
Some tests failed... please fix it ASAP!
Press [Enter] to quit

Offline

#24 2014-10-20 17:20:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

@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

#25 2014-10-20 21:42:13

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

@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

#26 2014-10-22 06:57:16

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

AOG wrote:

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

#27 2014-10-22 07:49:12

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#28 2014-10-22 10:09:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

@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

#29 2014-10-22 15:22:40

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

@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

#30 2014-10-22 16:00:00

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#31 2014-10-22 18:31:22

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

Can you confirm that URI parameters are not working as expected on Linux?
f.i.:
  DB.URIPagingParameters.StartIndex := 'START=';
  DB.URIPagingParameters.Results := 'LIMIT=';

Offline

#32 2014-10-22 19:15:08

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

@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

#33 2014-10-23 20:50:04

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

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

#34 2014-10-24 16:08:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

Some latest war stories:

Alf wrote:

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.

smile

Offline

#35 2014-10-24 17:00:56

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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

#36 2014-10-25 06:52:13

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#37 2014-10-25 11:54:13

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

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

#38 2014-10-25 13:22:27

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Wow! Full FPC support now??!!

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

#39 2014-10-26 12:52:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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

#40 2014-10-26 14:02:39

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: Wow! Full FPC support now??!!

ab wrote:

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

#41 2014-10-26 15:39:36

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Wow! Full FPC support now??!!

ab wrote:

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

#42 2014-10-26 16:44:23

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: Wow! Full FPC support now??!!

ab wrote:

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  big_smile

Offline

#43 2014-10-26 16:52:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

warleyalex wrote:

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

#44 2014-10-26 17:02:58

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: Wow! Full FPC support now??!!

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

#45 2014-10-26 18:28:36

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: Wow! Full FPC support now??!!

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

#46 2014-10-26 19:45:09

ttomas
Member
Registered: 2013-03-08
Posts: 135

Re: Wow! Full FPC support now??!!

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

#47 2014-10-26 20:58:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

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

#48 2014-10-26 21:47:59

ttomas
Member
Registered: 2013-03-08
Posts: 135

Re: Wow! Full FPC support now??!!

"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

#49 2014-10-28 06:58:41

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Wow! Full FPC support now??!!

AOG wrote:

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 !

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 smile

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

#50 2014-10-28 07:06:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Wow! Full FPC support now??!!

@edwinsn
Yes, I kept {$MODE DELPHI} defined, otherwise the asm syntax does not compile.

Offline

Board footer

Powered by FluxBB