|
|
|
|
|
|
|
Jul 15th 2009:
v1.12.2 released.
Apr 20th 2009:
v1.12.1 released.
Dec 22nd 2008:
v1.12.0 released. Merry Christmas!
Oct 13th 2008:
v1.11.1 released. Recommended for all users!
Oct 13th 2008:
SPLASH mailing lists started (as Google Groups).
Sep 3rd 2008:
New SPLASH website launched.
Sep 1st 2008:
Arrived in Melbourne!
Here is a collection of the most common problems with using SPLASH. You may also wish to browse the archives of the splash-users discussion list.
[Basic installation][PGPLOT problems][SPLASH installation] [Dump formats] [Output] [Making movies] [Miscellaneous]There are many commercial Fortran 90/95 compilers available. The only (working) free one is g95, available from http://www.g95.org. Even if you have a commercial compiler, I *highly* recommend compiling SPLASH with g95 because of some nice features like big/little endian changing by environment variables which is extremely useful for reading unformatted data on different machines. g95 is trivial to install as all you need to do is download a binary file.
PGPLOT is a library of Fortran (77) routines for plotting applications. SPLASH utilises the PGPLOT libraries to do the raw plotting. It can be downloaded from http://www.astro.caltech.edu/~tjp/pgplot/. Bear in mind that the PGPLOT libraries are usually already installed in most Astronomy departments.
Mac OS/X: The PGPLOT libraries are available as an unstable fink package (in fink commander you must turn on unstable packages in the preferences). Note that g95 is also available as an unstable package. PGPLOT, g95 and gfortran are also available via macports.
ld: Undefined symbols: _fprintf$LDBLStub _printf$LDBLStub _sprintf$LDBLStubsolution: add -lSystemStubs to the F90FLAGS= in the Makefile
%PGPLOT, Unable to read font file: grfont.dat %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file. Graphics device/type (? to see list, default /NULL): /xw PGPLOT /xw: Couldn't find program "pgxwin_server" in the directory named PGPLOT /xw: in your PGPLOT_DIR environment variable, or in any directory PGPLOT /xw: listed in your PATH environment variable.
solution: Set the PGPLOT_DIR environment variable to the
install directory (e.g. /sw/lib/pgplot). This should solve both problems (although see below for
problems with the font file on 64 bit machines).
In tcsh this means something like
setenv PGPLOT_DIR /sw/lib/pgplotin bash this means
export PGPLOT_DIR='/sw/lib/pgplot'
solution: the PGPLOT font file (grfont.dat) is a binary file which by default comes pre-compiled as a 32-bit binary which may not be read properly in a 64-bit installation. The solution is to re-build the grfont.dat file using the compiler you have used to build PGPLOT by typing, in the PGPLOT directory:
rm grfont.dat make grfont.datassuming of course that you have the permissions to do so (try "sudo rm grfont.dat" and "sudo make grfont.dat").
solution: the PGPLOT font file (grfont.dat, see above question) is an unformatted binary file read when PGPLOT is first called. With gfortran-compiled PGPLOT (and SPLASH), changing the endian-ness in SPLASH (either with a compile time flag or using the GFORTRAN_CONVERT_UNIT environment variable) also affects the grfont.dat file, making it unreadable. One solution is to compile a grfont.dat file for each endian-ness, using the endian-changing flags for gfortran in the PGPLOT makefile (ie. add -fconvert=little-endian or -fconvert=big-endian to the flags in the PGPLOT makefile), then remake the grfont.dat file:
rm grfont.dat make grfont.dat(see above problem also). Then make a copy (e.g. mv grfont.dat grfont.dat_little) and use the environment variable PGPLOT_FONT to point to this file instead of the default grfont.dat
setenv PGPLOT_FONT /mypgplotdir/pgplot/grfont.dat_littlewhenever you are trying to read in little-endian.
solution:"pgxwin_server" is just a program which is run the first time you launch a PGPLOT X-window. So if you can find where it is (e.g. try "locate pgxwin_server"), then you can just launch it (ie. "cd whereveritis; ./pgxwin_server") before running splash, then the /xw plots will work. Better still, you don't even have to be running the pgxwin_server on the same machine as you are plotting on. For example, you can run a local version of pgxwin_server (e.g. from your own PGPLOT installation) which takes the place of a broken version running on a remote machine.
splash: error while loading shared libraries: libpgplot.so: cannot open shared object file: No such file or directory
solution: This means that the shared PGPLOT library file (libpgplot.so) cannot be found, most likely because the directory which contains it is not in the LD_LIBRARY_PATH. To fix this amend the LD_LIBRARY_PATH environment variable appropriately, ie. insert the following line into your .tcshrc file:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/me/pgplot (or wherever you installed pgplot)
or the bash equivalent.
Another possibility is that the shared libraries (ie. libpgplot.so) have not been compiled in your PGPLOT
installation. The simplest solution in this case is to link to the static libraries instead (ie. libpgplot.a). In the Makefile the
easiest way is to modify the SYSTEMFILE variable to include the static libraries, e.g.
SYSTEMFILE = system_unix.f90 /usr/local/lib/pgplot/libpgplot.aor something similar. Note that for static linking you do not need the -lpgplot in the LDFLAGS.
gfortran -O3 -Wall -frecord-marker=4 -c write_pixmap.f90 -o write_pixmap.o
In file write_pixmap.f90:241
real, intent(out), dimension(:,:), allocatable :: datpix
1
Error: ALLOCATABLE attribute conflicts with DUMMY attribute at (1)
In file write_pixmap.f90:338
allocate(datpix(npixx,npixy),stat=ierr)
1
Error: Syntax error in ALLOCATE statement at (1)
In file write_pixmap.f90:238
subroutine readpixmap(datpix,npixx,npixy,dumpfile,label,icol,time,istep,xsec,ie
1
Error: Symbol 'datpix' at (1) has no IMPLICIT type
make: *** [write_pixmap.o] Error 1
The problem is that you are using an old version of gfortran (use
gfortran -vto check the version) which does not compile SPLASH. I recommend downloading a more recent version.
This is to do with a conflict the system calls between g95 and g77 which can happen when compiling with g95 where pgplot has been compiled with g77 (e.g. when downloaded from fink). In g95 the solution is to use the Fortran 2003 system calls COMMAND_ARGUMENT_COUNT() and GET_COMMAND_ARGUMENT(N,ARG), rather than the system dependent IARGC() and GETARG(N,ARG). The system file system_f2003.f90 does this.
If the above fails (e.g. compiling with xlf when PGPLOT is compiled with g77), the last resort is the following: Make a local copy of the libg2c.a file on your system (use `locate libg2c' to find it, but usually in /usr/lib/libg2c.a) - we will call it libg2clocal.a:
cp /usr/lib/libg2c.a .Following that delete all references to getarg and iargc using the ar utility. Delete anything you can think of that seems vaguely similar (getarg_.o iargc_.o).
ar d libg2clocal.a getarg.o ar d libg2clocal.a iargc.oNow compile with the libg2clocal.a in the compile line. If it complains about missing functions in libg2clocal.a (e.g. things which depend on iargc,getarg), delete them too.
limit stacksize unlimitedbefore invoking splash.
Unformatted (binary) dumps of data are designed for fast read/write access, not necessarily portability. The primary difference is usually the ENDIAN-ness of the file, which refers to the byte-ordering of the data. This can vary between machines, being either BIG or LITTLE endian. Most compilers have an option to change the default behaviour (for both read and write) at compile time. In g95 you can set this at runtime by setting the environment variable G95_ENDIAN (to 'BIG' or 'LITTLE'). So for g95-compiled SPLASH set this environment variable to the value corresponding to your dump formats, then run as normal. On other compilers where the option is specified at compile time, you will need to recompile SPLASH with the appropriate flag set.
Some compilers, bizarrely, change things related to unformatted files when compiling Fortran codes in 64-bit as opposed to 32-bit. For example the gfortran compiler changes the length of the header placed by Fortran before and after every record written to the unformatted file from 4 bytes to 8 bytes. The fix for this (in gfortran) is to add -frecord-marker=4 as a compile-time flag which forces the record marker to be 4-bytes in length regardless of the 32/64 bit nature of the system (thanks go to Giuseppe Lodato for working out this one). Other compilers (e.g. g95) change the default integer size to int*8 instead of int*4 which can also mess up compatibility between 32 bit and 64 bit files .
Could it be that the dumps are read in double precision when they are actually single or vice versa?
At the graphics device prompt,
Graphics device/type (? to see list, default /xwin):choose /ps. This will write the output to a file called pgplot.ps in the current directory. Alternatively you can specify the filename explicitly by typing "myfile.ps/ps". The postscript file can be incorporated directly into LaTeX documents. If you *really* want a .eps file ps2epsi should work.
At the graphics device prompt, choose /gif (many older installations of PGPLOT) or /png (most newer installations). This will produce a series of GIF or PNG files called (by default) pgplot.gif pgplot.gif_1, pgplot.gif_2 etc (in the /scripts directory I have included a simple bash script which rename these files to pgplot_0001.gif, pgplot_0002.gif and such like so that they list in the correct order and have the .gif extension). There are then many procedures for getting from these files to a workable animation. The best ways I have found are as follows:
On a Mac:
Use Graphic Converter (in the Applications folder -- for newer versions of OS/X it is no
longer bundled with the operating system -- instead you can
download a shareware version here although the full version is cheap to buy and well worth it). The steps are:
"Typically, a QuickTime file on the Macintosh stores all of the movie parameters and header information in the resource fork, and the actual media (sound + video) in the data fork. To be used on a computer which has a conventional file system, you must first "flatten" the movie on the Macintosh before transferring it. This is what the "Make playable on non-Apple systems" option in the Apple Movie Converter does" (found somewhere on the web).
Alternatively Quicktime Pro (i.e. pay money to upgrade) will import a sequence of images and write in Quicktime format. Presumably the same comments about flattening the movie apply. In both Quicktime Pro and Graphic Converter, a variety of compression options can be chosen which generally trade the quality of the movie against the file size (or occasionally, give you a genuinely small file size without a noticeable drop in quality).
The best compression codec in my experience on the Mac is the H.264 MPEG codec which gives a nice small movie that is still good quality. The best way to reduce the movie size further is to restrict the data rate. Quicktime Pro does a good job of doing this for you.
In Linux:
There are several options. A series of GIF files can be converted into an animated
GIF using GIFmerge. The problem with an animated
GIF is that they are quite slow unless you have *lots* of memory. However it is quite easy to convert an animated GIF into many other movie formats.
In occasional pre-Mac moments of desperation I have resorted to doing
this in W*ndows using the videomach program
which is available as a 30 day demo and can convert the GIF into AVI format (good for
PowerPoint presentations). A better option under linux is to use the
fbm2fli utility (part of the fbm package which can be installed with a linux package manager such as apt-get) which creates a .fli animation from a series of GIFs or PNGs. These can be
played directly using xanim and also by Quicktime.
Another way of getting an animated gif from a series of images under Linux is to use the command line `convert' utility that comes with the ImageMagick package. As an example (kindly provided by John Mansour), use
convert -delay 10 -loop 0 pgplot.gif_* animatedgif.gifwhere delay gives a delay in ms between frames, and loop determines whether the animated gif will loop (0= infinite, 1=1 loop, etc). convert should also be able to convert from animated gif to mpg etc. However, due to pgplot file naming convention, you may have to use (depending on how many frames there are):
convert -delay 10 -loop 0 pgplot.gif pgplot.gif_? pgplot.gif_?? pgplot.gif_??? animatedgif.gif
It is also possible to produce MPEG movies direct from images in Linux. The options are (Thanks to Florian Buerzle):
convert -delay 10 -loop 0 pgplot.gif pgplot.gif_? pgplot.gif_?? pgplot.gif_??? animation.mpgHowever, this is most likely NOT to work if one has an older version of ImageMagick installed (especially true for Ubuntu Intrepid 8.10, the current release). Due to some reason, ImageMagick does rely on third party software, provided by MPEG Software Simulation Group and available for download on ImageMagick's FTP server here.
This has to be compiled via 'make' and the file mpeg2encode (not to be confused with mpeg2enc which is of different origin) must be copied into a folder somewhere in the PATH.
While this procedure works easily, there are shortcomings:
This is a command line tool and not as convenient to use as ImageMagick (there is also no proper release, or only once in a blue moon...one has to use the version from the SVN trunk). However, there is a frontend called Vive, maintained at sourceforge (which I haven't managed to install myself, due to dependency problems...but maybe someone is more lucky).
On Debian-based distributions (on RedHat, things may be similar, but I don't know), the ffmpeg installed with apt-get won't do the job, the "unstripped" versions of the libraries libavcodec, etc. need to be installed. For Ubuntu Intrepid the following worked (should also be fine for other Debian based distros):
sudo apt-get purge ffmpeg
sudo apt-get update
sudo apt-get install libavcodec-unstripped-51 libavdevice-unstripped-52 libavformat-unstripped-52
libavutil-unstripped-49 libpostproc-unstripped-51 libswscale-unstripped-0 ffmpeg
Then, ffmpeg can be used according to the documentation.
For example, the following works for my plots
ffmpeg -i myplot_%04d.png -r 25 -b 2048k animation.mp4but that requires some experimentation with the parameter settings. The image files' names have to be strictly in numerical order for this method to work properly, and the %04d is used similar to the formatted output in C's printf function. But see the very nice page here.
mencoder is a utility which comes with the famous MPlayer. As mencode is also based on ffmpeg, the requirements mentioned above should also apply here. An example command line for mencoder (contributed by Sander Valcke) is given by
mencoder "mf://*.png" -mf fps=5 -o output.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vbitrate=3000:mbd=1where the frame rate (-fps=5) can be adjusted as required.
Send me an image (any sensible format will do) containing a colour bar using the scheme you want to rip off and I will add it into splash.
Urrmmm... it has SPH in it and it sounded good. I thought of:
"Some Pretty Little Application for Smoothed (particle) Hydrodynamics"
"Smoothed Particles Look Amazingly Stunning Here"
"So People Love Analysing Simulations of Hydrodynamics"
"Simulating Particles Like A Superfast Horse"
Your suggestions on a postcard please.
At the moment I am accepting donations in the form of citations to the SPLASH paper (Price, 2007, PASA, 24, 159-173). Just like sending cash, only... not. This may change if I am flooded with requests from people wanting to send large sums of money.