PDA

View Full Version : Introducing ChainLink: Matlab-style GUI for Qt4 developers



magland
5th February 2007, 21:57
**** Anyone who uses Qt for scientific research, please download and give feedback. I'm looking for some talented co-developers on this exciting project! ****

ChainLink is a Qt4 integrated environment for scientific data analysis and visualization using Matlab/Octave/Scilab compatible syntax. The goal of the software is to allow users to easily incorporate their own scientific C/C++ code, data structures, and Qt Widgets into a user-friendly console and scripting environment.

ChainLink is open and transparent in the sense that the source code for every ChainLink function (whether built-in or user-defined) is available from within the user environment itself! That is, in addition to traditional Matlab-style scripting (i.e. m-files), the user has full (and convenient) access to the C++ code for all console functions. This code can be modified during program execution, and the corresponding plugin library can be recompiled without the need to restart the ChainLink user interface.

For further information, visit:
http://chainlink.sourceforge.net

Documentation is now available:
http://chainlink.sourceforge.net/documentation.html

Download the source (Linux or Windows) from:
http://sourceforge.net/projects/chainlink

The author is looking for additional developers. Please contact:
jmagland@users.sourceforge.net

magland
7th March 2007, 13:30
ChainLink Example:
Here's code (Matlab syntax) that generates plots using Qwt and QwtPlot3D and then organizes them into QTabWidget and QSplitter objects:

function demo_qwidget

t=linspace(-10,10,100);
Y1=sinc(t).^2;
Y2=sin(t);
Y3=sinc(t);

[X,Y]=ndgrid(t,t);
H1=surf(t,t,sin(X).*cos(Y));
title(H1,'Surface Plot');

H2=plot(t,Y1,'k'); title(H2,'Plot 1');
H3=plot(t,Y2,'b'); title(H3,'Plot 2');
H4=plot(t,Y3,'r'); title(H4,'Plot 3');

tab=QTabWidget;
add(tab,H1,'Surface Plot');
add(tab,H2,'Plot 1');
add(tab,H3,'Plot 2');

split=QSplitter('horizontal');
add(split,tab);
add(split,H4);

http://sourceforge.net/projects/chainlink

magland
1st April 2007, 00:20
Has anyone tried out this program?

The latest version is quite user-friendly if it's installed correctly (./build should do it if you have Qt4.2) and you've got some of the optional third party software installed, e.g. Qwt, QwtPlot3D, libQGLViewer, FFTW, GSL, etc.

Newest version has a nice simple IDE for developing plugin modules and some nice functionality for quick plots (see the demo_qwidget in previous post)... and many other possibilities to be discovered...

So try it out I'm looking forward to some constructive feedback...

Regards

elcuco
11th April 2007, 22:40
Hi,

I downloaded 0.7.3 and it fails to compile:



elcuco@pinky:~/src/chainlink$ ./build
cd chainlink_base && make -f Makefile
make[1]: Entering directory `/home/elcuco/src/chainlink/chainlink_base'
rm -f libchainlink_base.so.1.0.0 libchainlink_base.so libchainlink_base.so.1 libchainlink_base.so.1.0
g++ -shared -Wl,-soname,libchainlink_base.so.1 -o libchainlink_base.so.1.0.0 chainlink_base.o chainlink_complex.o chainlink_string.o mda.o -L/usr/lib -lQtGui -L/build/buildd/qt4-x11-4.2.0/lib -L/usr/X11R6/lib -laudio -lXt -lpng -lSM -lICE -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lXext -lX11 -lQtCore -lfontconfig -lz -lm -lglib-2.0 -ldl -lpthread
ln -s libchainlink_base.so.1.0.0 libchainlink_base.so
ln -s libchainlink_base.so.1.0.0 libchainlink_base.so.1
ln -s libchainlink_base.so.1.0.0 libchainlink_base.so.1.0
rm -f /lib/libchainlink_base.so.1.0.0
rm -f /lib/libchainlink_base.so
rm -f /lib/libchainlink_base.so.1
rm -f /lib/libchainlink_base.so.1.0
mv -f libchainlink_base.so.1.0.0 libchainlink_base.so libchainlink_base.so.1 libchainlink_base.so.1.0 /lib/
mv: cannot move `libchainlink_base.so.1.0.0' to `/lib/libchainlink_base.so.1.0.0': Permission denied
mv: cannot move `libchainlink_base.so' to `/lib/libchainlink_base.so': Permission denied
mv: cannot move `libchainlink_base.so.1' to `/lib/libchainlink_base.so.1': Permission denied
mv: cannot move `libchainlink_base.so.1.0' to `/lib/libchainlink_base.so.1.0': Permission denied
make[1]: [/lib/libchainlink_base.so.1.0.0] Error 1 (ignored)
make[1]: Leaving directory `/home/elcuco/src/chainlink/chainlink_base'
cd src && make -f Makefile
make[1]: Entering directory `/home/elcuco/src/chainlink/src'
make[1]: *** No rule to make target `chainlink_base.cpp', needed by `chainlink_base.o'. Stop.
make[1]: Leaving directory `/home/elcuco/src/chainlink/src'
make: *** [sub-src-make_default-ordered] Error 2
./chainlink: line 7: /home/elcuco/src/chainlink/bin/chainlink: No such file or directory


The system is kubuntu 6.10, using Qt4.2.0-ubuntu6.

btw,
installing things on a build target is really bad, specially into /lib (it should be /usr/lib when packaging, and /usr/local/lib on local installations).

magland
12th April 2007, 03:43
Thanks for the feedback... let me try to understand the problem. The contents of the build script is as follows:



#!/bin/bash
echo "#!/bin/bash"> chainlink
export CHAINLINK_DIR=$PWD
echo "export CHAINLINK_DIR=$PWD">> chainlink
cat chainlink_script_file >> chainlink
chmod 755 chainlink

qmake
make
./chainlink -r compile_libraries


The first 4-5 lines just sets the CHAINLINK_DIR environment variable, and then creates a "chainlink" script file used to launch the program (it ensures that the CHAINLINK_DIR variable is set each time chainlink script is run).

The next line makes sure "chainlink" script is executable.

The next two lines are just "qmake" and "make", intending to make an in-place compilation (anything wrong with this?)

Finally I launch the newly created chainlink script with the command to compile the plugin libraries.

I'm not sure why it's trying to install things in "lib".

Regards.

elcuco
13th April 2007, 11:00
The fist compilation was done by "qmake; make". This lead to problems which were described earlier.

I removed the source, and just issued a ./build command and now the project was compiled. The application loads, but it seems I still need some dependencies to build some libraries.

It's a shame there is no documentation about the building process, and not the requirements for building (a build.txt file in the root of the project should be enough).

The application seems HUGE, and kinda funky, it will take me a few days until I know how to use it, since now a simple "plot" command does not work (I am missing a library).

magland
13th April 2007, 14:02
It's a shame there is no documentation about the building process, and not the requirements for building (a build.txt file in the root of the project should be enough).


There is an Install.txt in the root of the project, but I will include a README.txt as well... thanks for the info.



The application seems HUGE, and kinda funky, it will take me a few days until I know how to use it, since now a simple "plot" command does not work (I am missing a library).

Yes it's quite large (but powerful!).

Let me take this opportunity to explain about ChainLink's plugin library system:

The purpose of ChainLink is to link together C++ libraries and Qt projects through a Matlab-style console. This is done through plugin libraries. Each plugin library is defined by a subfolder of the chainlink/lib directory (for example system_libraries/real_library defines the functionality of real numbers, and standard_libraries/qwt_library provides plotting capabilities).

In order to be able to use the standard plugin libraries included with ChainLink (e.g. for plotting etc.) the following third party software is required:

qwt_library --- Qt Widgets for Technical Applications (http://qwt.sourceforge.net)
QGLViewer_library --- libQGLViewer (http://artis.imag.fr/~Gilles.Debunne/QGLViewer/)
qwtplot3d_library --- QwtPlot3D (http://qwtplot3d.sourceforge.net)
fftw_library --- fftw3 (http://www.fftw.org)
linear algebra library --- GNU Scientific library (http://www.gnu.org/software/gsl/)

Download and compile a subset of these 3rd party projects, and then the simplest way to make sure that ChainLink can see them is to manually place the object files (.so*) in the chainlink/3rdparty/lib directory... then try to compile the plugins from within ChainLink.

You can also write your own plugins. See documentation for more info.

Please report problems or suggestions.

Thanks!
J Magland

magland
22nd June 2007, 13:51
I've updated ChainLink significantly since my last post, particularly motivated by the programming contest. I will not go into detail until asked specific questions, but let me just say that the software is really quite powerful in a number of different ways.

In one sense its a Matlab clone. In another sense, its like command-line and scripting access to Qt widgets - both custom and built-in. In the example below, the code in the first screenshot generates the output in the second screenshot (of course the plotting details are found in the "demo1" program).

Check it out : http://chainlink.sourceforge.net

Windows binary is now available. For Linux, you will need to gather some 3rd party libraries, such as Qwt, if you want to see the full functionality.

Also, the QObjectBrowser (see another thread) is built in to chainlink. Just type "QObjectBrowser" from within ChainLink.

http://www.math.upenn.edu/~jfm/chscreen2.jpg

http://www.math.upenn.edu/~jfm/chscreen1.png

mkarlsso
18th December 2007, 19:01
This is really cool. I installed on windows and it worked perfectly. I'm still playing around with the qt interface, but so far it has been very intuitive. I do have a few suggestions on the matlab syntax side of things:

First, if I define a variable a = 1:20, I get a vector from 1 through 20 (as I should). But then, if I try to append-- a(21) = 6 -- I get an error. It seems that there is no dynamic memory realocation? This would be nice to have.

Also, being able to use the 'end' syntax, or something like it is useful, for example a(end) = 20.

Nice work!

magland
19th December 2007, 05:56
Thanks, mkarlsso, I'm glad you find this interesting. Please watch the forums over the coming weeks as I announce the next step in chainlink development. I agree about your syntax comments (efficient dynamic memory allocation for multi-dim arrays is a big issue), but first I've got some other issues I need to work out. In the mean time, you may want to check out development of haiq (http://groups.google.com/group/haiq), which will soon merge with chainlink, in a sense.



This is really cool. I installed on windows and it worked perfectly. I'm still playing around with the qt interface, but so far it has been very intuitive. I do have a few suggestions on the matlab syntax side of things:

First, if I define a variable a = 1:20, I get a vector from 1 through 20 (as I should). But then, if I try to append-- a(21) = 6 -- I get an error. It seems that there is no dynamic memory realocation? This would be nice to have.

Also, being able to use the 'end' syntax, or something like it is useful, for example a(end) = 20.

Nice work!