View Full Version : Porting PV-Wave from SUN OS to Linux

07-19-2010, 10:24 AM
Anyone done this? Is it an easy port or will I have to change a lot of old code to work under Linux? Any guesses of the impact, time wise?

07-20-2010, 03:13 PM
Porting your PV-WAVE application from Solaris to Linux should be pretty easy.
It may start right away without changing anything.

There is one thing to keep in mind though when porting to Linux which is the visual class.
The recommended visual class on Linux is 24-bit TrueColor.
If your application is written for or was using a specific a specific visual class,
such as 8-bit PseudoColor or 24-bit DirectColor then you need to make some changes.
Most Linux systems default to DirectColor and don't allow switching to 8-bit PseudoColor.

To check the current device setting in PV-WAVE call:

INFO, /Device
To change to 24-bit TrueColor in PV-WAVE call:

DEVICE, True=24

If the application was running in 8-bit PseudoColor mode on Solaris system you need
to use WoColorConvert(col_index) wherever you specify a color index.
Refer to the documentation for more information on WoColorConvert.

If the application was running in 24-bit DirectColor mode on Solaris system
the color values should be correct. However, you need to redraw each plot
window whenever the color table changes since this is no longer done
automatically when using TrueColor.

Hope this helps.

08-05-2010, 08:31 AM

My codes from 1993 compile ok under RedHat LINUX 5, but upon the first unformatted read statement <Readu,2,'data.structure'> the "data.structure" is returned populated with garbage values. The same subroutine and data file both compile and return properly populated data structures under Solaris.

What needs updating for execution under Linux? Is the byte count returned for an arbitrary readu different between OS?

Any guidance most appreciated.

08-09-2010, 02:43 PM
Hi Roy,

The byte order is reversed between a Linux and Solaris. While the PV-WAVE code compiles and exectues on both, a raw binary file created on one machine is not going to be read properly on the other machine without code changes that address this reverse byte ordering.

There are binary formats that handle this byte reversal, and different floating point representations, automatically. PV-WAVE uses the XDR format for that purpose; as the format used for PV-WAVE SAVE files, and also as an option to the OPEN commands. However, if the files in your enviroment were created as raw binary files back in 1993, XDR won't help the current situation.

The byte count returned from a read doesn't change between platforms. What you'll need to do is modify your code such that you reverse the bytes, and maybe even the bits within the bytes, immediately after the read. I suggest the you start by looking in the PV-WAVE documentation for the BYTEORDER.

If you need other assitance, such as changing your code so that it can read the files on either a Linux or Solaris machine, please respond to this Forum or contact the PV-WAVE Support team (click here (mailto:support@vni.com)).

Cheers, Don B.