Skip to content. | Skip to navigation

Sections
Personal tools
Log in Register
You are here: Home Download 2dx software 2dx-installer Install from Source README

Install from Source README

by Admin last modified Nov 14, 2011 10:32 AM
This includes 2dx_image, 2dx_merge, 2dx_logbrowser, the modified MRC programs, and Maximum Likelihood programs. Not included is CCP4. You need to install that separately, see below.

Acquiring 2dx

The latest source for 2dx along with associated help files and up to the minute installation instructions are available at http://www.2dx.org.

Download: 2dx-{version}.tar.bz2

Extract: tar -xvjf 2dx-{version}.tar.bz2

Requirements

The following are required either for compilation or program execution. If you have installed a pre-built binary and any of the programs produce library errors, most likely there is a platform incompatibility with the libraries, or they are missing.

Libraries from the following may be compiled for your platform and placed in the 2dx/lib directory after install, or simply perform a full install of each of the following and the relevant dynamic libraries should be automatically placed in your path.

Software packages that you need for compilation of 2dx:

gfortran (General: http://gcc.gnu.org, OSX: http://hpc.sourceforge.net/ (For Snow Leopard, the Leopard compilers for GCC and GFORTRAN work), or through Fink: http://www.finkproject.org/) In the "navigation pane" on the left of this page, we also provide an OSX Snow Leopard Installer version 4.5.0 from HPC, which on August 15, 2010 worked better than the version 4.6.0.

fftw-3.0.0 or later (http://www.fftw.org)

to compile for OSX, use:

./configure --enable-shared --enable-single; make; sudo make install

Or alternatively, install FFTW via Porticus. To get Porticus, install it from http://porticus.alittledrop.com . Note that you also need to install the MacPorts, which you get from http://www.macports.org/ . When that is done, you can install "FFTW3" and "FFTW3 single".

QT-4.4.0 to QT-4.4.2, or QT=4.6.3 (ftp://ftp.trolltech.com/qt/source/ to get the correct version, the version named qt-all-opensource-src-4.4.0.tar.gz is strongly recommended ). QT-4.4.3 to QT-4.5.0 don't work !

For OSX 10.6 (Snow Leopard), use this: http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x/

After installing Qt, you have to reboot the OSX computer.

Software packages that you need to run 2dx

CCP4 5.0.2 or later (CCP4 6 Recommended) (http://www.ccp4.ac.uk/main.html)

CCP4 should be installed completely from the installers provided. However, a few potentially non-standard features must be present. Insure there exists a link called ccp4 to ccp4-{version} in /usr/local/. You can create one via:

cd /usr/local/
ln -s /path/to/ccp4-{version} ccp4

Also, insure that ccp4.setup-csh exists in /usr/local/ccp4/bin. If you have another setup script that you use or ccp4-setup.csh exists in another location, be sure to create a link to the appropriate script as above:

cd /usr/local/ccp4/bin
ln -s /path/to/script/ccp4.setup-csh ccp4.setup-csh

and you will also need:

Web Browser (e.g. Firefox: http://www.mozilla.com/firefox/)

PS Viewer (e.g. GhostScript/GhostView: http://www.cs.wisc.edu/~ghost/)

Text Editor (e.g. Kate: http://kate.kde.org/, or Nedit: http://sourceforge.net/projects/nedit/)

Compiling and Installing 2dx:

Installation should be the same regardless of system, though SGI-IRIX and Windows remain unsupported at present.

To install 2dx, just run:

configure
make
sudo make install

This will compile and install 2dx to /usr/local/2dx by default. For the sudo command you need root privileges (the administrator password). If you do not have root privileges, or would rather install to another directory, replace the above with:

configure
make
sudo make install prefix=/path/to/install/dir/2dx

where /path/to/install/dir could be in your hope directory. Then that would be /Users/people/JoeThePlumber/2dx.

2dx will then be installed to /Users/people/JoeThePlummer/2dx.

If you wish to use the web browser/ps viewer/editor integration be sure to edit 2dx/config/2dx.cfg. Once you have launched 2dx_image for the first time, you will also have your own private setting in ~/.2dx/2dx.cfg, where you can adjust things for your own taste, if other people on the same computer want to have other default browsers. Simply change each of the values after the appropriate editor/viewer to the desired program. On OS X "open" opens the default editor for a given mime type, but any program can be used instead via:

open -a /path/to/program.app

Installing a pre-compiled 2dx version on Linux:

RPM Install:

rpm -Uvh 2dx-{version}.rpm

should be sufficient.

However, users wishing to install 2dx to a user-defined installation directory may use:

rpm -Uvh --prefix /path/to/install/dir 2dx-{version}.rpm

In the rare case that rpm complains about bin/sh dependencies, etc, use the following:

rpm -Uvh --force --nodeps --prefix /path/to/install/dir 2dx-{version}.rpm

Running 2dx

You will find links to the installed programs in /usr/local/2dx/bin. There you will find 2dx_image, 2dx_merge, and 2dx_logbrowser. Those files should point to the executables. You could include /usr/local/2dx/bin in your PATH definition, so that you can launch these from the command line. Alternatively, you could make a link to those files or to that directory on your desktop, or where-ever you like to have it.

BASH:

echo export PATH=/usr/local/2dx/bin:$PATH >> ~/.profile

CSH:

echo setenv PATH /usr/local/2dx/bin:$PATH >> ~/.cshrc

(Note: The above may vary from system to system.)

On OS-X (Both PPC and Intel) the binaries are wrapped in {program}.app/ directories. For quick access to any of these, simply drag any of the program links found in 2dx/bin to the Dock. To run such a program from a terminal use:

open /usr/local/2dx/bin/{program}.app

Running any of the programs in the 2dx package should require no modification to the system environment.

Documentation & Community Support

Up to the minute documentation for 2dx is available at http://www.2dx.org/documentation. The site contains installation instructions, tutorials and a full description of program parameters, all of which allow for user comments/questions. The goal of this site being part static documentation/part forum for discussion.

Admin
Admin says:
Nov 13, 2011 08:29 AM

it appears that at least on some linux systems that the qmake command needs to be linked.

the ./configure command failed with numerous qmake errors, despite having recently intalled QT4. solution was to link "qmake-qt4" to "qmake" in usr/bin/

Admin
Admin says:
Nov 13, 2011 08:30 AM

2dx in Linux still looks for ccp4.setup-csh in /usr/local/ccp4/bin
So the link needs to be there. In /usr/local/ccp4/bin, then: ln -s ../include/ccp4.setup ccp4.setup-csh

Admin
Admin says:
Nov 13, 2011 08:30 AM

Ok, you are right.
However, in 2dx since version 3.1 the CCP4 initialization is centralized in the file
/usr/local/2dx/proc/initialize

You could also adapt that one file in your 2dx installation and define how CCP4 should be initialized on your local machine. This would allow you to leave CCP4 as it is

Admin
Admin says:
Nov 13, 2011 08:30 AM

Using ifort:
option '-axN' not supported


From ifort man page:
The only options available on Intel(R) EM64T systems are -axW, -axP, and -axT. On Mac OS systems, the only valid option is -axP. On these systems, it is equivalent to -xP, which is the default and is always set.

I replaced -axN with -axTP in all 21 makefiles (using rpl), and it no longer complains.

Admin
Admin says:
Nov 13, 2011 08:31 AM

With ifort 10.1.018, I get an error that says "<limits.h>" can't be opened. It's a documented limitation in ifort:
http://software.intel.com/en-us/forums/intel-c-compiler/topic/59886

I have resolved this by upgrading to ifort 11.0. I upgraded ICC concurrently. I got one error:
Catastrophic error: could not set locale "" to allow processing of multibyte characters
I googled a bit, and defining a variable LANG equal to C fixed it.
I.E. "export LANG=C" makes it work.

(MCS@UCD)

Admin
Admin says:
Nov 13, 2011 08:31 AM

Not sure it is intrinsic to Ubuntu, but I've had to add -lpthread when compiling periodogram. (edit Makefile in <path>/2dx/kernel/mrc/source/periodogram and add -lpthread to the CFLAGS list.
Hope this helps...

Admin
Admin says:
Nov 13, 2011 08:31 AM

Compiling 2dx on Mac OS X (G4, G5, Core Duo, Core 2 Duo and Xeon)
To ensure a succesful compilation of 2dx in any (almost) architecture I recommend the following:

Get Fink and install ccp4 (this will ensure that gcc and gfotran get installed).

Get fftw and installed as described in the main text above.

Get qt4, key for this step is getting the source code for all architectures from the trolltech FTP. Don't use the dmg.
Installation is as simple as ./configure && make && sudo make install.To ensure funtionality link the qmake @ /usr/local/Trolltech/Qt-4.4.0/bin to /usr/bin

Then, get 2dx and install as described above. On Gs architectures (G4 and G5) I got an error from gfrotran. Something refering to an -ipo flag. I changed the 2dx/mrc/source/ctf/Makefile to remove said flag. Then compile.