cmt-dtu-energy / MagTense

MagTense - a micromagnetism and magnetostatic framework
http://www.MagTense.org
GNU General Public License v3.0
28 stars 12 forks source link

Linux Matlab mex MagTenseMicroMag doesnt work - shared lib error on running #16

Closed rasmusbj closed 11 months ago

rasmusbj commented 4 years ago

On Linux, building with "make" and afterwards constructing the MEX-files with "buildMagTenseMEX" works without compilation errors. The MEX-interface for Matlab works correctly for the magnetostatic calculations.

However, the MicroMag simulations does not work. Running e.g. Standard_problem_4 results in the following MEX-error in Matlab.

"Invalid MEX-file '/home/rabj/MagTense/MagTense/matlab/MEX_files/MagTenseLandauLifshitzSolver_mex.mexa64': /home/rabj/MagTense/MagTense/matlab/MEX_files/MagTenseLandauLifshitzSolver_mex.mexa64: undefined symbol: sgemvf95"

The error seems to be related to the libraries that are linked into the MEX. The "buildMagTenseMEX" file is currently a mess on the Linux side and could use some cleaning.

One possible solution could be to compile the MEX directly in the makefile (as done here: https://github.com/kyamagu/mexopencv/blob/master/Makefile or https://github.com/jtilly/mex/blob/master/fortran.makefile)