We have an issue with having multiple mex and dll files, which have similarly named, differing versions of the same dlls.
They are kept on separate paths, with their own copies the dlls. We have previously had to call 'clear mex' to force matlab to unload old versions of mex files before we can load up the next.
We would like to be able to maintain state in the dll's (specifically to avoid long and expensive operations to move data between matlab and the DLLs) and are hoping to use loadlibrary to allow us to do this.
Unfortunately this means our 'clear mex' hack, no longer works. Could you explain possible methods to allow us to load multiple DLL's, which depend on different versions of identically named DLLs?

 채택된 답변

the cyclist
the cyclist 2018년 10월 22일
편집: the cyclist 2018년 10월 22일

0 개 추천

I think your question would be answered by a careful reading of this documentation page about function precedence order. Or at least it will tell you the confines within which your are operating.
If not, maybe giving a specific example of function location and calling attempts would be helpful?

댓글 수: 1

William Thorley
William Thorley 2018년 10월 22일
Sorry, if I wasn't clear, let me clarify with an example:
I have a mex file and a dll:
The first:
  1. mex file readData_mex.mex
  2. at the location MATLAB_WORKING_DIRECTORY/Mexfile1/.
  3. It has a dependancy on a dll DataUtilityFunctions.dll.
The Second:
  1. dll file processData.dll.
  2. at the location *MATLAB_WORKING_DIRECTORY/DifferentMexFiles/*.
  3. It has a dependancy on a dll DataUtilityFunctions.dll.
MATLAB_WORKING_DIRECTORY/DifferentMexFiles/DataUtilityFunctions.dll and MATLAB_WORKING_DIRECTORY/Mexfile1/DataUtilityFunctions.dll are different versions (major revision numbers) of the same DLL. This means they do not have identical interfaces and so cannot be used in place of each other.
each mex (or dll) file has been compiled and linked against it's appropriate version of DataUtilityFunctions.dll.
Which ever mex (or dll) file we try to run second will fail to load. Seemingly as it can't link against the version of DataUtilityFunctions.dll which is stored in matlabs memory.
If we run the mex. call 'clear mex' then run the dll, they also run fine.
However we desire to have both in MATLABs memory at the same time (to avoid having to repeatedly transfer, very large amounts of data over the DLL barrier (many millions of varying sized arrays, totaling roughly 15GB)
I guess the shortest question is: Is it impossible to have multiple differing instances of the same dependancy dll in MATLABs memory at once?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2018년 10월 22일

댓글:

2018년 10월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by