From 13838bda88b63a2535b5baaf7197006767de4b8e Mon Sep 17 00:00:00 2001
From: "Kevin M. Rosenberg"
Date: Fri, 28 Apr 2000 13:02:42 +0000
Subject: [PATCH] r3: Initial revision
---
AUTHORS | 2 +
COPYING | 340 +++++++++++++
COPYRIGHT | 23 +
ChangeLog | 12 +
INSTALL | 227 +++++++++
Makefile | 378 ++++++++++++++
Makefile.am | 12 +
Makefile.in | 378 ++++++++++++++
NEWS | 4 +
README | 102 ++++
TODO | 7 +
acconfig.h | 56 +++
aclocal.m4 | 142 ++++++
acsite.m4 | 24 +
batch-update | 26 +
cgi-bin/Makefile | 219 +++++++++
cgi-bin/Makefile.am | 2 +
cgi-bin/Makefile.in | 219 +++++++++
cgi-bin/ctsim.cgi | 289 +++++++++++
cgi-bin/ctsim.cgi.in | 289 +++++++++++
config.h.in | 101 ++++
configure.in | 288 +++++++++++
getopt/Makefile | 318 ++++++++++++
getopt/Makefile.am | 4 +
getopt/Makefile.in | 318 ++++++++++++
getopt/getopt.c | 1055 ++++++++++++++++++++++++++++++++++++++++
getopt/getopt.h | 169 +++++++
getopt/getopt1.c | 188 +++++++
html/Makefile | 218 +++++++++
html/Makefile.am | 3 +
html/Makefile.in | 218 +++++++++
html/cstim.html | 0
html/ctsim.html | 77 +++
html/ctsim.html.in | 77 +++
include/Makefile | 224 +++++++++
include/Makefile.am | 1 +
include/Makefile.in | 224 +++++++++
include/ascii.h | 58 +++
include/cio.h | 194 ++++++++
include/ct.h | 75 +++
include/ezplot.h | 311 ++++++++++++
include/getargs.h | 25 +
include/ir.h | 465 ++++++++++++++++++
include/keyboard.h | 79 +++
include/kmath.h | 188 +++++++
include/kstddef.h | 253 ++++++++++
include/pol.h | 92 ++++
include/sdf.h | 318 ++++++++++++
include/sgp.h | 322 ++++++++++++
include/stamp-h | 1 +
include/stamp-h.in | 1 +
install-sh | 251 ++++++++++
man/Makefile | 239 +++++++++
man/Makefile.am | 2 +
man/Makefile.in | 239 +++++++++
man/ctrec.1 | 63 +++
man/phm2rs.1 | 60 +++
man/phm2sdf.1 | 63 +++
man/sdf2img.1 | 63 +++
man/sdfinfo.1 | 55 +++
man/sgp.1 | 183 +++++++
missing | 190 ++++++++
mkinstalldirs | 40 ++
r | 6 +
src/Makefile | 449 +++++++++++++++++
src/Makefile.am | 46 ++
src/Makefile.in | 449 +++++++++++++++++
src/ctrec.c | 436 +++++++++++++++++
src/mpitest.c | 21 +
src/phm2rs.c | 402 +++++++++++++++
src/phm2sdf.c | 470 ++++++++++++++++++
src/rs2sdf.c | 138 ++++++
src/sample-ctrec.sh | 19 +
src/sample-ctrec.sh.in | 19 +
src/sdf-1.c | 123 +++++
src/sdf-2.c | 196 ++++++++
src/sdf2img.c | 700 ++++++++++++++++++++++++++
src/sdfinfo.c | 230 +++++++++
78 files changed, 13768 insertions(+)
create mode 100644 AUTHORS
create mode 100644 COPYING
create mode 100644 COPYRIGHT
create mode 100644 ChangeLog
create mode 100644 INSTALL
create mode 100644 Makefile
create mode 100644 Makefile.am
create mode 100644 Makefile.in
create mode 100644 NEWS
create mode 100644 README
create mode 100644 TODO
create mode 100644 acconfig.h
create mode 100644 aclocal.m4
create mode 100644 acsite.m4
create mode 100755 batch-update
create mode 100644 cgi-bin/Makefile
create mode 100644 cgi-bin/Makefile.am
create mode 100644 cgi-bin/Makefile.in
create mode 100644 cgi-bin/ctsim.cgi
create mode 100755 cgi-bin/ctsim.cgi.in
create mode 100644 config.h.in
create mode 100644 configure.in
create mode 100644 getopt/Makefile
create mode 100644 getopt/Makefile.am
create mode 100644 getopt/Makefile.in
create mode 100644 getopt/getopt.c
create mode 100644 getopt/getopt.h
create mode 100644 getopt/getopt1.c
create mode 100644 html/Makefile
create mode 100644 html/Makefile.am
create mode 100644 html/Makefile.in
create mode 100644 html/cstim.html
create mode 100644 html/ctsim.html
create mode 100644 html/ctsim.html.in
create mode 100644 include/Makefile
create mode 100644 include/Makefile.am
create mode 100644 include/Makefile.in
create mode 100644 include/ascii.h
create mode 100644 include/cio.h
create mode 100644 include/ct.h
create mode 100644 include/ezplot.h
create mode 100644 include/getargs.h
create mode 100644 include/ir.h
create mode 100644 include/keyboard.h
create mode 100644 include/kmath.h
create mode 100644 include/kstddef.h
create mode 100644 include/pol.h
create mode 100644 include/sdf.h
create mode 100644 include/sgp.h
create mode 100644 include/stamp-h
create mode 100644 include/stamp-h.in
create mode 100755 install-sh
create mode 100644 man/Makefile
create mode 100644 man/Makefile.am
create mode 100644 man/Makefile.in
create mode 100644 man/ctrec.1
create mode 100644 man/phm2rs.1
create mode 100644 man/phm2sdf.1
create mode 100644 man/sdf2img.1
create mode 100644 man/sdfinfo.1
create mode 100644 man/sgp.1
create mode 100755 missing
create mode 100755 mkinstalldirs
create mode 100755 r
create mode 100644 src/Makefile
create mode 100644 src/Makefile.am
create mode 100644 src/Makefile.in
create mode 100644 src/ctrec.c
create mode 100644 src/mpitest.c
create mode 100644 src/phm2rs.c
create mode 100644 src/phm2sdf.c
create mode 100644 src/rs2sdf.c
create mode 100644 src/sample-ctrec.sh
create mode 100755 src/sample-ctrec.sh.in
create mode 100644 src/sdf-1.c
create mode 100644 src/sdf-2.c
create mode 100644 src/sdf2img.c
create mode 100644 src/sdfinfo.c
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e3a6c0e
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+Kevin M. Rosenberg, M.D.
+kevin@rosenberg.net
\ No newline at end of file
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 0000000..89fd6da
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,23 @@
+/*****************************************************************************
+** This is part of the CTSim program
+** Copyright (C) 1983-2000 Kevin Rosenberg
+**
+** $Id: COPYRIGHT,v 1.1 2000/04/28 13:02:43 kevin Exp $
+** $Log: COPYRIGHT,v $
+** Revision 1.1 2000/04/28 13:02:43 kevin
+** Initial revision
+**
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License (version 2) as
+** published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+******************************************************************************/
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..8dbe5e5
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,12 @@
+0.5.1 - 4/28/2000
+ Cleaned out library that wasn't being used by CTSim
+
+0.5.0 - 4/27/2000
+ First open source distribution for GNU/Linux
+
+6/1999
+ Converted to GNU/Linux
+ added MPI support via LAM library
+
+1983-84
+ Developed under MS-DOS and IBM EGA graphics
\ No newline at end of file
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..ff8c4a6
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,227 @@
+CTSim Installation
+==================
+
+Additional Libraries Recommended
+--------------------------------
+
+zlib (ftp://ftp.uu.net/pub/archiving/zip/zlib)
+ Tested with version 1.13
+ This library is required for libpng (see below)
+
+libpng (ftp://ftp.uu.net/graphics/png/src)
+ Version 1.0.3 or greater is required. Version 0.89 definitely will
+ not work.
+
+lam (http://www.mpi.nd.edu/lam/)
+ There is support is MPI clustering. I use this code at home for my
+ beowulf cluster.
+
+perl/apache
+ There is support for web-driven CT Simulation. To use this, the
+ --with-cgibin-dir=..., --with-cgibin-url=..., --with-webdata-dir=...,
+ --with-webdata-url=..., and --with-html-dir=... must be set.
+
+CTSim Specific Configuration Help
+---------------------------------
+
+ --enable-verbose-warnings
+ Enable verbose compiler warnings.
+ --enable-debug Turn on debugging
+ --with-png[=PATH] Set path of lib PNG installation
+ --with-lam[=PATH] Set path of LAM MPI
+ --with-cgibin-dir=PATH Set path of CGI binaries directory
+ --with-cgibin-url=PATH Set URL path of CGI binaries
+ --with-webdata-dir=PATH Set path of webdata
+ --with-webdata-url=PATH Set URL path of webdata
+ --with-html-dir=PATH Set directory of html files
+ --with-x use the X Window System
+
+Platforms Supported
+-------------------
+
+Recent development is with GNU/Linux. I have tested compilation on
+FreeBSD v4.0, BSD/OS v3.0, and Solaris v8.
+
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc4cd87
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,378 @@
+# Generated automatically from Makefile.in by configure.
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = .
+prefix = /opt/ctsim
+exec_prefix = ${prefix}
+
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libexecdir = ${exec_prefix}/libexec
+datadir = ${prefix}/share
+sysconfdir = ${prefix}/etc
+sharedstatedir = ${prefix}/com
+localstatedir = ${prefix}/var
+libdir = ${exec_prefix}/lib
+infodir = ${prefix}/info
+mandir = ${prefix}/man
+includedir = ${prefix}/include
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/ctsim
+pkglibdir = $(libdir)/ctsim
+pkgincludedir = $(includedir)/ctsim
+
+top_builddir = .
+
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+AUTOHEADER = autoheader
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+INSTALL_STRIP_FLAG =
+transform = s,x,x,
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = gawk
+CC = gcc
+MAKEINFO = makeinfo
+PACKAGE = ctsim
+RANLIB = ranlib
+VERSION = 0.5.0
+X_BASIC_LIBS = -lXext -lX11
+X_CFLAGS = -I/usr/X11R6/include
+X_EXTRA_LIBS =
+X_LIBS = -L/usr/X11R6/lib
+X_PRE_LIBS = -lSM -lICE
+X_TOOLKIT_LIBS = -lXt
+cgibindir = /opt/apache/cgi-bin
+cgibinurl = /cgi-bin
+cgiprograms = ctsim.cgi
+ctlamlibs = -lir_lam -lezplot -lgraph -lkmath -lk -lcio -lpng -lz
+ctlibs = -lir -lezplot -lgraph -lkmath -lk -lcio -lpng -lz
+htmldata = ctsim.html
+htmldir = /opt/apache/htdocs/ctsim
+lamdir = /opt/lam
+lamprograms = ctrec-lam phm2sdf-lam phm2rs-lam
+my_includes = -I../include -I..
+webdatadir = /opt/apache/htdocs/ctsim/webdata
+webdataurl = /ctsim/webdata
+webenabled = true
+EXTRA_DIRS = getopt
+EXTRA_DIRS =
+
+SUBDIRS = $(EXTRA_DIRS) libcio libk libkmath libgraph libezplot libir src man html cgi-bin include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.h.in \
+configure configure.in install-sh missing mkinstalldirs
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DIST_SUBDIRS = getopt libcio libk libkmath libgraph libezplot libir src \
+man html cgi-bin include
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(DIST_SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile config.h
+all-redirect: all-recursive-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..8619c5b
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,12 @@
+if INCLUDED_GETOPT_LONG
+EXTRA_DIRS=getopt
+else
+EXTRA_DIRS=
+endif
+
+SUBDIRS=$(EXTRA_DIRS) libcio libk libkmath libgraph libezplot libir src man html cgi-bin include
+
+
+
+
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..75a9633
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,378 @@
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+X_BASIC_LIBS = @X_BASIC_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@
+cgibindir = @cgibindir@
+cgibinurl = @cgibinurl@
+cgiprograms = @cgiprograms@
+ctlamlibs = @ctlamlibs@
+ctlibs = @ctlibs@
+htmldata = @htmldata@
+htmldir = @htmldir@
+lamdir = @lamdir@
+lamprograms = @lamprograms@
+my_includes = @my_includes@
+webdatadir = @webdatadir@
+webdataurl = @webdataurl@
+webenabled = @webenabled@
+@INCLUDED_GETOPT_LONG_TRUE@EXTRA_DIRS = getopt
+@INCLUDED_GETOPT_LONG_FALSE@EXTRA_DIRS =
+
+SUBDIRS = $(EXTRA_DIRS) libcio libk libkmath libgraph libezplot libir src man html cgi-bin include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.h.in \
+configure configure.in install-sh missing mkinstalldirs
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DIST_SUBDIRS = getopt libcio libk libkmath libgraph libezplot libir src \
+man html cgi-bin include
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(DIST_SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile config.h
+all-redirect: all-recursive-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..6ecfdb9
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,4 @@
+0.5.0
+April 27, 2000
+
+This is the first open source release
diff --git a/README b/README
new file mode 100644
index 0000000..30cca64
--- /dev/null
+++ b/README
@@ -0,0 +1,102 @@
+COPYRIGHT
+---------
+This program is written by Kevin M. Rosenberg, M.D.
+
+It is covered by the GNU General Public License (GPL) which
+allows copying and modifying this code with restrictions. See the
+file COPYING for complete details.
+
+HISTORY
+------
+
+CTSim development began in 1983 while I was in medical school. It was
+written using Lattice C and MS-DOS. I used assembly language to write
+directly to an IBM EGA video adapter.
+
+In 1999, I ported CTsim to GNU/Linux. In April 2000, the source code
+for CTSim was published on the Internet.
+
+STATUS
+------
+
+The official home for CTsim is http://www.ctsim.org. From this site,
+you can download the CTsim source code and use CTSim online using a
+beowulf cluster.
+
+I would be very pleased to have other developers join me in the
+development of CTSim. Please see the TODO list for the most obvious
+ideas.
+
+In this release, the main issue that needs addressing is the inclusion
+of old graphic library code. This code is not being used by
+CTSim. Compilation warnings will occur in these files. Please ignore
+these warnings. In the next major release of CTSim, there will be
+support for interactive graphics. I just need to write the low-level
+drivers to support X-window rather than IBM EGA hardware.
+
+OVERVIEW
+--------
+
+CTSim simulates the collection of x-rays by a CT scanner. These x-rays
+of objects are called projections or raysums.
+
+Phantom objects are defined. Several built-in phantoms are included,
+as well as an extension to load files of phantom definitions.
+
+CTsim uses .sdf (standard data files) to represent 2-dimensional image
+data. It uses a 32-bit floating-point pixel format. SDF is loosely
+based on a image file format used by the Jet Propulsion Laboratory
+(JPL). It supports multiple text labels per image.
+
+THE PROGRAMS
+------------
+
+phm2sdf - generates an SDF image of a phantom object
+
+phm2rs - Simulates the collection of CT data, or raysums, of a phantom
+object
+
+ctrec - Performs an CT reconstruction, also known as image
+reconstruction from projections. Reads a raysum file and writes a SDF
+file.
+
+rs2sdf - Converts raysum data to a raw sinugram image
+
+sdf2img - Converts an SDF file to a variety of 8-bit image formats
+
+sdfinfo - Show statistics and history labels of SDF files
+
+TYPICAL USAGE
+-------------
+
+When evaluating CT simulation, in general, these steps are followed:
+
+Create a phantom image and viewable image file
+ phm2sdf ...
+ sdf2img ...
+
+Simulate CT data collection and create a viewable image of raw raysums
+ phm2rs ...
+ rs2sdf ...
+ sdf2img ...
+
+Perform CT reconstruction and create viewable image file
+ ctrec ...
+ sdf2img ...
+
+These functions are convert output image to a PNG file performed by
+the CGI program ctsim.cgi which can be installed as described in
+INSTALL file.
+
+There is a sample shell script installed called 'sample-ctrec'.
+
+
+CLOSING
+-------
+
+Please enjoy CTSim. I'd like to hear any feedback
+
+Kevin M. Rosenberg, M.D.
+kevin@rosenberg.net
+
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..d0df363
--- /dev/null
+++ b/TODO
@@ -0,0 +1,7 @@
+Integrate low-level X11 graphics, replace all low-level driver code in
+libgraph. All the high-level graphics routines are in place.
+
+Strip out unused functions from libk and libkmath.
+
+Integrate audio drivers into libcio -- used for the interactive CT display.
+
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000..ce38590
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,56 @@
+/* Define to be the version of the distribution. */
+#undef VERSION
+
+/* Define to signal compiler support for void and void * types */
+#define HAVE_VOID 1
+
+/* Define (if compiling as C++) to signal compiler support for bool type */
+#undef HAVE_BOOL
+
+/* Define under HP/UX to get matherr-related things from math.h. */
+#undef _HPUX_SOURCE
+
+/* Define to signal that fflush(NULL) works: it flushes all outstreams. */
+#undef HAVE_NULL_FLUSH
+
+/* Redundant and unused: Define to signal that fflush(NULL) doesn't work. */
+#undef DONT_HAVE_NULL_FLUSH
+
+/* Define to signal that Motif should be used, if X11 is used */
+#undef USE_MOTIF
+
+/* Define to signal support in libc for the pthread threads library */
+#undef PTHREAD_SUPPORT
+
+/* Define if we have the thread-safe library function ctime_r() */
+#undef HAVE_CTIME_R
+
+/* Define if we have the thread-safe library function localtime_r() */
+#undef HAVE_LOCALTIME_R
+
+/* Define to signal support in libXt/libX11 for multithreading */
+#undef X_THREAD_SUPPORT
+
+/* Define to signal support in -lXext for the DBE X11 protocol extension */
+#undef HAVE_DBE_SUPPORT
+
+/* Define to signal support in -lXext for the MBX X11 protocol extension */
+#undef HAVE_MBX_SUPPORT
+
+/* Define to enable support for the 45 LaserJet fonts in X output */
+#undef USE_LJ_FONTS_IN_X
+
+/* Define to enable support for the 45 LaserJet fonts in PS output */
+#undef USE_LJ_FONTS_IN_PS
+
+/* Define to enable support for the 35 PS fonts in PCL output */
+#undef USE_PS_FONTS_IN_PCL
+
+/* Define if have getopt_long function */
+#undef HAVE_GETOPT_LONG
+
+/* Define if have PNG library */
+#undef HAVE_PNG
+
+/* Define is have interactive graphics */
+#undef HAVE_INTERACTIVE_GRAPHICS
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..8971ab4
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,142 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4a
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+dnl We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
diff --git a/acsite.m4 b/acsite.m4
new file mode 100644
index 0000000..a44ae52
--- /dev/null
+++ b/acsite.m4
@@ -0,0 +1,24 @@
+dnl aclocal.m4 generated automatically by aclocal 1.3
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+#
+# acinclude.m4
+#
+
+dnl Add argument to CFLAGS if using gcc.
+AC_DEFUN(AC_ADD_GCC_CFLAGS,
+[AC_REQUIRE([AC_PROG_CC])
+ if test -n "$GCC"; then
+ CFLAGS="$CFLAGS $1"
+ fi
+ ])
+
diff --git a/batch-update b/batch-update
new file mode 100755
index 0000000..3e9d4f8
--- /dev/null
+++ b/batch-update
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+foreach $file (@ARGV)
+{
+ open(IN,$file) || die "Can not open $file";
+ open(OUT,"> /tmp/upd.$$") || die "Can not open /tmp/upd.$$";
+ while () {
+ if (/Copyright \(C\) 1983-2000 Kevin Rosenberg/) {
+ print OUT '** Copyright (C) 1983-2000 Kevin Rosenberg
+**
+** $Id: batch-update,v 1.1 2000/04/28 13:02:43 kevin Exp $
+** $Log: batch-update,v $
+** Revision 1.1 2000/04/28 13:02:43 kevin
+** Initial revision
+**
+';
+ } else {
+ print OUT $_;
+ }
+ }
+ close(IN);
+ close(OUT);
+ unlink($file);
+ `mv /tmp/upd.$$ $file`;
+}
+
diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile
new file mode 100644
index 0000000..0fd76fa
--- /dev/null
+++ b/cgi-bin/Makefile
@@ -0,0 +1,219 @@
+# Generated automatically from Makefile.in by configure.
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = ..
+prefix = /opt/ctsim
+exec_prefix = ${prefix}
+
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libexecdir = ${exec_prefix}/libexec
+datadir = ${prefix}/share
+sysconfdir = ${prefix}/etc
+sharedstatedir = ${prefix}/com
+localstatedir = ${prefix}/var
+libdir = ${exec_prefix}/lib
+infodir = ${prefix}/info
+mandir = ${prefix}/man
+includedir = ${prefix}/include
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/ctsim
+pkglibdir = $(libdir)/ctsim
+pkgincludedir = $(includedir)/ctsim
+
+top_builddir = ..
+
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+AUTOHEADER = autoheader
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+INSTALL_STRIP_FLAG =
+transform = s,x,x,
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = gawk
+CC = gcc
+MAKEINFO = makeinfo
+PACKAGE = ctsim
+RANLIB = ranlib
+VERSION = 0.5.0
+X_BASIC_LIBS = -lXext -lX11
+X_CFLAGS = -I/usr/X11R6/include
+X_EXTRA_LIBS =
+X_LIBS = -L/usr/X11R6/lib
+X_PRE_LIBS = -lSM -lICE
+X_TOOLKIT_LIBS = -lXt
+cgibindir = /opt/apache/cgi-bin
+cgibinurl = /cgi-bin
+cgiprograms = ctsim.cgi
+ctlamlibs = -lir_lam -lezplot -lgraph -lkmath -lk -lcio -lpng -lz
+ctlibs = -lir -lezplot -lgraph -lkmath -lk -lcio -lpng -lz
+htmldata = ctsim.html
+htmldir = /opt/apache/htdocs/ctsim
+lamdir = /opt/lam
+lamprograms = ctrec-lam phm2sdf-lam phm2rs-lam
+my_includes = -I../include -I..
+webdatadir = /opt/apache/htdocs/ctsim/webdata
+webdataurl = /ctsim/webdata
+webenabled = true
+
+cgibin_SCRIPTS = ctsim.cgi
+EXTRA_SCRIPTS = ctsim.cgi
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = ctsim.cgi
+SCRIPTS = $(cgibin_SCRIPTS)
+
+DIST_COMMON = Makefile.am Makefile.in ctsim.cgi.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu cgi-bin/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+ctsim.cgi: $(top_builddir)/config.status ctsim.cgi.in
+ cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+install-cgibinSCRIPTS: $(cgibin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(cgibindir)
+ @list='$(cgibin_SCRIPTS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ else if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; fi; \
+ done
+
+uninstall-cgibinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ list='$(cgibin_SCRIPTS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ done
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = cgi-bin
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu cgi-bin/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-cgibinSCRIPTS
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-cgibinSCRIPTS
+uninstall: uninstall-am
+all-am: Makefile $(SCRIPTS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(cgibindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: uninstall-cgibinSCRIPTS install-cgibinSCRIPTS tags distdir \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/cgi-bin/Makefile.am b/cgi-bin/Makefile.am
new file mode 100644
index 0000000..d523a20
--- /dev/null
+++ b/cgi-bin/Makefile.am
@@ -0,0 +1,2 @@
+cgibin_SCRIPTS=@cgiprograms@
+EXTRA_SCRIPTS=ctsim.cgi
diff --git a/cgi-bin/Makefile.in b/cgi-bin/Makefile.in
new file mode 100644
index 0000000..4e7f032
--- /dev/null
+++ b/cgi-bin/Makefile.in
@@ -0,0 +1,219 @@
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+AWK = @AWK@
+CC = @CC@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+X_BASIC_LIBS = @X_BASIC_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@
+cgibindir = @cgibindir@
+cgibinurl = @cgibinurl@
+cgiprograms = @cgiprograms@
+ctlamlibs = @ctlamlibs@
+ctlibs = @ctlibs@
+htmldata = @htmldata@
+htmldir = @htmldir@
+lamdir = @lamdir@
+lamprograms = @lamprograms@
+my_includes = @my_includes@
+webdatadir = @webdatadir@
+webdataurl = @webdataurl@
+webenabled = @webenabled@
+
+cgibin_SCRIPTS = @cgiprograms@
+EXTRA_SCRIPTS = ctsim.cgi
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = ctsim.cgi
+SCRIPTS = $(cgibin_SCRIPTS)
+
+DIST_COMMON = Makefile.am Makefile.in ctsim.cgi.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu cgi-bin/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+ctsim.cgi: $(top_builddir)/config.status ctsim.cgi.in
+ cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+install-cgibinSCRIPTS: $(cgibin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(cgibindir)
+ @list='$(cgibin_SCRIPTS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ else if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; fi; \
+ done
+
+uninstall-cgibinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ list='$(cgibin_SCRIPTS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(cgibindir)/`echo $$p|sed '$(transform)'`; \
+ done
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = cgi-bin
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu cgi-bin/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-cgibinSCRIPTS
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-cgibinSCRIPTS
+uninstall: uninstall-am
+all-am: Makefile $(SCRIPTS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(cgibindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: uninstall-cgibinSCRIPTS install-cgibinSCRIPTS tags distdir \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/cgi-bin/ctsim.cgi b/cgi-bin/ctsim.cgi
new file mode 100644
index 0000000..10f7549
--- /dev/null
+++ b/cgi-bin/ctsim.cgi
@@ -0,0 +1,289 @@
+#!/usr/bin/perl
+# Generated automatically from ctsim.cgi.in by configure.
+
+use strict;
+use CGI;
+use File::Basename;
+use Fcntl ':flock';
+
+my $opt_d = 0;
+my $bindir = "/opt/ctsim/bin";
+$ENV{'PATH'} = $bindir;
+
+my $fromhost = $ENV{'REMOTE_HOST'};
+
+my $gmt_start = time();
+my $gmt_end;
+my $execution_time;
+
+my %in;
+CGI::ReadParse(\%in);
+
+# Incoming variables
+# Phantom_Name, Phantom_Nx, Phantom_Ny, Phantom_NSample
+# RS_NDet, RS_NRot, RS_NRay, RS_RotAngle,
+# IR_Nx, IR_Ny, IR_Filter, IR_Filter_Param
+
+my $error = "";
+
+my $Phantom_Name = FilterMetaChars($in{'Phantom_Name'});
+my $Phantom_Nx = FilterToNumber($in{'Phantom_Nx'});
+my $Phantom_Ny = FilterToNumber($in{'Phantom_Ny'});
+my $Phantom_NSample = FilterToNumber($in{'Phantom_NSample'});
+$error .= "Phantom name must not be blank
" if ($Phantom_Name eq "");
+$error .= "Phantom NX and NY must be between 5 and 1024
" if ($Phantom_Nx < 5 || $Phantom_Nx > 1024 || $Phantom_Ny < 5 || $Phantom_Ny > 1024);
+$error .= "Phantom NSample must be between 1 and 10
" if ($Phantom_NSample < 1 || $Phantom_NSample > 10);
+
+my $RS_NDet = FilterToNumber($in{'RS_NDet'});
+my $RS_NRot = FilterToNumber($in{'RS_NRot'});
+my $RS_NRay = FilterToNumber($in{'RS_NRay'});
+my $RS_RotAngle = FilterToNumber($in{'RS_RotAngle'});
+$error .= "Raysum NDet must be between 5 and 1800
" if ($RS_NDet < 5 || $RS_NDet > 1800);
+$error .= "Raysum NRot must be between 5 and 2048
" if ($RS_NRot < 5 || $RS_NRot > 2048);
+$error .= "Raysum RotAngle must be between 0.1 and 2
" if ($RS_RotAngle < 0.1 || $RS_RotAngle > 2);
+
+#my $IR_Nx = FilterToNumber($in{'IR_Nx'});
+#my $IR_Ny = FilterToNumber($in{'IR_Ny'});
+my $IR_Nx = $Phantom_Nx;
+my $IR_Ny = $Phantom_Ny;
+my $IR_Filter = FilterMetaChars($in{'IR_Filter'});
+my $IR_Filter_Param = FilterToNumber($in{'IR_Filter_Param'});
+my $IR_Interp = FilterMetaChars($in{'IR_Interp'});
+my $IR_Backproj = FilterMetaChars($in{'IR_Backproj'});
+
+my $Disp_Min = "auto";
+my $Disp_Max = "auto";
+$Disp_Min = FilterToNumber($in{'Disp_Min'}) if ($in{'Disp_Min'} ne "auto" && $in{'Disp_Min'} ne "");
+$Disp_Max = FilterToNumber($in{'Disp_Max'}) if ($in{'Disp_Max'} ne "auto" && $in{'Disp_Max'} ne "");
+if ($Disp_Min ne 'auto' && ! ($Disp_Min =~ /^[\d\.]+$/)) {
+ $error .= "Display Minimum must be 'auto' or numeric (received '$Disp_Min')
";
+}
+if ($Disp_Max ne 'auto' && ! ($Disp_Max =~ /^[\d\.]+$/)) {
+ $error .= "Display Maximum must be 'auto' or numeric (received '$Disp_Max')
";
+}
+
+my $MPI_Str = FilterMetaChars($in{'MPI'});
+my $MPI = 0;
+$MPI = 1 if ($MPI_Str eq "yes");
+
+$error .= "IR Nx and Ny must be between 5 and 1024
" if ($IR_Nx < 5 || $IR_Nx > 1024 || $IR_Ny < 5 || $IR_Ny > 1024);
+$error .= "IR Filter Parameter must be between 0 and 1
" if ($IR_Filter_Param < 0 || $IR_Filter_Param > 1);
+
+
+my $jobdir = "/opt/apache/htdocs/ctsim/webdata";
+my $tmpid = $$;
+my $auto_window_img = "std0.1";
+my $auto_window_diff = "std1";
+my $auto_window_rs = "full";
+my $datadir = "/opt/apache/htdocs/ctsim/webdata";
+my $url_datadir = "/ctsim/webdata";
+my $logfile = "$jobdir/ctsim.log";
+
+my $result_fname = "$datadir/result-$tmpid.html";
+my $phantom_fname = "$datadir/phantom-$tmpid.sdf";
+my $rs_fname = "$datadir/rs-$tmpid.rs";
+my $ir_fname = "$datadir/ir-$tmpid.sdf";
+my $rs_sdf_fname = "$datadir/rs-$tmpid.sdf";
+my $diff_fname = "$datadir/diff-$tmpid.sdf";
+my $phantom_png = "$datadir/phantom-$tmpid.png";
+my $ir_png = "$datadir/ir-$tmpid.png";
+my $rs_png = "$datadir/rs-$tmpid.png";
+my $diff_png = "$datadir/diff-$tmpid.png";
+
+my $result_url = "$url_datadir/result-$tmpid.html";
+my $phantom_png_url = "$url_datadir/phantom-$tmpid.png";
+my $ir_png_url = "$url_datadir/ir-$tmpid.png";
+my $rs_png_url = "$url_datadir/rs-$tmpid.png";
+my $diff_png_url = "$url_datadir/diff-$tmpid.png";
+
+my $ir_ver = "$bindir/ir";
+my $rs_ver = "$bindir/rs";
+my $gp_ver = "$bindir/gp";
+my $diff_ver = "$bindir/sdf-2";
+$ir_ver = "/opt/lam/bin/mpirun N N $bindir/ir-mpi" if $MPI;
+$rs_ver = "/opt/lam/bin/mpirun N N $bindir/rs-mpi" if $MPI;
+$gp_ver = "/opt/lam/bin/mpirun N N $bindir/gp-mpi" if $MPI;
+
+my $gp_cmd = "$gp_ver $phantom_fname $Phantom_Nx $Phantom_Ny --phantom $Phantom_Name --nsample $Phantom_NSample";
+my $rs_cmd = "$rs_ver $rs_fname $RS_NDet $RS_NRot --phantom $Phantom_Name --nray $RS_NRay --rotangle $RS_RotAngle";
+my $rs_sdf_cmd = "$bindir/rs2sdf $rs_fname $rs_sdf_fname";
+my $ir_cmd = "$ir_ver $rs_fname $ir_fname $IR_Nx $IR_Ny --filter $IR_Filter --filter-param $IR_Filter_Param --interp $IR_Interp --backproj $IR_Backproj";
+my $diff_cmd = "$diff_ver $phantom_fname $ir_fname $diff_fname --comp";
+
+my $window_options = "--auto $auto_window_img";
+if ($Disp_Min ne 'auto') {
+ $window_options .= " --min $Disp_Min";
+}
+if ($Disp_Max ne 'auto') {
+ $window_options .= " --max $Disp_Max";
+}
+
+my $png1_cmd = "$bindir/sdf2img $phantom_fname $phantom_png $window_options --stats --format png";
+my $png2_cmd = "$bindir/sdf2img $ir_fname $ir_png $window_options --stats --format png";
+my $png3_cmd = "$bindir/sdf2img $rs_sdf_fname $rs_png --auto $auto_window_rs --stats --format png";
+my $png4_cmd = "$bindir/sdf2img $diff_fname $diff_png --auto $auto_window_diff --stats --format png";
+
+my $title = "CT Simulation Results";
+
+my $out = head();
+$out .= " $title \n";
+$out .= "\n";
+$out .= "$title
\n";
+
+if ($opt_d) {
+ $out .= "Commands
\n";
+ $out .= "$gp_cmd
\n$rs_cmd
\n$rs_sdf_cmd
\n$ir_cmd
\n$diff_cmd
\n$png1_cmd
\n$png2_cmd
\n" .
+ "$png3_cmd
\n$png4_cmd
\n";
+}
+
+my $cmdout = "";
+if ($error ne "") {
+ $out .= "The following errors were present in your request.
\n";
+ $out .= "Please correct them and try submitting your request again.
\n";
+ $out .= "$error";
+} else {
+ my $gp_out;
+ my $rs_out;
+ my $rs_sdf_out;
+ my $ir_out;
+ my $diff_out;
+ my $png_gp_out;
+ my $png_ir_out;
+ my $png_rs_out;
+ my $png_diff_out;
+ if (1) {
+ $gp_out = `$gp_cmd`;
+ $rs_out .= `$rs_cmd`;
+ $rs_sdf_out .= `$rs_sdf_cmd`;
+ $ir_out .= `$ir_cmd`;
+ $diff_out .= `$diff_cmd`;
+ $png_gp_out .= `$png1_cmd`;
+ $png_ir_out .= `$png2_cmd`;
+ $png_rs_out .= `$png3_cmd`;
+ $png_diff_out .= `$png4_cmd`;
+ } else {
+ $gp_out = `$gp_cmd 2>&1`;
+ $rs_out .= `$rs_cmd 2>&1`;
+ $rs_sdf_out .= `$rs_sdf_cmd 2>&1`;
+ $ir_out .= `$ir_cmd 2>&1`;
+ $diff_out .= `$diff_cmd 2>&1`;
+ $png_gp_out .= `$png1_cmd 2>&1`;
+ $png_ir_out .= `$png2_cmd 2>&1`;
+ $png_rs_out .= `$png3_cmd 2>&1`;
+ $png_diff_out .= `$png4_cmd 2>&1`;
+ }
+ $cmdout = "$gp_cmd\n $gp_out $rs_cmd\n $rs_out $rs_sdf_cmd\n $rs_sdf_out $ir_cmd\n $ir_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_ir_out $png3_cmd\n $png_rs_out $png4_cmd\n $png_diff_out";
+ if (open(LOGFILE,">> $logfile")) {
+ flock(LOGFILE,LOCK_EX);
+ seek(LOGFILE, 0, 2);
+ print LOGFILE "Job $tmpid\n";
+ print LOGFILE $cmdout;
+ print LOGFILE "----------------------------------------------------\n";
+ flock(LOGFILE,LOCK_UN);
+ close(LOGFILE);
+ }
+ $gmt_end = time();
+ $execution_time = $gmt_end - $gmt_start;
+ if ($opt_d)
+ {
+ $out .= "Command Output
$cmdout
\n";
+ }
+ my $png_gp_out_html = $png_gp_out;
+ my $png_ir_out_html = $png_ir_out;
+ my $png_rs_out_html = $png_rs_out;
+ my $png_diff_out_html = $png_diff_out;
+ $png_gp_out_html =~ s/\n/
/gms;
+ $png_ir_out_html =~ s/\n/
/gms;
+ $png_rs_out_html =~ s/\n/
/gms;
+ $png_diff_out_html =~ s/\n/
/gms;
+ $out .= "Phantom Image | Reconstructed Image |
\n";
+ $out .= " $png_gp_out | \n";
+ $out .= " $png_ir_out |
\n";
+ $out .= "Raysum Sinusoid | Phantom/Reconst Error |
\n";
+ $out .= " $png_rs_out | \n";
+ $out .= " $diff_out $png_diff_out |
\n";
+ $out .= "
";
+ $out .= "Execution time: $execution_time seconds\n";
+}
+
+$out .= "
\n";
+$out .= "Return to CT Simulation Designer.
\n";
+$out .= "Return to Med-Info.\n";
+$out .= " ";
+$out .= "\n";
+
+if (open(OUTFILE,"> $result_fname"))
+{
+ flock(OUTFILE,LOCK_EX);
+ print OUTFILE $out;
+ flock(OUTFILE,LOCK_UN);
+ close OUTFILE;
+ print "Location: $result_url\n\n";
+}
+else
+{
+ print "Content-type: text/plain\n\n";
+ print "The simulator was unable to create an result file.\n";
+}
+if (open(JOBFILES,"> $jobdir/$tmpid"))
+{
+ flock(JOBFILES,LOCK_EX);
+ print JOBFILES "gmt_start=$gmt_start\n";
+ print JOBFILES "gmt_end=$gmt_end\n";
+ print JOBFILES "execution_time=$execution_time\n";
+ print JOBFILES "Phantom_Name=$Phantom_Name\n";
+ print JOBFILES "Phantom_Nx=$Phantom_Nx\n";
+ print JOBFILES "Phantom_Ny=$Phantom_Nx\n";
+ print JOBFILES "Phantom_NSample=$Phantom_NSample\n";
+ print JOBFILES "RS_NDet=$RS_NDet\n";
+ print JOBFILES "RS_NRot=$RS_NRot\n";
+ print JOBFILES "RS_NRay=$RS_NRay\n";
+ print JOBFILES "RS_RotAngle=$RS_RotAngle\n";
+ print JOBFILES "IR_Nx=$IR_Nx\n";
+ print JOBFILES "IR_Ny=$IR_Ny\n";
+ print JOBFILES "IR_Interp=$IR_Interp\n";
+ print JOBFILES "IR_Filter=$IR_Filter\n";
+ print JOBFILES "IR_Filter_Param=$IR_Filter_Param\n";
+ print JOBFILES "IR_Backproj=$IR_Backproj\n";
+ print JOBFILES "Disp_Min=$Disp_Min\n";
+ print JOBFILES "Disp_Max=$Disp_Max\n";
+ print JOBFILES "MPI=$MPI\n";
+ print JOBFILES "Files=$result_fname,$phantom_fname,$rs_fname,$ir_fname,$phantom_png,$ir_png,$rs_sdf_fname,$rs_png\n" if ($error eq "");
+ printf JOBFILES "cmdout=$cmdout\n";
+ flock(JOBFILES,LOCK_UN);
+ close JOBFILES;
+}
+
+
+exit;
+
+
+sub internal_error
+{
+ my $out = head();
+ $out .= "Internal error
+ Please notify webmaster\@med-info.com
+
\n";
+$out .= "$title
\n";
+
+if ($opt_d) {
+ $out .= "Commands
\n";
+ $out .= "$gp_cmd
\n$rs_cmd
\n$rs_sdf_cmd
\n$ir_cmd
\n$diff_cmd
\n$png1_cmd
\n$png2_cmd
\n" .
+ "$png3_cmd
\n$png4_cmd
\n";
+}
+
+my $cmdout = "";
+if ($error ne "") {
+ $out .= "The following errors were present in your request.
\n";
+ $out .= "Please correct them and try submitting your request again.
\n";
+ $out .= "$error";
+} else {
+ my $gp_out;
+ my $rs_out;
+ my $rs_sdf_out;
+ my $ir_out;
+ my $diff_out;
+ my $png_gp_out;
+ my $png_ir_out;
+ my $png_rs_out;
+ my $png_diff_out;
+ if (1) {
+ $gp_out = `$gp_cmd`;
+ $rs_out .= `$rs_cmd`;
+ $rs_sdf_out .= `$rs_sdf_cmd`;
+ $ir_out .= `$ir_cmd`;
+ $diff_out .= `$diff_cmd`;
+ $png_gp_out .= `$png1_cmd`;
+ $png_ir_out .= `$png2_cmd`;
+ $png_rs_out .= `$png3_cmd`;
+ $png_diff_out .= `$png4_cmd`;
+ } else {
+ $gp_out = `$gp_cmd 2>&1`;
+ $rs_out .= `$rs_cmd 2>&1`;
+ $rs_sdf_out .= `$rs_sdf_cmd 2>&1`;
+ $ir_out .= `$ir_cmd 2>&1`;
+ $diff_out .= `$diff_cmd 2>&1`;
+ $png_gp_out .= `$png1_cmd 2>&1`;
+ $png_ir_out .= `$png2_cmd 2>&1`;
+ $png_rs_out .= `$png3_cmd 2>&1`;
+ $png_diff_out .= `$png4_cmd 2>&1`;
+ }
+ $cmdout = "$gp_cmd\n $gp_out $rs_cmd\n $rs_out $rs_sdf_cmd\n $rs_sdf_out $ir_cmd\n $ir_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_ir_out $png3_cmd\n $png_rs_out $png4_cmd\n $png_diff_out";
+ if (open(LOGFILE,">> $logfile")) {
+ flock(LOGFILE,LOCK_EX);
+ seek(LOGFILE, 0, 2);
+ print LOGFILE "Job $tmpid\n";
+ print LOGFILE $cmdout;
+ print LOGFILE "----------------------------------------------------\n";
+ flock(LOGFILE,LOCK_UN);
+ close(LOGFILE);
+ }
+ $gmt_end = time();
+ $execution_time = $gmt_end - $gmt_start;
+ if ($opt_d)
+ {
+ $out .= "Command Output
$cmdout
\n";
+ }
+ my $png_gp_out_html = $png_gp_out;
+ my $png_ir_out_html = $png_ir_out;
+ my $png_rs_out_html = $png_rs_out;
+ my $png_diff_out_html = $png_diff_out;
+ $png_gp_out_html =~ s/\n/
/gms;
+ $png_ir_out_html =~ s/\n/
/gms;
+ $png_rs_out_html =~ s/\n/
/gms;
+ $png_diff_out_html =~ s/\n/
/gms;
+ $out .= "Phantom Image | Reconstructed Image |
\n";
+ $out .= " $png_gp_out | \n";
+ $out .= " $png_ir_out |
\n";
+ $out .= "Raysum Sinusoid | Phantom/Reconst Error |
\n";
+ $out .= " $png_rs_out | \n";
+ $out .= " $diff_out $png_diff_out |
\n";
+ $out .= "
";
+ $out .= "Execution time: $execution_time seconds\n";
+}
+
+$out .= "
\n";
+$out .= "Return to CT Simulation Designer.
\n";
+$out .= "Return to Med-Info.\n";
+$out .= "";
+ print $out;
+ exit;
+}
+
+sub head
+{
+# "Content: text/html\n\n";
+}
+
+
+sub FilterMetaChars
+{
+ my $var = pop(@_);
+ $var =~ /^(\w+)$/;
+ $1;
+}
+
+sub FilterToNumber
+{
+ my $var = pop(@_);
+ $var =~ /^(\d*\.*\d*)$/;
+ $1;
+}
diff --git a/cgi-bin/ctsim.cgi.in b/cgi-bin/ctsim.cgi.in
new file mode 100755
index 0000000..c4d9e53
--- /dev/null
+++ b/cgi-bin/ctsim.cgi.in
@@ -0,0 +1,289 @@
+#!/usr/bin/perl
+# @configure_input@
+
+use strict;
+use CGI;
+use File::Basename;
+use Fcntl ':flock';
+
+my $opt_d = 0;
+my $bindir = "@prefix@/bin";
+$ENV{'PATH'} = $bindir;
+
+my $fromhost = $ENV{'REMOTE_HOST'};
+
+my $gmt_start = time();
+my $gmt_end;
+my $execution_time;
+
+my %in;
+CGI::ReadParse(\%in);
+
+# Incoming variables
+# Phantom_Name, Phantom_Nx, Phantom_Ny, Phantom_NSample
+# RS_NDet, RS_NRot, RS_NRay, RS_RotAngle,
+# IR_Nx, IR_Ny, IR_Filter, IR_Filter_Param
+
+my $error = "";
+
+my $Phantom_Name = FilterMetaChars($in{'Phantom_Name'});
+my $Phantom_Nx = FilterToNumber($in{'Phantom_Nx'});
+my $Phantom_Ny = FilterToNumber($in{'Phantom_Ny'});
+my $Phantom_NSample = FilterToNumber($in{'Phantom_NSample'});
+$error .= "Phantom name must not be blank
" if ($Phantom_Name eq "");
+$error .= "Phantom NX and NY must be between 5 and 1024
" if ($Phantom_Nx < 5 || $Phantom_Nx > 1024 || $Phantom_Ny < 5 || $Phantom_Ny > 1024);
+$error .= "Phantom NSample must be between 1 and 10
" if ($Phantom_NSample < 1 || $Phantom_NSample > 10);
+
+my $RS_NDet = FilterToNumber($in{'RS_NDet'});
+my $RS_NRot = FilterToNumber($in{'RS_NRot'});
+my $RS_NRay = FilterToNumber($in{'RS_NRay'});
+my $RS_RotAngle = FilterToNumber($in{'RS_RotAngle'});
+$error .= "Raysum NDet must be between 5 and 1800
" if ($RS_NDet < 5 || $RS_NDet > 1800);
+$error .= "Raysum NRot must be between 5 and 2048
" if ($RS_NRot < 5 || $RS_NRot > 2048);
+$error .= "Raysum RotAngle must be between 0.1 and 2
" if ($RS_RotAngle < 0.1 || $RS_RotAngle > 2);
+
+#my $IR_Nx = FilterToNumber($in{'IR_Nx'});
+#my $IR_Ny = FilterToNumber($in{'IR_Ny'});
+my $IR_Nx = $Phantom_Nx;
+my $IR_Ny = $Phantom_Ny;
+my $IR_Filter = FilterMetaChars($in{'IR_Filter'});
+my $IR_Filter_Param = FilterToNumber($in{'IR_Filter_Param'});
+my $IR_Interp = FilterMetaChars($in{'IR_Interp'});
+my $IR_Backproj = FilterMetaChars($in{'IR_Backproj'});
+
+my $Disp_Min = "auto";
+my $Disp_Max = "auto";
+$Disp_Min = FilterToNumber($in{'Disp_Min'}) if ($in{'Disp_Min'} ne "auto" && $in{'Disp_Min'} ne "");
+$Disp_Max = FilterToNumber($in{'Disp_Max'}) if ($in{'Disp_Max'} ne "auto" && $in{'Disp_Max'} ne "");
+if ($Disp_Min ne 'auto' && ! ($Disp_Min =~ /^[\d\.]+$/)) {
+ $error .= "Display Minimum must be 'auto' or numeric (received '$Disp_Min')
";
+}
+if ($Disp_Max ne 'auto' && ! ($Disp_Max =~ /^[\d\.]+$/)) {
+ $error .= "Display Maximum must be 'auto' or numeric (received '$Disp_Max')
";
+}
+
+my $MPI_Str = FilterMetaChars($in{'MPI'});
+my $MPI = 0;
+$MPI = 1 if ($MPI_Str eq "yes");
+
+$error .= "IR Nx and Ny must be between 5 and 1024
" if ($IR_Nx < 5 || $IR_Nx > 1024 || $IR_Ny < 5 || $IR_Ny > 1024);
+$error .= "IR Filter Parameter must be between 0 and 1
" if ($IR_Filter_Param < 0 || $IR_Filter_Param > 1);
+
+
+my $jobdir = "@webdatadir@";
+my $tmpid = $$;
+my $auto_window_img = "std0.1";
+my $auto_window_diff = "std1";
+my $auto_window_rs = "full";
+my $datadir = "@webdatadir@";
+my $url_datadir = "@webdataurl@";
+my $logfile = "$jobdir/ctsim.log";
+
+my $result_fname = "$datadir/result-$tmpid.html";
+my $phantom_fname = "$datadir/phantom-$tmpid.sdf";
+my $rs_fname = "$datadir/rs-$tmpid.rs";
+my $ir_fname = "$datadir/ir-$tmpid.sdf";
+my $rs_sdf_fname = "$datadir/rs-$tmpid.sdf";
+my $diff_fname = "$datadir/diff-$tmpid.sdf";
+my $phantom_png = "$datadir/phantom-$tmpid.png";
+my $ir_png = "$datadir/ir-$tmpid.png";
+my $rs_png = "$datadir/rs-$tmpid.png";
+my $diff_png = "$datadir/diff-$tmpid.png";
+
+my $result_url = "$url_datadir/result-$tmpid.html";
+my $phantom_png_url = "$url_datadir/phantom-$tmpid.png";
+my $ir_png_url = "$url_datadir/ir-$tmpid.png";
+my $rs_png_url = "$url_datadir/rs-$tmpid.png";
+my $diff_png_url = "$url_datadir/diff-$tmpid.png";
+
+my $ir_ver = "$bindir/ir";
+my $rs_ver = "$bindir/rs";
+my $gp_ver = "$bindir/gp";
+my $diff_ver = "$bindir/sdf-2";
+$ir_ver = "/opt/lam/bin/mpirun N N $bindir/ir-mpi" if $MPI;
+$rs_ver = "/opt/lam/bin/mpirun N N $bindir/rs-mpi" if $MPI;
+$gp_ver = "/opt/lam/bin/mpirun N N $bindir/gp-mpi" if $MPI;
+
+my $gp_cmd = "$gp_ver $phantom_fname $Phantom_Nx $Phantom_Ny --phantom $Phantom_Name --nsample $Phantom_NSample";
+my $rs_cmd = "$rs_ver $rs_fname $RS_NDet $RS_NRot --phantom $Phantom_Name --nray $RS_NRay --rotangle $RS_RotAngle";
+my $rs_sdf_cmd = "$bindir/rs2sdf $rs_fname $rs_sdf_fname";
+my $ir_cmd = "$ir_ver $rs_fname $ir_fname $IR_Nx $IR_Ny --filter $IR_Filter --filter-param $IR_Filter_Param --interp $IR_Interp --backproj $IR_Backproj";
+my $diff_cmd = "$diff_ver $phantom_fname $ir_fname $diff_fname --comp";
+
+my $window_options = "--auto $auto_window_img";
+if ($Disp_Min ne 'auto') {
+ $window_options .= " --min $Disp_Min";
+}
+if ($Disp_Max ne 'auto') {
+ $window_options .= " --max $Disp_Max";
+}
+
+my $png1_cmd = "$bindir/sdf2img $phantom_fname $phantom_png $window_options --stats --format png";
+my $png2_cmd = "$bindir/sdf2img $ir_fname $ir_png $window_options --stats --format png";
+my $png3_cmd = "$bindir/sdf2img $rs_sdf_fname $rs_png --auto $auto_window_rs --stats --format png";
+my $png4_cmd = "$bindir/sdf2img $diff_fname $diff_png --auto $auto_window_diff --stats --format png";
+
+my $title = "CT Simulation Results";
+
+my $out = head();
+$out .= "