Compile Nmag with BLAS/LAPACK versions downloaded automatically by PETSc

This is a contribution from Gilles Nguyen from the University of Brest (France):

To compile nmag :

1. you should compile Nmag using GCC. If you are in a cluster, you may then have to disable using the Intel C compiler, by commenting in your .cshrc (or equivalent) the line module intel (otherwise, the header files for Intel compiler are selected during compilation, leading to compilation errors each time the headers are included with #include<...> (because using <...> instead of using "..." commands to the preprocessor to find the header files in the environment paths which depend to the modules used)

2. add in the Makefile:

  PETSC_MORE_CONFIG_OPTS=-COPTFLAGS=$(COPTFLAGS) -CXXOPTFLAGS=$(COPTFLAGS) --download-c-blas-lapack=1

as mentioned when the compilation error prompted to do this.

3. make uninstall

4 - make The option "--download-c-blas-lapack=1" downloads effectively the C source files of the libraries blas et lapack in "nmag-0.1/lib/petsc/externalpackages/f2cblaslapack". It seems that they are detected as they were already compiled. But they are in fact not compiled.

The error is probably due to the file "BlasLapack.py" in "/lib/petsc/python/BuildSystem/config/packages/":

   if os.path.isfile(os.path.join(libdir,'tmpmakefile')) and
                     (SourceDB.getChecksum(os.path.join(libdir,'tmpmakefile'))
                     == SourceDB.getChecksum(os.path.join(blasDir,'tmpmakefile'))):
      self.framework.log.write('Do not need to compile '+l +'blaslapack, already compiled\n')
      return libdir  <<<<<<<<

5 - So after, we compile the libraries with "tmpmakefile" : make -f tmpmakefile

6- After, we add in the "Makefile" the path where the librairy files could be found:

PETSC_MORE_CONFIG_OPTS=-COPTFLAGS=$(COPTFLAGS) -CXXOPTFLAGS=$(COPTFLAGS) --with-blas-lapack-dir=/home3/caparmor/gnguyen/Gilles/nmag/nmag-0.1/lib/petsc/externalpackages/f2cblaslapack

Also available in: HTML TXT