Compiling a c++ project using blas (Fortran) in Matlab mex
- by Yin Zhu
I am trying to use a package here. I have no problem compiling it under 64-bit Linux as all the Makefiles are already provides. Only minor changes are needed, which I can handle.
However, I have a problem compiling it under 64-bit Windows. I have installed gfortran and also compiled BLAS and CBLAS to their static libraries. The problem is that Matlab mex does not support GCC in windows, so I need to use VC 2008 instead. I found in the Makefile this line is to get the final klr_train.mexw64:
klr_train.$(MEX_EXT): klr_train.cpp
$(MEX) $(MEX_OPTION) klr_train.cpp ../libklr/libklr.cpp $(CBLASDIR)/lib/LINUX/cblas_LINUX.a $(BLASDIR)/blas_LINUX.a -lgfortran
I don't know how to execute this line using VC 2008's command line tool cl. As cl obviously does not support -lgfortran, which I think is used to link some library in gfortran to support BLAS.