NAMOT Pre-Release 2.2.0-pre4 In OSX 10.8 (Maybe Older Versions)

A recent visit to the College of Nanoscale Science and Engineering (CNSE) at SUNY Albany inspired a few new DNA ideas that I decided would be greatly simplified by having NAMOT available again for design. Having failed at the base install of the NAMOT 2 version and, unfortunately, not having NAMOT available in Fink for a simple installation, the solution became to build the pre-release from scratch. Ignoring the many errors one encounters while walking through an OSX/Xcode/Fink/X11 bootstrap, the final procedure worked well and without major problem. As usual, the error messages at varied steps are provided below because, I assume, those messages are what you're searching for when you find your way here.

0. Required Installations

You'll need the following installed for this particular build. I believe XCode is the only thing that you'll have to pay for (if you don't already have it. I seem to remember paying $5 through the App Store).

1. XCode

The OSX Developer Suite – developer.apple.com/xcode

2. XQuartz

An OSX (X.Org) X Window System – xquartz.macosforge.org/landing/

3. Fink

An OSX port program for a host of Unix codes and libraries – www.finkproject.org

3a. GSL

The GNU Scientific (C and C++) Libraries – www.gnu.org/software/gsl. This will be installed with Fink.

3b. LessTif

An OSF/Motif clone (made available for OSX through Fink) – lesstif.sourceforge.net. This will be installed with Fink.

4. NAMOT2.2.0-pre4

The -pre4 is currently available (from 2003) from sourceforge.net/projects/namot/files/. I did not try -pre3 and had no luck with the official 2 release.

And, with that…

1. XCode

Blindly follow the install procedure. Several steps below deal with working around the default install locations (specifically, /sw).

2. XQuartz

If you don't have XQuartz installed, you're configure step…

cd Downloads
cd namot-2.2.0-pre4
./configure 

will produce the following error…

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
creating libtool
checking for X... no
checking for main in -lX11... no
NAMOT requires Xwindows

Blindly follow the XQuartz install process. After the installations, you'll receive the same error as above. The –x-libraries= and –x-includes= additions to configure below direct the script to the proper libraries and includes.

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

Hopefully, you'll find yourself past the first install problem and onto the second problem.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
creating libtool
checking for X... libraries /usr/X11/lib/, headers /usrX11/include/
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... no
NAMOT requires GNU Scientific Library

3. Fink

The next two codes that need to be installed are the GNU Scientific Libraries and LessTif, both of which are much easier to install using Fink. It is generally useful for many other codes as well, so a good program for any computational chemist to have on hand. The install should be non-problematic despite having to build it from source in 10.6 – 10.8 (as of January 2013). If you build with all the default settings, you'll have no trouble after.

cd Downloads
cd fink-0.34.4
./bootstrap 

I chose the default settings throughout.

Fink must be installed and run with superuser (root) privileges. Fink can automatically try to become root when it's run from a user account. Since you're currently running this script as a normal user, the method you choose will also be used immediately for this script. Available methods:

(1)	Use sudo
(2)	Use su
(3)	None, fink must be run as root

Choose a method: [1] 

...

You should now have a working Fink installation in '/sw'. You still need package descriptions if you want to compile packages yourself. You can get them by running either of the commands: 'fink selfupdate-rsync', to update via rsync (generally preferred); or 'fink selfupdate-cvs', to update via CVS (more likely to work through a firewall).

Run '. /sw/bin/init.sh' to set up this terminal session environment to use Fink. To make the software installed by Fink available in all of your future terminal shells, add '. /sw/bin/init.sh' to the init script '.profile' or '.bash_profile' in your home directory. The program /sw/bin/pathsetup.sh can help with this. Enjoy.

Then you run the final step in Fink below:

/sw/bin/pathsetup.sh

Which will produce the following two pop-ups notifying you of shell modifications.

3a. GSL

With the install of Fink, you need to install GSL and LessTif. If you try to install either immediately after installation…

fink install gsl

…you'll receive the following error:

Password:
Scanning package description files..........
Information about 305 packages read in 0 seconds.
no package found for "gsl"
Failed: no package found for specification 'gsl'!

Required after the installation is a fink selfupdate.

fink selfupdate

As usual, follow the default settings…

fink needs you to choose a SelfUpdateMethod.

(1)	cvs
(2)	Stick to point releases
(3)	rsync

Choose an update method [3] 
/usr/bin/find /sw/fink -name CVS -type d -print0 | xargs -0 /bin/rm -rf
fink is setting your default update method to rsync
...
Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/base/base-files_1.9.13-1_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/base/fink-mirrors_0.34.4.1-1_darwin-i386.deb

Which then leads to a successful GSL install.

fink install gsl

Producing the following output…

Information about 12051 packages read in 1 seconds.
The package 'gsl' will be built and installed.
Reading build dependency for gsl-1.15-1...
Reading dependency for gsl-1.15-1...
Reading runtime dependency for gsl-1.15-1...
Reading dependency for gsl-shlibs-1.15-1...
...
Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/sci/gsl-shlibs_1.15-1_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/sci/gsl_1.15-1_darwin-i386.deb

Attempting a fresh build after the GSL step…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

…then still produces the following error:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... no
NAMOT requires GNU Scientific Library

As mentioned above, there are a few redirects that need to be made after the XCode / Fink install to put libraries and includes where, in this case, NAMOT expects them. To perform this task, we'll be using symbolic links.

sudo ln -s /sw/include/gsl /usr/include/
sudo ln -s /sw/lib/libgsl* /usr/lib

Now attempting a build…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include

Gets you past the GSL issue.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... yes
checking for main in -lgsl... yes
checking for XShmCreateImage in -lXext... yes
checking for main in -lXt... yes
checking for main in -lXm... no
NAMOT requires Motif...try LessTif(http://www.lesstif.org)

3b. LessTif

The LessTif symbolic links work the same as the GSL symbolic links. This fink install may take a while.

fink install lesstif

Output below…

Information about 12051 packages read in 1 seconds.
The package 'lesstif' will be built and installed.
Reading build dependency for lesstif-0.95.2-4...
Reading dependency for lesstif-0.95.2-4...
Reading runtime dependency for lesstif-0.95.2-4...
...
Setting up lesstif (0.95.2-4) ...
Clearing dependency_libs of .la files being installed

Updating the list of locally available binary packages.
Scanning dists/stable/main/binary-darwin-i386
New package: dists/stable/main/binary-darwin-i386/x11/app-defaults_20010814-12_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif-bin_0.95.2-4_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif-shlibs_0.95.2-4_darwin-i386.deb
New package: dists/stable/main/binary-darwin-i386/x11/lesstif_0.95.2-4_darwin-i386.deb
./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

But, unfortunately, the LessTif libraries are not in the expected locations.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
checking for IceConnectionNumber in -lICE... yes
checking for main in -lX11... yes
checking for main in -lgslcblas... yes
checking for main in -lgsl... yes
checking for XShmCreateImage in -lXext... yes
checking for main in -lXt... yes
checking for main in -lXm... no
NAMOT requires Motif...try LessTif(http://www.lesstif.org)

So we add the symbolic links…

sudo ln -s /sw/lib/libXm.* /usr/lib
sudo ln -s /sw/include/Xm /usr/include

Which, finally, runs configure…

./configure --x-libraries=/usr/X11/lib/ --x-includes=/usrX11/include/

…with no errors.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
...
config.status: creating docs/demos/curve/Makefile
config.status: creating docs/demos/dit/Makefile
config.status: creating docs/demos/Makefile
config.status: creating config.h
config.status: executing depfiles commands

NOTE: The make step with Python 2.6 produces the following error below. I did not diagnose this beyond the failure to build under 10.6. OSX 10.8 comes with Python 2.7, which did not produce this problem (I'm assuming this is the origin of the problem).

make

…will produce the following error at the pngwriter.c step.

/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -DLIB_HOME="\"/usr/local/share/namot\"" -DHELP_FILE_DIR="\"/usr/local/share/namot\"" -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -g -O2 -c -o _pynamot_la-pngwriter.lo `test -f 'pngwriter.c' || echo './'`pngwriter.c
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLIB_HOME=\"/usr/local/share/namot\" -DHELP_FILE_DIR=\"/usr/local/share/namot\" -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -g -O2 -c pngwriter.c -MT _pynamot_la-pngwriter.lo -MD -MP -MF .deps/_pynamot_la-pngwriter.TPlo  -fno-common -DPIC -o _pynamot_la-pngwriter.lo
pngwriter.c: In function 'dump_PNG':
pngwriter.c:28: error: 'png_structp' undeclared (first use in this function)
pngwriter.c:28: error: (Each undeclared identifier is reported only once
pngwriter.c:28: error: for each function it appears in.)
pngwriter.c:28: error: expected ';' before 'png_ptr'
pngwriter.c:29: error: 'png_infop' undeclared (first use in this function)
pngwriter.c:29: error: expected ';' before 'info_ptr'
pngwriter.c:30: error: 'png_byte' undeclared (first use in this function)
pngwriter.c:30: error: 'row_pointers' undeclared (first use in this function)
pngwriter.c:30: error: expected expression before ')' token
pngwriter.c:31: error: 'png_text' undeclared (first use in this function)
pngwriter.c:31: error: expected ';' before 'text_ptr'
pngwriter.c:39: warning: incompatible implicit declaration of built-in function 'memset'
pngwriter.c:39: error: 'text_ptr' undeclared (first use in this function)
pngwriter.c:47: error: 'png_ptr' undeclared (first use in this function)
pngwriter.c:47: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
pngwriter.c:48: error: 'png_voidp' undeclared (first use in this function)
pngwriter.c:57: error: 'info_ptr' undeclared (first use in this function)
pngwriter.c:60: error: 'png_infopp' undeclared (first use in this function)
pngwriter.c:82: error: 'PNG_COLOR_TYPE_RGB' undeclared (first use in this function)
pngwriter.c:82: error: 'PNG_INTERLACE_ADAM7' undeclared (first use in this function)
pngwriter.c:83: error: 'PNG_COMPRESSION_TYPE_DEFAULT' undeclared (first use in this function)
pngwriter.c:83: error: 'PNG_FILTER_TYPE_DEFAULT' undeclared (first use in this function)
pngwriter.c:85: error: 'PNG_sRGB_INTENT_ABSOLUTE' undeclared (first use in this function)
pngwriter.c:90: error: 'PNG_TEXT_COMPRESSION_NONE' undeclared (first use in this function)
pngwriter.c:93: error: 'PNG_TEXT_COMPRESSION_zTXt' undeclared (first use in this function)
pngwriter.c:104: error: expected expression before ')' token
make[2]: *** [_pynamot_la-pngwriter.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The build on 10.8 continues as below, with a few warnings about the symbolic link usage that do not seem to affect the program usability (or continued build).

make

Results below…

make  all-recursive
Making all in src
source='namot_wrap.c' object='_pynamot_la-namot_wrap.lo' libtool=yes \
	depfile='.deps/_pynamot_la-namot_wrap.Plo' tmpdepfile='.deps/_pynamot_la-namot_wrap.TPlo' \
	depmode=gcc3 /bin/sh ../depcomp \
	/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -DLIB_HOME="\"/usr/local/share/namot\"" -DHELP_FILE_DIR="\"/usr/local/share/namot\"" -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -g -O2 -c -o _pynamot_la-namot_wrap.lo `test -f 'namot_wrap.c' || echo './'`namot_wrap.c

...

*** Warning: linker path does not have real file for library -lXm.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libXm and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libXm.la

*** Warning: linker path does not have real file for library -lgsl.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libgsl and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libgsl.la

*** Warning: linker path does not have real file for library -lgslcblas.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libgslcblas and none of the candidates passed a file format test
*** using a file magic. Last file checked: /sw/lib/libgslcblas.la

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module _pynamot.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.

...

Making all in libs
make[2]: Nothing to be done for `all'.
Making all in docs
Making all in helpfiles
make[3]: Nothing to be done for `all'.
Making all in demos
Making all in 6way
make[4]: Nothing to be done for `all'.
Making all in bending
make[4]: Nothing to be done for `all'.
Making all in cube
make[4]: Nothing to be done for `all'.
Making all in curve
make[4]: Nothing to be done for `all'.
Making all in dit
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all-am'.
make[3]: Nothing to be done for `all-am'.
Making all in etc
make[2]: Nothing to be done for `all'.

Finally, the install…

make install

Which produces the following:

Making install in src
/bin/sh ../mkinstalldirs /usr/local/lib
 /bin/sh ../libtool --mode=install /usr/bin/install -c  _pynamot.la /usr/local/lib/_pynamot.la
/usr/bin/install -c .libs/_pynamot.lai /usr/local/lib/_pynamot.la
/usr/bin/install -c .libs/_pynamot.a /usr/local/lib/_pynamot.a
ranlib /usr/local/lib/_pynamot.a
chmod 644 /usr/local/lib/_pynamot.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
...
/bin/sh ../mkinstalldirs /usr/local/share/namot
 /usr/bin/install -c -m 644 Namot2.512 /usr/local/share/namot/Namot2.512
 /usr/bin/install -c -m 644 Namot2.600 /usr/local/share/namot/Namot2.600
 /usr/bin/install -c -m 644 Namot2.700 /usr/local/share/namot/Namot2.700
 /usr/bin/install -c -m 644 icon1.xv /usr/local/share/namot/icon1.xv
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.

With luck, your launching of NAMOT will open XQuartz and produce a fully operational NAMOT session.

namot

And, for more assistance with producing DNA files for GROMACS, consider the Modifications To The ffG53a6.rtp And ffG53a5.rtp Residue Topology Files Required For Using GROMOS96-NAMOT-GROMACS v1, sed-Based Script For Converting NAMOT And NAMOT2 DNA Output To GROMOS96 Format For GROMACS Topology Generation v1, and sed-Based Script For Converting NAMOT And NAMOT2 DNA Output To ffAMBER Format For GROMACS Topology Generation v1 pages on this blog.

UNAFold 3.8, MFold Utilities 4.5/4.6 And Additional Component Installation (Using XCode Tools 3 And Fink 0.29.21) For OSX 10.6.x

NOTE: The version numbers for everything are given specifically because aspects of the installation process may change with different versions and, in the event, I will not necessarily know the answer to subsequent problems if major version changes include major changes to the below (and that should clear up the "qualifications" section).

The UNAFold (UNified Nucleic Acid Fold(ing)) nucleic acid folding and hybridization prediction program set (here using version 3.8) can by itself be built with few (and not important) errors in OSX with Xcode Tools 3. The actual running of UNAFold.pl produces several errors that do not affect the run but do affect the amount/format of the output. It is my assumption that any OS running a less-than "kitchen sink" installation of Linux/Unix (Ubuntu, gentoo and Damn Small Linux come to mind) will have these errors and will require subsequent installations of programs/libraries that pieces of UNAFold rely on for processing output into, specifically, images and PDF files. OSX has the same issue that is easy to handle using Fink (and less so trying to install otherwise completely unrelated programs to make these "dependencies" (programs and libraries) available to UNAFold). Once Fink is installed, it is a few-step process to build UNAFold, move the Mfold Utilities contents to their proper folders (and there is a small trick here as well), and generate a UNAFold-complete install for all your DNA/RNA needs.

1. UNAFold 3.8 Installation

To begin, download (currently at mfold.rna.albany.edu/?q=DINAMelt/software), extract, open a terminal, cd into the unafold_3.8 directory (likely ~/Downloads/unafold_3.8), and run ./configure.

[prompt]$ cd ~/Downloads/unafold_3.8
[prompt]$ ./configure

On my machine (MacBook Pro, 10.6.x OSX + XCode Tools 3), this produces the output found in the local file 2011june_unafold_configure_output.txt.

You will likely note two sets of errors in the ./configure output:

./configure: line 8579: sort: No such file or directory
./configure: line 8576: sed: No such file or directory
./configure: line 10077: sort: No such file or directory
./configure: line 10074: sed: No such file or directory

The 10077 and 10074 errors are a bit odd because there are only 10039 lines in the configure file.

Are these errors important? No, you can build UNAFold just fine. I have run into these two "sort" and "sed" problems with a few other build attempts in OSX but have no good answer as to how to get around them (in case you're wondering, sort and sed are most certainly installed on the machine. The "sort" error can be removed by specifying the path explicitly in the configure file (in line 8579, change "sort" the "/usr/bin/sort"), but the sed error persists in the few attempts I tried to work around it. It doesn't appear to be a simple PATH issue. I'm not yet interested enough in finding a proper solution but, if you know, please post a comment or send a message. Is it just a character issue as discussed at itmercenary.livejournal.com/1585.html?).

running "make" produces the output found in the local file 2011june_unafold_make_output.txt.

[prompt]$ make

No issues. To install UNAFold, which will default to putting components into /usr/local/bin and /usr/local/share/, run sudo make install, which produces the output found in the local file 2011june_unafold_sudo_make_install_output.txt.

[prompt]$ sudo make install

Again, no issues. You will now have a populated /usr/local/bin folder.

2. MFold Utilities 4.5 (and, currently, the source for 4.6)

The next (optional) step is the inclusion of the mfold_util-4.5-Mac binaries (currently available at mfold.rna.albany.edu/?q=mfold/download-mfold), which I've also placed into the /usr/local/bin folder by extracting the contents of this file, them performing a cp * /usr/local/bin from within the MacBin directory.

[prompt]$ cd ~/Downloads/MacBin/
[prompt]$ sudo cp * /usr/local/bin

The processing of the data into plots with these programs requires that a set of *.col files be placed in the folder /usr/local/shared/mfold_util. Furthermore, these *.col are NOT provided in the mfold_util-4.5-Mac binary package. To get these files, you need only download the mfold_util-4.6.tar.gz file (currently at mfold.rna.albany.edu/?q=mfold/download-mfold), cd your way into src, make the /usr/local/shared/mfold_util folder, and copy the *.col files to /usr/local/shared/mfold_util.

[prompt]$ sudo mkdir /usr/local/shared/mfold_util
[prompt]$ cd Downloads/mfold_util-4.6/src
[prompt]$ sudo cp *.col /usr/local/shared/mfold_util

3. Fink 0.29.21 Install From Scratch

The first indication that other work was required came from trying to run mutplot randomly, which produced the following error:

dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/mutplot
  Reason: image not found
Trace/BPT trap

As digging around for libraries is not as straightforward as it would be for a Linux distro, I chose instead to solve the many problems by installing dependencies through the Fink program (currently fink-0.29.21). As 10.6.x users will find that there is no available Fink binary, you must build this from the source (which, with Xcode Tools 3 installed, occurs without error. If you don't have Xcode Tools 3 installed, the new mechanism for buying a copy of XCode Tools 4 is less than ideal (to me, anyway. $4.99?) but now occurs through the App Store).

Download the fink source (fink 0.29.21), extract, cd into the fink-0.29.21 directory, and run bootstrap. Upon completion, you run pathsetup.sh, source your .profile, and update fink.

[prompt]$ cd ~/Downloads/fink-0.29.21
[prompt]$ ./bootstrap
[prompt]$ . /sw/bin/pathsetup.sh 
[prompt]$ cd ~/
[prompt]$ source .profile
[prompt]$ fink selfupdate-rsync
[prompt]$ fink update-all

The output for my installation can be found in 2011june_fink_install_output.txt. The rsync output can be found in 2011june_fink_selfupdate_rsync_output.txt. NOTE: You will be asked several questions about the installation process. Be prepared to blindly select the default settings with [enter], but don't just walk away from the screen.

This completes the UNAFold install, MacBin install, and Fink install, meaning now we can walk through the dependencies.

4. Installing UNAFold (well, MFold Utils) Dependencies

First dependency-free UNAFold.pl run attempt produces the following error:

[prompt]$ UNAFold.pl seqtest.txt 
Checking for boxplot_ng... dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/boxplot_ng
  Reason: image not found
found, supports Postscript
Checking for hybrid-plot-ng... found, supports Postscript
Checking for sir_graph_ng or sir_graph... dyld: Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/bin/sir_graph
  Reason: image not found
found, supports Postscript
Checking for ps2pdfwr... not found
Calculating for seqtest.txt, t = 37

As the UNAFold install page states, you need glut, the GD library, and gnuplot installed (and all of the many libraries therein).

[prompt]$ fink install libjpeg tetex gd2 gnuplot

For gnuplot, you will be required to make a few selections during the build process (blindly hitting the enter key at these questions will do, but this is not just a "type and go" install process. And it took about two hours on a MBP).

A final working error-free run looks as below, leaving you to process the data with the MFold Utilities as you like:

[prompt]$ UNAFold.pl seqtest.txt 
Checking for boxplot_ng... found, supports Postscript
Checking for hybrid-plot-ng... found, supports Postscript
Checking for sir_graph_ng or sir_graph... found, supports Postscript
Checking for ps2pdfwr... found
Calculating for seqtest.txt, t = 37