Permission denied - mac
Hi I have a naive problem. I would like to try out elastix for image registration and downloaded the mac version of elastix (5.1.0). I then added the path to elastix in mac terminal and tried "elastix -- help", but I get "Permission denied" error. It is likely to be a mac problem, which I am unable to solve. Any help will be great!
Below, I have copy pasted what I have tried in terminal.
(base) sundar@SundarsacStudio ~ % export PATH=/Users/sundar/elastix-5.1.0-mac/bin:$PATH (base) sundar@SundarsacStudio ~ % export DYLD_LIBRARY_PATH=/Users/sundar/elastix-5.1.0-mac/lib:$DYLD_LIBRARY_PATH (base) sundar@SundarsacStudio ~ % pwd /Users/sundar (base) sundar@SundarsacStudio ~ % cd elastix-5.1.0-mac (base) sundar@SundarsacStudio elastix-5.1.0-mac % elastix --help zsh: permission denied: elastix
Try chmod +x elastix
Thanks @jasper-tms! For my understanding, does that mean that every mac user should locally do chmod +x elastix on the elastix executable they download from https://github.com/SuperElastix/elastix/releases ?
Is there anything we could do to make it easier for mac users, when we make a new elastix release?
Yea, I have had to do that for both elastix and transformix. I don't know if there's a way to set the executable bit during build in a way that would be preserved through the zip-unzip process. If so, that would help.
Additionally, I had to run xattr -d com.apple.quarantine bin/* lib/* (while in the elastix folder) to get MacOS to be willing to run an "unsafe" executable file downloaded from the internet.
And finally, MacOS System Integrity Protection purges LD_* environment variables when running scripts, so I've had to do shenanigans like this whenever I want to run elastix within a script on mac: https://github.com/htem/run_elastix/blob/6bb0ee22603dd68395afdb928939b5fd7db56564/run_elastix#L53-L60
If you have some proposed updates and don't have easy access to a Mac, I'm happy to test things.