Difference between revisions of "CERNLIB Installation"
Line 4: | Line 4: | ||
Here's how I installed from source. | Here's how I installed from source. | ||
− | + | ==== Grab the files ==== | |
+ | Go to http://cernlib.web.cern.ch/cernlib/version.html | ||
Decide which version you would like. For this example I chose 2006. | Decide which version you would like. For this example I chose 2006. | ||
− | Click on the | + | Click on the ''compressed tar files'' link which takes you to http://cernlib.web.cern.ch/cernlib/download/2006_source/tar/ |
Grab the following. | Grab the following. | ||
Line 16: | Line 17: | ||
*mathlib32_src.tar.gz | *mathlib32_src.tar.gz | ||
− | + | ==== Untar the files ==== | |
+ | For the purposes of this example I am placing CERNLIB under /usr/local/cern and it is here that I place these three tarballs. | ||
cd /usr/local/cern | cd /usr/local/cern | ||
Line 28: | Line 30: | ||
2006/src | 2006/src | ||
− | + | ==== Make ==== | |
+ | To install the libraries I modify the script provided by cern found [http://cernlib.web.cern.ch/cernlib/install/start_cern here], changing the appropriate environment variables. | ||
− | Because I don't have | + | Because I don't have ''gmake'' on my machine, I also replace the gmake commands in the script with "make MAKE=make". |
− | + | ===== ''POTENTIAL MAKE ISSUE'' ===== | |
+ | I did have one make issue when installing on these systems. I found I had to comment out one line in one of the files | ||
as it was creating some conflict with Motif libraries. | as it was creating some conflict with Motif libraries. | ||
Line 45: | Line 49: | ||
This is probably specific to certain installations so be aware you may or may not have to do this. | This is probably specific to certain installations so be aware you may or may not have to do this. | ||
− | + | ==== Clean up some of the installation ==== | |
+ | |||
+ | I found that this script does not install one key file so I do this by hand | ||
mkdir 2006/share | mkdir 2006/share | ||
Line 51: | Line 57: | ||
cp 2006/src/geant321/data/xsneut95.dat 2006/share/lib/. | cp 2006/src/geant321/data/xsneut95.dat 2006/share/lib/. | ||
− | + | ==== Get lapack and blas ==== | |
+ | |||
+ | You also need to build the lapack and blas libraries. The source can be obtained from http://cernlib.web.cern.ch/cernlib/install/lapack3.html | ||
I found it easier to build them in some other directory and then copy them by hand to the appropriate | I found it easier to build them in some other directory and then copy them by hand to the appropriate | ||
Line 69: | Line 77: | ||
Note that the lapack library has a 3 on the end and blas doesn't. | Note that the lapack library has a 3 on the end and blas doesn't. | ||
− | + | ||
+ | |||
+ | ==== OK, you should be all set to go! ==== |
Latest revision as of 12:32, 6 March 2007
I have come across a few issues in the CERNLIB installation which broke HDGeant. Some of them may be common knowledge, but I thought it useful to list them here.
Here's how I installed from source.
Contents
Grab the files
Go to http://cernlib.web.cern.ch/cernlib/version.html
Decide which version you would like. For this example I chose 2006.
Click on the compressed tar files link which takes you to http://cernlib.web.cern.ch/cernlib/download/2006_source/tar/
Grab the following.
- 2006_src.tar.gz
- include.tar.gz
- mathlib32_src.tar.gz
Untar the files
For the purposes of this example I am placing CERNLIB under /usr/local/cern and it is here that I place these three tarballs.
cd /usr/local/cern tar -zxvf 2006_src.tar.gz tar -zxvf include.tar.gz
This should create the following directory structure
2006 2006/include 2006/src
Make
To install the libraries I modify the script provided by cern found here, changing the appropriate environment variables.
Because I don't have gmake on my machine, I also replace the gmake commands in the script with "make MAKE=make".
POTENTIAL MAKE ISSUE
I did have one make issue when installing on these systems. I found I had to comment out one line in one of the files as it was creating some conflict with Motif libraries.
2006/src/packlib/kuip/code_motif/iconwidget.c
In this file I had to comment out the following line (on my installation it was line 38)
#ifndef __APPLE__ //void _XmDrawShadow (); #endif
This is probably specific to certain installations so be aware you may or may not have to do this.
Clean up some of the installation
I found that this script does not install one key file so I do this by hand
mkdir 2006/share mkdir 2006/share/lib cp 2006/src/geant321/data/xsneut95.dat 2006/share/lib/.
Get lapack and blas
You also need to build the lapack and blas libraries. The source can be obtained from http://cernlib.web.cern.ch/cernlib/install/lapack3.html
I found it easier to build them in some other directory and then copy them by hand to the appropriate location.
cd tmp tar -zxvf lapack.tgz cd lapack-<version> cp make.inc.example make.inc
Edit make.inc to your heart's content. I think I left this alone.
make lib cp lapack<version>.a $CERN_ROOT/lib/liblapack3.a cp blas<version>.a $CERN_ROOT/lib/libblas.a
Note that the lapack library has a 3 on the end and blas doesn't.