SKIRT / SKIRT9

SKIRT version 9 -- advanced radiative transfer in dusty systems
http://www.skirt.ugent.be
GNU Affero General Public License v3.0
35 stars 30 forks source link

Have trouble when running "skirt XXX.ski" on Mac M1 #97

Closed willsonho2000 closed 3 years ago

willsonho2000 commented 3 years ago

Description I'm new to SKIRT, when I'm following the tutorial to run it on my new computer, Mac M1, it encountered some bugs. It seems that the problem was emerged from ARM architecture. However, when I was viewing the source code, I saw there are conditional operators for arm. Not sure how to fix the bug.

Below is the error information: % skirt MonoDisk.ski
. . . 11/04/2021 22:57:32.436 OpticalMaterialPropertiesProbe opt wrote optical properties to /Users/Willson/SKIRT/run/MonoDisk_opt_opticalprops_0.dat

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Byteswapping is not being done correctly on this system. Check the MACHINE and BYTESWAPPED definitions in fitsio2.h Please report this problem to the CFITSIO developers. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 11/04/2021 22:57:32.448 * * Error: Error while creating FITS file /Users/Willson/SKIRT/run/MonoDisk_cut_dust_t_xy.fits 11/04/2021 22:57:32.448 Error: non-CFITSIO program error 11/04/2021 22:57:32.448 * * Error: On line 64 in file /Users/Willson/SKIRT/git/SKIRT/core/FITSInOut.cpp 11/04/2021 22:57:32.448 Error: In function report_error 11/04/2021 22:57:32.448 * * Error: Call stack: 11/04/2021 22:57:32.448 Error: 1 skirt 0x0000000100e28810 _ZN10FatalErrorC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS09allocatorIcEEEEPKciS8 + 948 11/04/2021 22:57:32.448 * * Error: 2 skirt 0x0000000100e62b64 _ZN12_GLOBALN_112report_errorENSt3112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES6_i + 432 11/04/2021 22:57:32.448 Error: 3 skirt 0x0000000100e6212c _ZN9FITSInOut5writeENSt3112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_8valarrayIdEES6_iiddddS6_SAS6 + 356 11/04/2021 22:57:32.448 * *** Error: 4 skirt 0x0000000100e61c00 _ZN9FITSInOut5writeEPK14SimulationItemNSt3112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEES9_RKNS3_8valarrayIdEES9_iiddddS9_SDS9 + 424 11/04/2021 22:57:32.448 * * Error: 5 skirt 0x0000000100eb1b18 _ZZN27PlanarMediaDensityCutsProbe21writeMediaDensityCutsEP5ProbebbbdddiiiENK3$_1clERNSt3__18valarrayIdEENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESC_b + 1072 11/04/2021 22:57:32.448 Error: 6 skirt 0x0000000100eb10bc _ZN27PlanarMediaDensityCutsProbe21writeMediaDensityCutsEP5Probebbbdddiii + 1816 11/04/2021 22:57:32.448 * * Error: 7 skirt 0x0000000100e4ffc8 _ZN28DefaultMediaDensityCutsProbe5probeEv + 164 11/04/2021 22:57:32.448 Error: 8 skirt 0x0000000100eb66a0 _ZN11ProbeSystem10probeSetupEv + 40 11/04/2021 22:57:32.448 * * Error: 9 skirt 0x0000000100e99940 _ZN20MonteCarloSimulation15setupSimulationEv + 252 11/04/2021 22:57:32.448 Error: 10 skirt 0x0000000100ec356c _ZN10Simulation11setupAndRunEv + 696 11/04/2021 22:57:32.448 * * Error: 11 skirt 0x0000000100df5874 _ZN23SkirtCommandLineHandler12doSimulationEm + 2384 11/04/2021 22:57:32.448 Error: 12 skirt 0x0000000100df2d28 _ZN23SkirtCommandLineHandler7doBatchEv + 436 11/04/2021 22:57:32.448 * * Error: 13 skirt 0x0000000100df20b4 _ZN23SkirtCommandLineHandler7performEv + 80 11/04/2021 22:57:32.448 Error: 14 skirt 0x0000000100df92bc main + 160 11/04/2021 22:57:32.448 * *** Error: 15 libdyld.dylib 0x000000019af9df34 start + 4

Reproduce Just follow the first example of the tutorial: https://skirt.ugent.be/version9/_tutorial_basics_mono.html

System

petercamps commented 3 years ago

Thank you reporting this problem in a very clear and complete manner. As you undoubtedly surmised, it looks like the version of the FITS library built into SKIRT does not properly recognize the byte ordering (endianness) of the M1 ARM architecture. There might be a quick fix, but more likely, we should upgrade to a more recent version of that library.

Unfortunately, I don't have access to an Apple Silicon Mac at this moment so I cannot test whether any proposed solution actually works. We decided to purchase such a computer so we can offer proper support, but I'm not sure when it will be delivered. Hopefully soon. I will keep you posted.

Please accept our apologies for the inconvenience. Hopefully you can find another computer to work with SKIRT in the meantime.

petercamps commented 3 years ago

I upgraded the FITS library in SKIRT to the most recent version in a branch of my personal SKIRT fork. It works on my Intel Mac, but I haven't tested any other platforms or compilers, and certainly not Apple Silicon. But with some luck, it will work for you as well (I can see some changes to the code that just might do the trick).

If you're willing to give this a try, you should be able to git pull or git clone from: https://github.com/petercamps/SKIRT9/tree/newfitsio If that doesn't work, we'll have to wait until I get the new computer. Let me know!

willsonho2000 commented 3 years ago

Thank you for your apply. I have tested the new version of SKIRT from the above website. However, it showed up the same error messages. I will use another computer to run the code instead before the bug is fixed, but really appreciate your help!

petercamps commented 3 years ago

This issue should be fixed with pull request #99 (verified on Apple mini with M1 chip).

@willsonho2000 please completely remove your previous SKIRT install(s) and start the installation from scratch.