FTorch
FTorch copied to clipboard
Enable building with fpm
Closes #77.
This PR adds fpm support. https://fpm.fortran-lang.org/
I am currently building with
fpm build --cxx-flag "-cpp -std=c++17 -I${Torch_DIR}/include -I${Torch_DIR}/include/torch/csrc/api/include -L${Torch_DIR}/lib" --verbose
I get the following error but I think this might go away soon if I recall correctly (@TomMelt @jatkinson1000)?
././src/ctorch.cpp: In function ‘const long long int* torch_tensor_get_sizes(torch_tensor_t)’:
././src/ctorch.cpp:317:25: error: invalid conversion from ‘const long int*’ to ‘const long long int*’ [-fpermissive]
317 | return t->sizes().data();
| ~~~~~~~~~~~~~~~^~
| |
| const long int*
[ 25%] ctorch.cpp done.
././src/ctorch.cpp: In function ‘const long long int* torch_tensor_get_sizes(torch_tensor_t)’:
././src/ctorch.cpp:317:25: error: invalid conversion from ‘const long int*’ to ‘const long long int*’ [-fpermissive]
317 | return t->sizes().data();
| ~~~~~~~~~~~~~~~^~
| |
| const long int*
<ERROR> Compilation failed for object " src_ctorch.cpp.o "
<ERROR> stopping due to failed compilation
STOP 1
Checklist
- [x] Fix
longissue - [x] Update metadata in
fpm.toml - [ ] Avoid duplicated preprocessor macro settings?
- [ ] Update docs
- [x] Test
fpmbuild in CI - [ ] Add separate
fpmCI workflow (or possibly use matrix) - [ ] Try out
fpm test - [ ] Add linting for
.tomlfiles?