1 (edited by RobertLM78 2012-06-23 20:25:34)

Topic: Graph on Linux

I guess I'll just start by saying how much I love this program and how very useful it has proven to be over the last few years - thank you all for putting it together smile !

I am actually quite surprised that no one has yet ported Graph to Linux.  It doesn't seem like it would be very hard to do.  I wouldn't even mind help with a little how-to on compiling the code in Linux.  While Wine runs Graph reasonably well most of the time, I'd like to see Graph more natively integrated into the system wink.

Let me know what you think and thanks for reading big_smile !!

Re: Graph on Linux

I have been planning to port Graph to Linux for 10 years, but I lack the time. So it would be great if someone else wants to do it.

3 (edited by RobertLM78 2012-06-27 09:26:36)

Re: Graph on Linux

Ivan Johansen wrote:

I have been planning to port Graph to Linux for 10 years, but I lack the time. So it would be great if someone else wants to do it.

I did download the source code for 4.3 a while back.  I'll have to do some learning, but I will give it a shot, if I can get some tips on where to start wink.  I've skimmed the readme, and it looks like you used Borland C++ Builder, but as I said, I need some pointers getting started, as I'm just an amateur/hobbiest (and a big fan of this application, and I'd be willing to spend the time to do this very worth-while task for the benefit of the Linux community big_smile).

Re: Graph on Linux

RobertLM78 asked me to help ,  and i already exchanged a few mails with him about porting graph to linux.

Together we worked out several details already, more info will follow.

5 (edited by RobertLM78 2012-08-03 20:36:28)

Re: Graph on Linux

A short summary of thoughts and information so far:

It looks like porting Graph to Linux will at the same time make it truly multi-platform.  Trying to reuse as much of the original C++ code as possible using Lazarus / Freepascal and filling in missing functions with Qt seems like the easiest path to take.  Adopting the python 2 code for use with python 3 will be best for future development.

Note that both 32-bit and 64-bit versions are in the works for at least the Linux version (anyone with a 64-bit Windows, Mac, or other OS can help get a 64-bit version on those platforms).
-----------------------------------------------------------------------------------------------------------------------------------------------------
Lazarus Information

Supported Architectures
I386
PowerPC
Sparc (initially working, lots of additional work done)
AMD64 (x86-64)
PowerPC64
ARM

Supported Operating Systems
Windows
Linux
OS X
WinCE
Android
Iphone/Ipod

Links
wiki-dot-freepascal-dot-org

6 (edited by RobertLM78 2012-08-03 20:53:30)

Re: Graph on Linux

A comprehensive summary of the discourse about a Graph port. 
---------------------------------------------------------------------------------------------------
Graph uses C++ with Borland CC++buiilder, and also has python code.

external libraries  used :
gsl
dxgettext
boost
pdflib-lite
easyNSE
Borland VCL
win32

--------------------------------

When looking at the external libraries, it became clear quickly that the VCL is a major component for graph.  At one point Borland released a crossplatform version of the VCL called kylix, but development on that was stopped long ago.
A search for linux alternatives resulted in the find of the Lazarus Component Library (LCL) . Lazarus is similar to Borland Delphi (the IDE where the borland VCL originated), and the LCL is their counterpart of the borland VCL.

  • Lazarus uses Freepascal as compiler platform, supports multiple platforms and operating systems (see list and hyperlink in the post above).
         It can also use C++ code, so the choice for a crossplatform environment was made easy.
         Basically the crossplatform graph version will be designed within lazarus, and compiled with freepascal. That means the code will
         be freepascal, with external C++ and Python parts where needed/smart.

  • Gsl, dxgettext and boost are crossplatform libraries, so they don't need replacements.

  • pdflib-lite is available for linux, but it is no longer maintained by the makers.
         Looking for an alternative now.

  • easyNSE: website has been taken down and code appears to be windows only.
          see delphihaters-dot-blogspot-dot-nl/2011/07/early-website-obituaries-mustangpeak-dot-html
          We'll need to find an alternative

  • win32
         windows only
         winelib from the wine project offers similar functionality, but is intended to make compiling windows applications on wine 
         easier.  Also, winelib supports very few platforms. The functionality will need to be replaced from a crossplatfrom library; Qt 4.x 
         is mature and seems best choice for this.

  • Python
         multi-platform, well supported current graph python code requires python 2 , should be migrated to python 3 to be future 
         resistant.

Re: Graph on Linux

Possible PDFLib-lite replacement :
sourceforge.net/projects/powerpdf
PowerPDF is a VCL to create PDF docment visually. Like QuickReport, you can design PDF document easily on Delphi IDE. PowerPDF requires Delphi 2007 or later.

PowerPDF has been ported to lazarus, and is present in the lazarus code and components repository.

I've looked  a bit into combining lazarus and c++ code, and this has some caveats.
Lazarus can use C code directly, but the C++ code needs to be declared as extern "C" and adhere to the C standard.
For C++ code that doesn't use this, a wrapper can be used that translates between lazarus and C++ code.
an example of such a wrapper is the code Lazarus uses to access Qt functions.

Lazarus executable code can be treated as a C library by other programs and doesn't require special wrappers or bindings.

We will have to look at each C++ sourcefile and determine what is better solution :
port the code to lazarus or create a wrapper.
I expect all of the code that uses VCL components or win32 functionality will need to be ported.

For C++ code that uses functions from the external libraries we'll have to check if gcc can link them to the external libraries.
If that's not possible, we can either change the C++ code to become compatible with gcc, or port this code to lazarus.

For those wondering why we just don't use gcc to compile everything : afaik as i know there are no crossplatform versions of the VCL and win32.
Both are proprietary software, and their owners (Codegear and Microsoft) show little interest in crossplatform support.

Re: Graph on Linux

Further discussion of this project has led us to think that Qt Creator will be the IDE of choice.  Previously, concentrating on VCL had led us to Lazarus, but after considering how much of the code is is C++, Qt becomes the clear choice.  This way we can use much more of the existing code, replacing those functions that are not cross-platform with Qt functions.  This avenue should also allow following Windows development easier. 

Note: If successful, this new compilation of Graph will be truly crossplatform and could theoretically replace the current version for Windows (which is why it was believed from the start to be more of a fork than a port).

9 (edited by m255173 2012-10-29 14:35:11)

Re: Graph on Linux

+1 to make GRAPH
run native on LINUX !.

I plan to use UBUNTU & Linux MINT,
once MS stops support for Win XP,
(April 2014? No more MS security updates = XP useless).

An UBUNTU & Linux MINT version of GRAPH,
would be ** fantastic! ** ...

Hope you Linux experts will take on
this tech challenge....

SF99

Re: Graph on Linux

m255173 wrote:

Hope you Linux experts will take on
this tech challenge....

This project is far from being forgotten, only moved to a back burner wink.  Despite getting skilled with Matlab, I still use graph quite frequently big_smile.  Anyway, thanks for the enthusiasm - I'm sure there are others who feel the same way.