Skip to content
Search

OpenBLAS

lastmod 2022-06-29created 2015-10-1315 edits

OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

How to compile

Install flags

  • DYNAMIC_ARCH=1: Selects the appropriate kernel for the CPU at run time.

Local Download

OpenBLAS 0.2.15 version
OpenBLAS-0.2.15.tar.gz
OpenBLAS 0.2.19 version
OpenBLAS-0.2.19.tar.gz

Troubleshooting

Disable fortran

If you don't want to use Fortran, compile as follows.

$ make ONLY_CBLAS=1

Not found symbol

When compiling in certain environments (Mac OSX), the following error may occur.

Undefined symbols for architecture x86_64:
  "_idamax_k", referenced from:
      _idamax_ in libopenblas_haswellp-r0.2.17.dev.a(idamax.o)
...

The cause is that, when compiling the assembly files in the kernel/ directory(in the case above, the kernel/x86_64/iamax_sse2.S file), the value assigned to the ASMNAME DEFINE does not match the name decoration (Nmae mangling).

To fix it, check the FU and BU values in Makefile.conf, which is output as the result file of c_check (a perl script) used by Makefile.prebuild.

For reference, the script in perl that determines the need_fu variable, which in turn determines FU, is as follows.

$data = `$compiler_name -S ctest1.c && grep globl ctest1.s | head -n 1 && rm -f ctest1.s`;
$data =~ /globl\s([_\.]*)(.*)/;
$need_fu = $1;
# ...
print MAKEFILE "FU=$need_fu\n" if $need_fu ne "";

unexpected token at start of statement

When compiling in certain environments (Mac OSX), the following error may occur.

clang -O2 -DMAX_STACK_ALLOC=2048 -DEXPRECISION -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=8 -DASMNAME=_dtrmm_kernel_RT -DASMFNAME=_dtrmm_kernel_RT_ -DNAME=dtrmm_kernel_RT_ -DCNAME=dtrmm_kernel_RT -DCHAR_NAME=\"dtrmm_kernel_RT_\" -DCHAR_CNAME=\"dtrmm_kernel_RT\" -DNO_AFFINITY -I.. -DDOUBLE  -UCOMPLEX -c -DTRMMKERNEL -DDOUBLE -UCOMPLEX -ULEFT -DTRANSA ../kernel/x86_64/dgemm_kernel_4x8_sandy.S -o dtrmm_kernel_RT.o
kernel/x86_64/dgemm_kernel_4x8_sandy.S:1849:1: error: unexpected token at start of statement
#### Writing Back ####
^

This appears to be simply a clang bug. Add a space after the # that marks a comment, as shown below.

# ### Writing Back ####
# ifndef    TRMMKERNEL

See also

Favorite site

author Zer0 sitemap