/
cblas

cblas

Introduction

Usage

 

module load library/cblas/cblas

 

Installation

cd /sw/library/blas/CBLAS
make
It will produce static library "blas_LINUX.a" in /sw/library/blas/CBLAS/lib


Shared Libraries

cd /sw/library/blas/CBLASshared
wget http://www.netlib.org/blas/blast-forum/cblas.tgz
tar xzvf cblas.tgz
cd CBLAS
>>>>>>>>>>>>>>>
Replace the corresponding variables in "Makefile.in" with:

BLLIB = /path_to_compiled_BLAS/blas_LINUX.a
CBLIB = ../lib/cblas_$(PLAT).so
CFLAGS = -O3 -DADD_ -fPIC
FFLAGS = -O3 -fPIC
ARCH = gcc
ARCHFLAGS = -shared -o

>>>>>>>>>>>>>>>>

make 2>&1 |tee makelog.txt
It will produce shared library "cblas_LINUX.so"

 

Installation June 2018

module purge
module load library/blas/3.8.0
#There is no version number in place for the C interface to the BLAS. Using date
/sw/library/cblas/20180614/src
wget http://www.netlib.org/blas/blast-forum/cblas.tgz
tar -zxvf /tmp/cblas.tgz
cd /sw/library/cblas/20180614/src/CBLAS

ln -s Makefile.LINUX Makefile.in

change line in Makefile.LINUX 
From
====
BLLIB = libblas.a
to:
===
BLLIB = /sw/library/blas/3.8.0/lib64/libblas.a

make help 2>&1 | tee makeHelpLog.txt
make all 2>&1 | tee makeAllLog.txt
cp -rp include /sw/library/cblas/20180614/
cp -rp lib  /sw/library/cblas/20180614/
cp -rp testing  /sw/library/cblas/20180614/
cp -rp examples/  /sw/library/cblas/20180614/

cd /sw/library/cblas/20180614/lib
ranlib cblas_LINUX.a

>>>>>>>
module display library/cblas/cblas
-------------------------------------------------------------------
/sw/com/modulefiles/library/cblas/cblas:

module         load library/blas/3.8.0
prepend-path     LIBRARY_PATH /sw/library/cblas/20180614/lib
prepend-path     LD_LIBRARY_PATH /sw/library/cblas/20180614/lib
prepend-path     LDFLAGS -L/sw/library/cblas/20180614/lib
prepend-path     INCLUDE /sw/library/cblas/20180614/include
prepend-path     CPLUS_INCLUDE_PATH /sw/library/cblas/20180614/include
prepend-path     CPATH /sw/library/cblas/20180614/include
prepend-path     C_INCLUDE_PATH /sw/library/cblas/20180614/include
prepend-path     FPATH /sw/library/cblas/20180614/include
prepend-path     CFLAGS -I/sw/library/cblas/20180614/include
prepend-path     CPPFLAGS -I/sw/library/cblas/20180614/include
prepend-path     CXXFLAGS -I/sw/library/cblas/20180614/include
prepend-path     FCFLAGS -I/sw/library/cblas/20180614/include
prepend-path     FFLAGS -I/sw/library/cblas/20180614/include
-------------------------------------------------------------------


>>>>>>>>>>
To create shared library:

diff Makefile.LINUX /tmp/CBLAS/Makefile.LINUX
25,26c25,26
< BLLIB = /sw/library/blas/3.8.0/lib64/libblas.a
< CBLIB = ../lib/cblas_$(PLAT).so
---
> BLLIB = libblas.a
> CBLIB = ../lib/cblas_$(PLAT).a
40,41c40,41
< CFLAGS = -O3 -DADD_ -fPIC
< FFLAGS = -O3 -fPIC
---
> CFLAGS = -O3 -DADD_
> FFLAGS = -O3
47,48c47,48
< ARCH = gcc
< ARCHFLAGS = -shared -o
---
> ARCH = ar
> ARCHFLAGS = r

make all 2>&1 | tee makeAllLog.txt
cd /sw/library/cblas/20180614/src/CBLAS/lib
cp cblas_LINUX.so /sw/library/cblas/20180614/lib

 

Reference

 

  1. http://avulanov.blogspot.com.au/2015/03/cblas-compilation-as-shared-library.htmlh