dividiti / ck-caffe

Collective Knowledge workflow for Caffe to automate installation across diverse platforms and to collaboratively evaluate and optimize Caffe-based workloads across diverse hardware, software and data sets (compilers, libraries, tools, models, inputs):
http://cKnowledge.org
BSD 3-Clause "New" or "Revised" License
193 stars 40 forks source link

Need hack for lib-openblas to build caffe on Windows #64

Closed Chunosov closed 7 years ago

Chunosov commented 7 years ago

To make lib-openblas compile I had to add its source path (e.g. c:\Users\Administrator\CK-TOOLS\lib-openblas-0.2.19-mcl-compiler.gcc-5.3.0-windows-32\src) into PATH variable. Otherwise make cant find openblas's util getarch (that is already built at that time) and cant generate config.h properly and compilation fails. cd to this folder does't help.

Chunosov commented 7 years ago

But after the lib has been compiled in this way, linking is failed too...

Cannot export openblas_get_parallel: symbol not defined
../libopenblas_nehalem-r0.2.19.a(cblas_saxpy.obj):axpy.c:(.text+0x52): undefined 
 reference to `blas_cpu_number'
../libopenblas_nehalem-r0.2.19.a(cblas_saxpy.obj):axpy.c:(.text+0xc2): undefined
 reference to `blas_level1_thread'
../libopenblas_nehalem-r0.2.19.a(cblas_sscal.obj):scal.c:(.text+0x32): undefined
 reference to `blas_cpu_number'
../libopenblas_nehalem-r0.2.19.a(cblas_sscal.obj):scal.c:(.text+0x9f): undefined
 reference to `blas_level1_thread'
Chunosov commented 7 years ago

It seems that unable to buid openblas without fortran. I have to replace make command in the file CK\ck-math\package\lib-openblas-0.2.19-universal\scripts.win\install.bat:

mingw32-make PREFIX="%INSTALL_DIR%\install" BINARY=%CK_TARGET_CPU_BITS% ONLY_CBLAS=1 MAKE=mingw32-make.exe CFLAGS="-DMS_ABI" NOFORTRAN=1 NO_LAPACK=1

replace with

make PREFIX="%INSTALL_DIR%\install" BINARY=%CK_TARGET_CPU_BITS% CC=gcc FC=gfortran

which is taken (except of PREFIX) from the 'official' installation script of openblas quickbuild.win32

and only then openblas was built successfully

gfursin commented 7 years ago

I did various fixes (added Unix Utils detection from installed Git + Perl dependency) and it seems to be compiling fine on a new and clean machine (Surface Pro 4 with Win 10) ... I close this ticket. Thanks for reporting!