安装配置好cmake
、jom
等工具,下载OpenBLAS-0.3.29
的源码包并解压,在msvc2019
命令行模式下启动cmake-gui
,选择OpenBLAS-0.3.29
源码目录,选择构建目录,configure
时选择NMake Makefiles JOM
,修改cmake
参数值:
//Build the collection of BLAS/LAPACK benchmarks
BUILD_BENCHMARKS:BOOL=OFF
//When building LAPACK, include also some older, deprecated routines
BUILD_LAPACK_DEPRECATED:BOOL=OFF
//Build with ReLAPACK (recursive implementation of several LAPACK
// functions on top of standard LAPACK)
BUILD_RELAPACK:BOOL=OFF
//Build shared library
BUILD_SHARED_LIBS:BOOL=ON
//Build static library
BUILD_STATIC_LIBS:BOOL=OFF
//Build LAPACK testsuite when building LAPACK
BUILD_TESTING:BOOL=OFF
//Do not build the C interface (CBLAS) to the BLAS functions
BUILD_WITHOUT_CBLAS:BOOL=OFF
//Do not build LAPACK and LAPACKE (Only BLAS or CBLAS)
BUILD_WITHOUT_LAPACK:BOOL=ON
//Build LAPACK from C sources instead of the original Fortran
C_LAPACK:BOOL=OFF
//Include support for multiple CPU targets, with automatic selection
// at runtime (x86/x86_64, aarch64, ppc or RISCV64-RVV1.0 only)
DYNAMIC_ARCH:BOOL=OFF
//Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron)
// with DYNAMIC_ARCH
DYNAMIC_OLDER:BOOL=OFF
NOFORTRAN:BOOL=ON
//Do not run a benchmark on each startup just to find the best
// location for the memory buffer
NO_WARMUP:BOOL=ON
//Choose the type of build, options are: None Debug Release RelWithDebInfo
// MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=Release
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=Z:/OpenBLAS-0.3.29/build/OpenBLAS-0.3.29
//Program used to build from makefiles.
//CMAKE_MAKE_PROGRAM:STRING=jom
设置完参数后,点击Generate
,确认无误后在构建目录中执行jom && jom install
。