Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with MacOS arm libtorch #183

Open
jatkinson1000 opened this issue Oct 23, 2024 · 1 comment · Fixed by #191
Open

Incompatibility with MacOS arm libtorch #183

jatkinson1000 opened this issue Oct 23, 2024 · 1 comment · Fixed by #191
Labels
bug Something isn't working hackathon

Comments

@jatkinson1000
Copy link
Member

Building github runners and locally suggests there is an issue with the macOS version of libtorch outputting different types compared to linux for the functions introduced in #175 .

FTorch expects a long int* whilst the libtorch binary seems to be returning a long long int*.

Example output below.

[user@machine build]$ cmake --build .
[  8%] Building Fortran object CMakeFiles/ftorch.dir/ftorch.f90.o
[ 16%] Building Fortran object CMakeFiles/ftorch.dir/ftorch_test_utils.f90.o
[ 25%] Building CXX object CMakeFiles/ftorch.dir/ctorch.cpp.o
/Users/user/FTorch/src/ctorch.cpp: In function 'const long int* torch_tensor_get_sizes(torch_tensor_t)':
/Users/user/FTorch/src/ctorch.cpp:240:25: error: invalid conversion from 'const long long int*' to 'const long int*' [-fpermissive]
  240 |   return t->sizes().data();
      |          ~~~~~~~~~~~~~~~^~
      |                         |
      |                         const long long int*
make[2]: *** [CMakeFiles/ftorch.dir/ctorch.cpp.o] Error 1
make[1]: *** [CMakeFiles/ftorch.dir/all] Error 2
make: *** [all] Error 2
@jatkinson1000 jatkinson1000 added the bug Something isn't working label Oct 23, 2024
@jatkinson1000
Copy link
Member Author

@TomMelt Any chance we can prioritise this for the hackathon?
It is stopping me developing locally on my workstation.

@TomMelt TomMelt mentioned this issue Nov 18, 2024
4 tasks
TomMelt added a commit that referenced this issue Nov 19, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Nov 19, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Nov 19, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 2, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 4, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 9, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 10, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 10, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
TomMelt added a commit that referenced this issue Dec 10, 2024
fixes [#183](#183)

There is an issue when building on mac (arm_64) or windows. The version
of `libtorch` exposes a torch tensors shape (`t->sizes().data()`) as a
`const long long int*` instead of just a `const long int*` like on linux
and mac (x86).

This commit adds preprocessor macro to switch between implementations
automatically detecting the correct version at CMake build stage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hackathon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant