sg-s / xolotl

A MATLAB neuron simulator. Very fast (written in C++). Flexible (fully object oriented). Immediate (live manipulation in MATLAB). Comes with a powerful parameter optimizer. Get started ➡️
https://go.brandeis.edu/xolotl
GNU General Public License v3.0
45 stars 8 forks source link

xolotl won't run on M3 Mac #591

Closed smbaca closed 5 months ago

smbaca commented 5 months ago

Please go through the following steps before you file an issue that documents a problem or a potential bug and please check each item as you do so:

Information

Please provide the following information:

Operating System

Sonoma 14.5 Mac OS on M3

Output of "version" command in MATLAB

'24.1.0.2628055 (R2024a) Update 4'

Output of "mex.getCompilerConfigurations('C++')" in MATLAB

CompilerConfiguration with properties:

         Name: 'Xcode Clang++'
 Manufacturer: 'Apple'
     Language: 'C++'
      Version: '15.0.0'
     Location: '/Applications/Xcode.app/Contents/Developer'
    ShortName: 'Clang++'
     Priority: 'A'
      Details: [1×1 mex.CompilerConfigurationDetails]
   LinkerName: '/usr/bin/xcrun -sdk macosx14.5 clang++'
LinkerVersion: ''
       MexOpt: '/Users/smbaca/Library/Application Support/MathWorks/MATLAB/R2024a/mex_C++_maca64.xml'

Bug reports

So, we are trying to run xolotl on the new silicon Mac M3 chip. When I load up our usual setup that works on Macs and pcs I get the following error:

Error using assert
md5hash does not point to compiled binary

Error in hashlib.test (line 10)
assert(strcmpi(['.' mexext],ext),'md5hash does not point to compiled binary')

Error in xolotl.run_all_tests (line 37)
hashlib.test()

Error in setup_xolotl_beenhakker_class (line 52)
xolotl.run_all_tests % tests xolotl installed ok

Is there a hash file for the M3 that will work? I am happy to compile or try to troubleshoot. More and more of the kids are using M1-M3 Macs in the class, so we would like to be able to make xolotl and the tutorials we have designed available for their personal use vs sharing systems.

sg-s commented 5 months ago

This is going to be almost impossible for me to fix be cause I don't have access to matlab anymore. Sorry!

smbaca commented 5 months ago

I'm happy to give you remote access to the M3 system if you want to give it a go. If not is there any general advice on how to generate the necessary files for Xolotl to run?

smbaca commented 5 months ago

Ok so I just mex compiled the hash.c file and now it looks like everything is up and running on the M3. I can send the file if interested.

sg-s commented 5 months ago

Can you please send a pull request? I suspected this was the case.

sg-s commented 5 months ago

@smbaca i have identified the exact cause.

this line in mtools/hashlib throws an error because it expects the compiled md5hash binary to have the extension mexmaca64. See this page:

https://www.mathworks.com/help/matlab/ref/mexext.html

for extensions on different platforms.

It does not, because this C program has never been compiled on a mac arm platform before.

to fix this, you need to modify that file (in that repo).

smbaca commented 5 months ago

Yes I compiled the file in question and will upload. There was also a regular warning about not using a scalar and I think I corrected that and will send what I did once I get to my computer.Sent from my iPhoneOn Jun 26, 2024, at 9:14 PM, Srinivas Gorur-Shandilya @.***> wrote: @smbaca i have identified the exact cause. this line in mtools/hashlib throws an error because it expects the compiled md5hash binary to have the extension mexmaca64. See this page: https://www.mathworks.com/help/matlab/ref/mexext.html for extensions on different platforms. It does not, because this C program has never been compiled on a mac arm platform before. to fix this, you need to modify that file (in that repo).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

sg-s commented 5 months ago

ok, thank you! please open a PR on this repo:

https://github.com/sg-s/srinivas.gs_mtools

sg-s commented 5 months ago

i'm closing this issue because you fixed this in mtools