xcist / main

simulation and reconstruction package
BSD 3-Clause "New" or "Revised" License
45 stars 20 forks source link

Not support for mac m1? #52

Closed KimYeongHyeon closed 9 months ago

KimYeongHyeon commented 9 months ago

HW: Mac M1 SW: python 3.11

I'm trying to use this library, gecatsim, for handling CT file. Like the following code, I got incomplatible. I think the library isn't buildt for Mac m1.

Could you please provide new version for m1?

  File "/Users/kyh/Workspace/ct_mar/AAPMProj.py", line 92, in <module>
    sinogram = DD2FanProj(nrdetcols, x0, y0, xds, yds, xCor, yCor, viewangles, nrviews, sinogram, nrcols, nrrows, originalImgPtr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kyh/Workspace/ct_mar/AAPMProj.py", line 42, in DD2FanProj
    clib = load_C_lib()
           ^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/site-packages/gecatsim/pyfiles/CommonTools.py", line 57, in load_C_lib
    clib = ll(os.path.join(lib_path, libFile))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/site-packages/gecatsim/lib/libcatsim_macos.so, 0x0006): tried: '/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/site-packages/gecatsim/lib/libcatsim_macos.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/site-packages/gecatsim/lib/libcatsim_macos.so' (no such file), '/opt/homebrew/Caskroom/miniconda/base/envs/ctmar/lib/python3.11/site-packages/gecatsim/lib/libcatsim_macos.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

sincerely

jjobin commented 9 months ago

Yes, you are correct - the library is for the x86_64 architecture, and not M1. Having said that, you can build the library on your machine by following these steps.

KimYeongHyeon commented 9 months ago

Thank you for your answer. I moved lib files to site-packages/gecatsim/lib/ and it works well.