mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Issues installing mtex5.8.1 on mac os 12.4 #1477

Closed matteodemurtas closed 2 years ago

matteodemurtas commented 2 years ago

Hi all,

I have been unsuccessfully trying to install and use one of the newer versions (after 5.3) of mtex on matlab. The problem seems to be related to the nfft and I have tried multiple times to fix it by following the indications for installation issues for mac osx, but something always seems to go wrong. Since navigating software installation through the terminal is obscure matter to me, I would like to know if someone could help me solve this.

Following the indications, everything is fine in the first two steps (1. Install gcc with openmp and libtools and 2. Get nff source from github). When trying to set the compilation parameters (making sure to change with the right versions of the gcc and matlab (11.3.0_2 and 2021a in my case), the compilation seems to go fine with the exception of this message

configure: WARNING: unrecognized options: --with-apple-gcc-arch

If I proceed to the next step, I compile the nfft with the "make" command and no error message appears.

By staying in the nfft folder and executing the script to link the nfft (and again making sure to have the correct version of gcc and matlab changed), I then get the error

line 6: syntax error near unexpected token `cd'
line 6: `  cd matlab/"$LIB"'

And I have no idea why or how to solve it :) I tried to look around on some forums, but have not found anything that could solve this.

Thanks a lot for any help! Matteo

kilir commented 2 years ago

Hi Matteo, the error rather means that something went wrong in the writing/copying of the script - not necessarily in the line referenced. Are you sure it's like in the instruction? Or upload it here? Cheers, Rüdiger

matteodemurtas commented 2 years ago

Hi Rüdiger, I copied the script exactly from the website. I have attached it here (as txt instead of *.sh file). Cheers, Matteo

linknfft.txt

kilir commented 2 years ago

Ok. try

...
for LIB in nfft nfsft nfsoft nnfft fastsum nfct nfst; do
  cd matlab/"$LIB"

...

with a ; before the do.

Cheers, Rüdiger

matteodemurtas commented 2 years ago

It works as it does something, but seems like some files or directories are not found

cp: nfftmex.mexmaci64 and .libs/libnfft.mexmaci64 are identical (not copied).
cp: nfsftmex.mexmaci64 and .libs/libnfsft.mexmaci64 are identical (not copied).
cp: nfsoftmex.mexmaci64 and .libs/libnfsoft.mexmaci64 are identical (not copied).
ld: file not found: .libs/libnnfft_la-nnfftmex.o
collect2: error: ld returned 1 exit status
cp: .libs/libnnfft.mexmaci64: No such file or directory
cp: fastsummex.mexmaci64 and .libs/libfastsum.mexmaci64 are identical (not copied).
ld: file not found: .libs/libnfct_la-nfctmex.o
collect2: error: ld returned 1 exit status
cp: .libs/libnfct.mexmaci64: No such file or directory
ld: file not found: .libs/libnfst_la-nfstmex.o
collect2: error: ld returned 1 exit status
cp: .libs/libnfst.mexmaci64: No such file or directory

Cheers, Matteo

kilir commented 2 years ago

And make did not throw any errors? It seems it does not build all objects.

Cheers, Rüdiger

matteodemurtas commented 2 years ago

I have attached here all the messages that appeared when I did make Doesn't seems any proper error message came out. In some parts it says make: Nothing to be done for 'all'.

Thanks again, Cheers, Matteo make_messages.txt

kilir commented 2 years ago

libnfsft.mexmaci64 and libnfsoft.mexmaci64 should be usable in Mtex (I hope). The missing objects the linker is complaining about are actually not needed for mtex anyways and have also not been configured (see the options for configure) so the for loops should have read

...
for LIB in nfsft nfsoft ; do
...

We'll correct that in the documentation.

Cheers, Rüdiger

matteodemurtas commented 2 years ago

Thank you Rüdiger. The rest went smoothly. Now when I try to open mtex on Matlab with startup_mtex I still get the error

“nfsftmex.mexmaci64” cannot be opened because the developer cannot be verified.

Cheers, Matteo

kilir commented 2 years ago

That's something you'd need to explain your OS. If this was the initial error you had, compiling nfft was a nice exercise but probably not needed.

I think you have to whitelist the libraries and potentially remove from quarantine. https://www.mathworks.com/matlabcentral/answers/516152-mex-file-cannot-be-opened-because-the-developer-cannot-be-verified-in-os-x-10-15-2-and-cannot-be-whi

Googling ".mexmaci64” cannot be opened because the developer cannot be verified." also comes up with some suggestions.

Hope this helps. Cheers, Rüdiger

matteodemurtas commented 2 years ago

Brilliant, finally worked nicely!

Thank a lot for the help (and patience) :)

Cheers, Matteo