News:

alphaMELTS 2.3 standalone & for MATLAB/Python is now open source and available on GitHub (https://github.com/magmasource/alphaMELTS).
alphaMELTS 1.9 is available at the legacy download and information site.
For news of all MELTS software see the MELTS Facebook page.

Main Menu

using MATLAB script to iteratively model a system

Started by molarson, May 17, 2014, 01:43:42 PM

Previous topic - Next topic

molarson

Hi,

I am using the Matlab command 'system(command)' to attempt to run alphamelts, so that I can run alphamelts in a for loop.

So I type:

system('./run_alphamelts.command')

And get:
:::
No command line switches specified! Please enter switches now
(or press return for default '-f alphamelts_default_env.txt').

ALPHAMELTS_MAXP +40000
ALPHAMELTS_MINT 0
ALPHAMELTS_MINF 0.005
ALPHAMELTS_MAXT +2000
ALPHAMELTS_VERSION pMELTS
ALPHAMELTS_MASSIN 0.001
ALPHAMELTS_DELTAP +1000
ALPHAMELTS_DELTAT +10
ALPHAMELTS_MINP +1
ALPHAMELTS_MODE isentropic


Can't exec "alphamelts": No such file or directory at ./run_alphamelts.command line 381.
RUN_ALPHAMELTS.COMMAND WARNING: alphamelts may have crashed!


RUN_ALPHAMELTS.COMMAND WARNING: Cannot find output file "Phase_main_tbl.txt" (No such file or directory)
Please check that alphamelts ran properly.
Run again (y or n)?

::::::

Anyone else have this issue? Alphamelts runs fine from a terminal.

Paula

#1
Assuming you have installed alphaMELTS and have a links_folder, set the Matlab path variable to include that folder (type 'help path' at the Matlab prompt). Then use system('run_alphamelts.command') instead of system('./run_alphamelts.command') and it should work. If not, let me know, though I'm on leave at the moment so I'm not sure how quickly I'll be able to reply again.

There is more information on running the perl script from within Matlab in the last couple of paragraphs of the 'Interactive Operation' section of the documentation. That example uses the file_format.command script and Matlab's perl() command, rather than system(), but it should be easy enough to adapt. (On Windows, I think you would have to use perl() but on Linux and Mac system() should do just as well.)

Cheers,
Paula

molarson

Hi Paula,

Thanks for getting back so promptly. I appreciate the help.

system() still doesn't work, really an unusual issue.

===
  >> system('run_alphamelts.command')
  /bin/bash: run_alphamelts.command: command not found
===

So, I tried perl(), and it all looks good, though it took a few trials to figure out how to pass the arguments, apparently the options and their flags must be separated:

===
>> perl('run_alphamelts.command','-f', 'FracXtalTutorial.txt','-b','batch.txt')
===

so, if you find the system() fix, that would be great, but if not, it all looks good with perl().

Thanks so much, again!

Paula

perl() uses the Matlab search path whereas system() uses the system path. So it sounds like the alphaMELTS links_folder is not in your system path.

If alphaMELTS is installed properly you should be able to run it from any folder by typing 'run_alphamelts.command' in the terminal, without the './'. Then system('run_alphamelts.command') should work too. I just checked on Linux. I don't have Matlab installed on a Mac right now.

You can see the sytem path by typing 'echo $PATH' at the terminal; system('echo $PATH') also works within Matlab. There is some information about how to set the path permanently here; it's aimed at Mac users but should work for Linux too.

Cheers,
Paula

akbarker

I am also getting the same error message on Windows 7, using the strawberry perl download. Do you have any tips for overcoming this on windows?

Paula

As with the original post, it sounds like the alphaMELTS links_folder is not in your system path. For Windows, there is information about how to set the path permanently here. I've recently updated the post for version 1.4 and to include Windows 8, as well as 7 and XP.

Have a go at installing 1.4 and if you still get the error message please post in a bit more detail how you are starting run_alphamelts.command etc.

Cheers,
Paula