Ivanlh20 / multem

MULTEM is a powerful and advanced collection of C++ routines with CUDA support, designed to perform efficient and accurate multislice simulations for various TEM experiments such as HRTEM, STEM, ISTEM, ED, PED, CBED, ADF-TEM, ABF-HC, EFTEM, and EELS.
GNU General Public License v3.0
64 stars 25 forks source link

Help with installing on Windows #8

Open thomasaarholt opened 7 years ago

thomasaarholt commented 7 years ago

Right. I've just spent the better part of two days trying to install MULTEM on Windows. After hitting hurdle upon hurdle, this is where I am at:

Install Cuda (free) Install Matlab 2016b. (not free) Install Visual Studio 2015 (NOT 2017), selecting the basic setup for C++ during the installation (under "languages") (free) Install .Net Framework 4.6.2 (free)

In Matlab, run

mex -setup C++

and select the Visual Studio compiler (click the apparent link to run the code).

In Matlab, switch to the MULTEM directory, add the folders on the left to the Path (right click, add to path). In the Matlab console, I now type compile_mex_multem

This is where I currently fail. Any help at all is greatly appreciated. The accompanying error is

mex -largeArrayDims -outdir ..\mex_executables -I../src -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" il_specimen_slicing.cu  -L../src -lblas -llapack -L../src -lfftw3f -lfftw3
Error using mex
No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2016b/win64.html.

Error in MEX (line 53)
eval(textcommands);

Error in mex_specimen_slicing (line 3)
MEX('release', 'il_specimen_slicing.cu', '../src');

Error in run (line 96)
evalin('caller', [script ';']);

Error in compile_mex_multem (line 15)
  run(['mex_files_multem/',file{1}])
thomasaarholt commented 7 years ago

For reference, I have tried both the MinGW and Visual Studio C++ compilers. The former took a bit of effort to install due to a known bug in Matlab.

thomasaarholt commented 7 years ago

Both compilers succeed with the following "compile test code":

>> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'),'.','f')
>> mex yprime.c

Building with 'Microsoft Visual C++ 2015 Professional (C)'.
MEX completed successfully.
thomasaarholt commented 7 years ago

Right. I've gone back to basics and realised that you specify Visual Studio 2013. I will attempt that now.