Getting CNS working with Bash

I have downloaded CNSsolve (Crystallography and NMR System), mainly because I want to use the script from the Yale Morph server on my local machine (a Mac Mini running Mountain Lion 10.8.2)

Following unpacking, the installation page from CNS directs the following:

The following will setup the CNSsolve program . Important: do not issue the “make install” command.

  • edit the file cns_solve_env – change the line: setenv CNS_SOLVE ‘location of CNSsolve directory’
  • before using CNSsolve you must:

source cns_solve_env

Note: this requires the csh or tcsh Unix shell.

But I’m using bash, and have just setup CCP4 to also work under bash. The problem is that the setenv command isn’t implemented in bash – instead the command is export and it has a different syntax. What to do? Thanks to Kay Diederichs for this tip (via the CCP4BB archive).

Rather than sourcing cns_solve_env, there is a hidden file under cns_solve_1.3, with the name .cns_solve_env_sh 

So, add the following line to .profile in your home directory (using the vi editor, [esc] :wq to save and quit). Note, I moved cps_solve_1.3 to /applications manually

source /applications/cns_solve_1.3/.cns_solve_env_sh

The file .cns_solve_env_sh must also be edited to provide the location of cns_solve (in this case, /applications)

CNS_SOLVE=/applications/CNS_solve_1.3
Advertisements

3 thoughts on “Getting CNS working with Bash

  1. Pingback: Mountain Lion – first impressions | Serious Piffle

  2. Pingback: XDS fails because it is unable to find forkcolspot | Serious Piffle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s