Mex compiling error 'g++: error: libmwlapack.lib: No such file or directory'

조회 수: 12 (최근 30일)
Kichang Lee
Kichang Lee 2019년 4월 15일
편집: Pirate Brown 2021년 6월 1일
Hello,
I'm currently using Matlab R2019a with Mingw64 compiler.
The follwing code is a part of "SuiteSparse" installation.
s= 'mex -silent -largeArrayDims -DBLAS64 -O -DNPARTITION -DNMATRIXOPS -DNMODIFY -I. -I../../AMD/Include -I../../COLAMD/Include -I../../CHOLMOD/Include -I../Include -I../../SuiteSparse_config -I../../CHOLMOD/MATLAB/Windows spqr.cpp spqr_parallel.obj spqr_1colamd.obj spqr_1factor.obj spqr_1fixed.obj spqr_analyze.obj spqr_append.obj spqr_assemble.obj spqr_cpack.obj spqr_csize.obj spqr_cumsum.obj spqr_debug.obj spqr_factorize.obj spqr_fcsize.obj spqr_freefac.obj spqr_freenum.obj spqr_freesym.obj spqr_front.obj spqr_fsize.obj spqr_happly.obj spqr_happly_work.obj spqr_hpinv.obj spqr_kernel.obj spqr_larftb.obj spqr_panel.obj spqr_rconvert.obj spqr_rcount.obj spqr_rhpack.obj spqr_rmap.obj spqr_rsolve.obj spqr_shift.obj spqr_stranspose1.obj spqr_stranspose2.obj spqr_trapezoidal.obj spqr_type.obj spqr_tol.obj spqr_maxcolnorm.obj SuiteSparseQR_qmult.obj SuiteSparseQR.obj SuiteSparseQR_expert.obj spqr_mx.obj SuiteSparse_config.obj amd_1.obj amd_2.obj amd_aat.obj amd_control.obj amd_defaults.obj amd_dump.obj amd_global.obj amd_info.obj amd_order.obj amd_postorder.obj amd_post_tree.obj amd_preprocess.obj amd_valid.obj colamd.obj cholmod_aat.obj cholmod_add.obj cholmod_band.obj cholmod_change_factor.obj cholmod_common.obj cholmod_complex.obj cholmod_copy.obj cholmod_dense.obj cholmod_error.obj cholmod_factor.obj cholmod_memory.obj cholmod_sparse.obj cholmod_transpose.obj cholmod_triplet.obj cholmod_check.obj cholmod_read.obj cholmod_write.obj cholmod_amd.obj cholmod_analyze.obj cholmod_colamd.obj cholmod_etree.obj cholmod_factorize.obj cholmod_postorder.obj cholmod_rcond.obj cholmod_resymbol.obj cholmod_rowcolcounts.obj cholmod_rowfac.obj cholmod_solve.obj cholmod_spsolve.obj cholmod_super_numeric.obj cholmod_super_solve.obj cholmod_super_symbolic.obj rand48.obj spqr_mx_error.obj libmwlapack.lib libmwblas.lib'
eval(s)
yields the error message :
Error using mex
g++: error: libmwlapack.lib: No such file or directory
g++: error: libmwblas.lib: No such file or directory
I can find the above lib files at ....\MATLAB\R2019a\extern\lib\win64\mingw64
Why i got such error message?? Any helps would be appreciated.
  댓글 수: 2
Pirate Brown
Pirate Brown 2019년 6월 10일
편집: Pirate Brown 2021년 6월 1일
I just had the same problem. The SuiteSparse Matlab installers are not adapted for newer versions of Matlab. I got spqr to work on Windows (64-bit) with Matlab2018a without METIS (I simply renamed the metis-5.1.0 folder in the SuiteSparse folder) by going to the directory SuiteSparse/SPQR/MATLAB/ and editing the file spqr_make.m and setting the paths of the libraries explicitly.
I.e., I replaced
lib = '"libmwlapack.lib" "libmwblas.lib"' ;
with
lib = '../../../extern/lib/win64/mingw64/libmwlapack.lib ../../../extern/lib/win64/mingw64/libmwblas.lib';
where the Suitesparse folder resides in MATLAB/R2018a/.
Then the libraries were found but I had to update some lapack/blas names for the 64 environment.
This is ugly but I simply made strings like this:
s1 = ' -Ddlarfg_=dlarfg -Ddlarf_=dlarf -Dzlarfg_=zlarfg -Dzlarf_=zlarf -Ddlarft_=dlarft -Ddlarfb_=dlarfb -Ddlarft_=dlarft -Ddlarfb_=dlarfb -Ddlarft_=dlarft ';
s2 = ' -Ddlarfb_=dlarfb -Ddlarft_=dlarft -Ddlarfb_=dlarfb -Dzlarft_=zlarft -Dzlarfb_=zlarfb -Dzlarft_=zlarft -Dzlarfb_=zlarfb -Dzlarft_=zlarft -Dzlarfb_=zlarfb ';
s3 = ' -Dzlarft_=zlarft -Dzlarfb_=zlarfb -Ddnrm2_=dnrm2 -Ddznrm2_=dznrm2 -Ddsyrk_=dsyrk -Ddgemm_=dgemm -Ddpotrf_=dpotrf -Ddtrsm_=dtrsm -Dzherk_=zherk ';
s4 = ' -Dzgemm_=zgemm -Dzpotrf_=zpotrf -Dztrsm_=ztrsm -Dzherk_=zherk -Dzgemm_=zgemm -Dzpotrf_=zpotrf -Dztrsm_=ztrsm -Ddtrsv_=dtrsv -Ddgemv_=dgemv ';
s5 = ' -Ddtrsm_=dtrsm -Ddgemm_=dgemm -Dztrsv_=ztrsv -Dzgemv_=zgemv -Dztrsm_=ztrsm -Dzgemm_=zgemm -Ddgemv_=dgemv -Ddtrsv_=dtrsv -Ddtrsm_=dtrsm ';
s6 = ' -Dzgemv_=zgemv -Dztrsv_=ztrsv -Dztrsm_=ztrsm -Ddgemm_=dgemm -Dzgemm_=zgemm ';
and then added them to the flag with this line
flags = [s1 s2 s3 s4 s5 s6 flags];
Then I installed SPQR with the spqr_install.m file and ran the demo and it worked.
I guess you'd have to make similar adaptations to the other folders.
I included the adapted file in this message. You should replace it with the file in the SuiteSparse/SPQR/MATLAB folder. Just make sure that the SuiteSparse folder itself is located in the R20xxx directory of Matlab, e.g. C:/Program Files/MATLAB/R2019a/Suitesparse. Just tested it, works also with 2019a.
William Warriner
William Warriner 2020년 5월 6일
Thank you for this Pirate Brown. I was able to successfully build cholmod on R2019b using this advice.
It might be worth trying the commands
matlabroot
and
fullfile
to build the paths to the libraries in a more portable way.
Attached is a modified version of cholmod_make.m which incorporates your advice as well as the above commands. The changes start in the block on line 80.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by