Installing CNS on OS X

From OS X Scientific Computing

aqua_cns1.2_osx.png



Contents

CNS 1.2 on OS X



Main Points

  • CNS 1.2 is the current version of CNS
  • CNS 1.2 is available as a pre-compiled, optimized, universal binary from David Gohara
  • My unofficial (local) fink package called cns-binary downloads and installs the above, along with modified


(The previous (and obsolete) version of this page is archived under the title Installing CNS 1.1 on OS X ).


Summary of my recommended installation

Do one of the following:

  1. Download and install David Gohara's precompiled universal binary.
  2. Let fink install David's universal CNS for you.
  3. Install the precompiled intel binary available directly from the CNS folks.
  4. Compile the sourcecode available [directly from the CNS folks.

Whichever you do, you absolutely MUST register to use CNS.




Fast versions of CNS compiled with IBM & Intel compilers

David Gohora has very kindly made available binaries of CNS for both ppc and intel. He has put a lot of effort into optimizing these and they are remarkably fast. This is what I use, and I recommend you download the version appropriate for your computer. (See above.)

Obtaining the software

Do everything automatically

Let Fink install David's Gohara's universal CNS for you. This will do all the setup automatically and ensure you have functional cns_edit and cns_web functions.


For PPC and Intel Macs:

  • You can obtain David Gohora's precompiled ultra-fast CNS binaries from his new website


For Intel Macs only:

or

  • Get the (universal) distribution (above)

Installing it

Just download the directory and place it into

/usr/local 

or

/usr/local/xtal 

and read the enclosed instructions. (My startup files will find this automatically if you put it here, but you can put it anywhere you want and the software will work fine.)

Compiling the source code (if you insist)

On ppc, you can use g77, and just follow the usual directions, including

make g77install

xstats.f fails (does this on linux, too)

fix: swap the lines 453 and 454 in source/xstats.f

Useful additions

I've made several customizations that will make your life easier. I think some of these might have made their way into David Gohara's package, but if not, you can either get these from my CNS web page or in the section entitled "Some Useful Extras" above.

To use cns_edit and cns_web

I've modified the cns_edit and cns_web commands to work with the Camino web browser. If you don't have it already, get it. Then please have each user do the following to allow you to save edited cns scripts wherever suits you:

mkdir ~/Library/Application\ Support/Camino
cd ~/Library/Application\ Support/Camino

then create and edit a file called user.js and put in it the following line:

user_pref("browser.download.autoDownload", false);

Doing so will now allow you to choose the directory into which you can save the edited input file.

I've put further details on this web page, which includes instructions on how to do this with other browsers if you don't like my Camino solution.



Sample bash/zsh compatible cns_solve_env.sh

DON'T USE THIS with the fink package. It is already in there, in /sw/etc/profile.d/cns.*sh

CNS seems to assume everyone uses (t)csh. They even write their shell scripts in csh.


The following example works with zsh and bash. It is excepted from my environment.xtal file, linked in the "Some Useful Extras" section. You may need to change the line

export CNS_SOLVE="/usr/local/xtal/cns_solve_1.2"

to where you put the directory, and perhaps redefine where the cns executable is located.

Example cns_solve_env.sh file