thliebig / openEMS

openEMS is a free and open-source electromagnetic field solver using the EC-FDTD method.
http://openEMS.de
GNU General Public License v3.0
413 stars 146 forks source link

openEMS folder in 'Program Files': openEMS binary exited with error-code 1 #109

Open LukasJuchli opened 1 year ago

LukasJuchli commented 1 year ago

Hi,

as I'm knew to github I don't know if placing the issue here is right. Please redirect me to the correct location if posting it here is not right. I followed the initial steps (documented in your wiki) using Matlab. When running the following command I got the following error: Command RunOpenEMS( '.', 'nonexistant.xml', '' ) Error "openEMS binary exited with error-code 1"

After some digging it got clear that running the openEMS.exe Matlab failed due to a whitespace ' ' in the path directing to the exe-file. In my case it was 'Program Files' that had the whitespace included. Therefore Matlab was not able to run the exe. Changing line 37 of 'invoke_openEMS.m' to the following solved the problem.

command = ['"' openEMS_bin '"' ' ' opts];

I don't know if this is the 'best' or 'cleanest' solution, but it worked for me.

Note to first-time users: As mentioned in the Wiki, you'll still get an error. But the error is due to not finding the .xml file which doesn't exist. However, the error-code will have the value -1 and not 1 as in the case of not being able to run the exe-file.

Best regards, Lukas