Archive for the ‘ ubuntu ’ Category

Porting QFLR5 for Ubuntu

I have found the XFLR5 X-foil front-end pretty nice as the original X-foil is a bit hard to use. I have been able to run the XFLR5 on Ubuntu with wine, however, it is not without bugs when run under wine. So there is an another alternative – use a native Linux version that does not officially exist yet.

The author of the program has been working on a Qt-version (it is there in the svn). I tried to compile it to Ubuntu. However, because it was using the windows.h min and max, it didn’t compile out of the box today.

I created the following patch (the blogger makes the patch look incorrect, please look at the actual patch file, from here if you want to use it: karoliina-minmaxlinuxpatch.diff ):


karoliina@aurora:~/MyProjects/xflr5/branches/QFLR5$ more karoliina-minmaxlinuxpatch.diff
Index: Objects/Foil.cpp
===================================================================
--- Objects/Foil.cpp (revision 62)
+++ Objects/Foil.cpp (working copy)
@@ -32,6 +32,7 @@
#include
#include
#include
+#include

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -625,7 +626,7 @@
{
//Returns the foil's length

- return max(m_rpExtrados[m_iExt].x, m_rpExtrados[m_iInt].x);
+ return std::max(m_rpExtrados[m_iExt].x, m_rpExtrados[m_iInt].x);
}

double CFoil::GetLowerY(double x)
@@ -881,8 +882,8 @@

for (i=0; i> m_NXPanels[i];
- m_NXPanels[i] = max(1,m_NXPanels[i] );
- m_NXPanels[i] = min(MAXCHORDPANELS, m_NXPanels[i]);
+ m_NXPanels[i] = std::max(1,m_NXPanels[i] );
+ m_NXPanels[i] = std::min(MAXCHORDPANELS, m_NXPanels[i]);
}

for (i=0; i> m_NYPanels[i];
- m_NYPanels[i] = max(1,m_NYPanels[i] );
- m_NYPanels[i] = min(50, m_NYPanels[i]);
+ m_NYPanels[i] = std::max(1,m_NYPanels[i] );
+ m_NYPanels[i] = std::min(50, m_NYPanels[i]);
}
int total = 0;
for (i=0; i

This patch replaces the min and max to std::min and std::max, ensuring the min and max from are being used. This enables the successful compilation on Ubuntu side.

I have a temporary binary (no debian package yet, I need to agree with the developer when it would be ready for packaging), available for Ubuntu Intrepid:

http://www.katix.org/karoliina/packages/QFLR5-ubuntu-intrepid-bin

Porting QFLR5 for Ubuntu

I have found the XFLR5 X-foil front-end pretty nice as the original X-foil is a bit hard to use. I have been able to run the XFLR5 on Ubuntu with wine, however, it is not without bugs when run under wine. So there is an another alternative – use a native Linux version that does not officially exist yet.

The author of the program has been working on a Qt-version (it is there in the svn). I tried to compile it to Ubuntu. However, because it was using the windows.h min and max, it didn’t compile out of the box today.

I created the following patch (the blogger makes the patch look incorrect, please look at the actual patch file, from here if you want to use it: karoliina-minmaxlinuxpatch.diff ):


karoliina@aurora:~/MyProjects/xflr5/branches/QFLR5$ more karoliina-minmaxlinuxpatch.diff
Index: Objects/Foil.cpp
===================================================================
--- Objects/Foil.cpp (revision 62)
+++ Objects/Foil.cpp (working copy)
@@ -32,6 +32,7 @@
#include
#include
#include
+#include

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -625,7 +626,7 @@
{
//Returns the foil's length

- return max(m_rpExtrados[m_iExt].x, m_rpExtrados[m_iInt].x);
+ return std::max(m_rpExtrados[m_iExt].x, m_rpExtrados[m_iInt].x);
}

double CFoil::GetLowerY(double x)
@@ -881,8 +882,8 @@

for (i=0; i> m_NXPanels[i];
- m_NXPanels[i] = max(1,m_NXPanels[i] );
- m_NXPanels[i] = min(MAXCHORDPANELS, m_NXPanels[i]);
+ m_NXPanels[i] = std::max(1,m_NXPanels[i] );
+ m_NXPanels[i] = std::min(MAXCHORDPANELS, m_NXPanels[i]);
}

for (i=0; i> m_NYPanels[i];
- m_NYPanels[i] = max(1,m_NYPanels[i] );
- m_NYPanels[i] = min(50, m_NYPanels[i]);
+ m_NYPanels[i] = std::max(1,m_NYPanels[i] );
+ m_NYPanels[i] = std::min(50, m_NYPanels[i]);
}
int total = 0;
for (i=0; i

This patch replaces the min and max to std::min and std::max, ensuring the min and max from are being used. This enables the successful compilation on Ubuntu side.

I have a temporary binary (no debian package yet, I need to agree with the developer when it would be ready for packaging), available for Ubuntu Intrepid:

http://www.katix.org/karoliina/packages/QFLR5-ubuntu-intrepid-bin

>How to use XFLR5 in Linux

>The XLFR5 is a easier to use interface built on top of the X-foil engine. The X-foil also features wing and whole airplane analysis functions.

The downside of the program has been that is only available for Windows. However, it can be run nowadays in Linux without porting the program to e.g. Qt (which is a big task), so in the mean time before any cross-platform version appears, you can live with the wine in Linux environment:

– Make sure your wine version is a pretty recent one, version greater than 1.0.

I am using the Ubuntu Intrepid version. apt-cache policy wine reports the following:
wine:
Installed: 1.0.1-0ubuntu2
Candidate: 1.0.1-0ubuntu2
Version table:
*** 1.0.1-0ubuntu2 0
500 http://archive.ubuntu.com intrepid/universe Packages
100 /var/lib/dpkg/status
W: Duplicate sources.list entry http://archive.ubuntu.com intrepid/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_intrepid_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com intrepid/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_intrepid_multiverse_binary-i386_Packages)

If you are running the latest stable Ubuntu (Intrepid – 8.10), you can use the Ubuntu supplied one and it will work fine with XFLR5. However, if you are running Ubuntu Hardy or some other distro that does not have the post-1.0 version available, you can install it from winehq repository. For debian based distros like Ubuntu, the instructions can be found from here:

http://www.winehq.org/download/deb

Our living room computer is not yet updated and it is still running the older Hardy. I updated the wine by adding the following line to /etc/apt/sources.list:

deb http://wine.budgetdedicated.com/apt hardy main #WineHQ – Ubuntu 8.04 “Hardy Heron”

Then I did apt-get update and apt-get install wine

The new version of wine got installed and the XFLR5 started working fine.

Download the XFLR5 from here:
http://xflr5.sourceforge.net/xflr5.htm

Go to download page and click download. At the time of writing this, the 4.15 was the latest version.

Download the zip file XFLR5_v415.zip to a new subfolder into your home directory, because the zip file does not contain directories and when you unzip it, if you was in your home directory, you get the package contents directly there which messes up your home with lots of unnecessary files.

Run the XFLR5_Setup.exe by typing on a terminal:

wine ./XFLR5_Setup.exe

The setup runs and finishes.

After this you can notice that a new entry appeared to your Applications menu (in Gnome):
Applications – Wine
Select submenu Programs, and there XFLR5 and on that submenu XFLR5.
XFLR5 should now start successfully.

It works on my computer without problems now.

How to use XFLR5 in Linux

The XLFR5 is a easier to use interface built on top of the X-foil engine. The X-foil also features wing and whole airplane analysis functions.

The downside of the program has been that is only available for Windows. However, it can be run nowadays in Linux without porting the program to e.g. Qt (which is a big task), so in the mean time before any cross-platform version appears, you can live with the wine in Linux environment:

– Make sure your wine version is a pretty recent one, version greater than 1.0.

I am using the Ubuntu Intrepid version. apt-cache policy wine reports the following:
wine:
Installed: 1.0.1-0ubuntu2
Candidate: 1.0.1-0ubuntu2
Version table:
*** 1.0.1-0ubuntu2 0
500 http://archive.ubuntu.com intrepid/universe Packages
100 /var/lib/dpkg/status
W: Duplicate sources.list entry http://archive.ubuntu.com intrepid/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_intrepid_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://archive.ubuntu.com intrepid/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_intrepid_multiverse_binary-i386_Packages)

If you are running the latest stable Ubuntu (Intrepid – 8.10), you can use the Ubuntu supplied one and it will work fine with XFLR5. However, if you are running Ubuntu Hardy or some other distro that does not have the post-1.0 version available, you can install it from winehq repository. For debian based distros like Ubuntu, the instructions can be found from here:

http://www.winehq.org/download/deb

Our living room computer is not yet updated and it is still running the older Hardy. I updated the wine by adding the following line to /etc/apt/sources.list:

deb http://wine.budgetdedicated.com/apt hardy main #WineHQ – Ubuntu 8.04 “Hardy Heron”

Then I did apt-get update and apt-get install wine

The new version of wine got installed and the XFLR5 started working fine.

Download the XFLR5 from here:
http://xflr5.sourceforge.net/xflr5.htm

Go to download page and click download. At the time of writing this, the 4.15 was the latest version.

Download the zip file XFLR5_v415.zip to a new subfolder into your home directory, because the zip file does not contain directories and when you unzip it, if you was in your home directory, you get the package contents directly there which messes up your home with lots of unnecessary files.

Run the XFLR5_Setup.exe by typing on a terminal:

wine ./XFLR5_Setup.exe

The setup runs and finishes.

After this you can notice that a new entry appeared to your Applications menu (in Gnome):
Applications – Wine
Select submenu Programs, and there XFLR5 and on that submenu XFLR5.
XFLR5 should now start successfully.

It works on my computer without problems now.

>Xfoil for Ubuntu Intrepid

>You may find out that Xfoil is not in the Ubuntu repositories. For compiling the source package, you need g77 compiler, but that is not included to Ubuntu Intrepid repositories right now and getting it to work from the source seems to be a lot of trouble. Here is what I found, after some digging, a ready made package which installed on Ubuntu Intrepid fine:

http://giuschet.altervista.org/Ubuntu/

Download the file and install with

sudo dpkg -i xfoil_6.97-1_i386.deb

If some of the dependending libraries are missing, just install those from Intrepid repository and it works fine without problems. Have fun!

For more reading about XFoil, please see:
Xfoil manual
Xfoil tutorial with illustrations
Terrabreak.org XFoil tutorial
More on Xfoil at mh-aerotools

Xfoil for Ubuntu Intrepid

You may find out that Xfoil is not in the Ubuntu repositories. For compiling the source package, you need g77 compiler, but that is not included to Ubuntu Intrepid repositories right now and getting it to work from the source seems to be a lot of trouble. Here is what I found, after some digging, a ready made package which installed on Ubuntu Intrepid fine:

http://giuschet.altervista.org/Ubuntu/

Download the file and install with

sudo dpkg -i xfoil_6.97-1_i386.deb

If some of the dependending libraries are missing, just install those from Intrepid repository and it works fine without problems. Have fun!

For more reading about XFoil, please see:
Xfoil manual
Xfoil tutorial with illustrations
Terrabreak.org XFoil tutorial
More on Xfoil at mh-aerotools

Screenshot of my Thinkpad T61p running Ubuntu Intrepid 8.10