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

Require ftorch when coupling #134

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ jobs:
run: |
. ftorch/bin/activate
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages
export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages/torch
export BUILD_DIR=$(pwd)/src/build
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} -DCMAKE_BUILD_TESTS=TRUE
echo Building in ${BUILD_DIR}
echo Torch in ${Torch_DIR}
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${BUILD_DIR} -DCMAKE_BUILD_TESTS=TRUE -DCMAKE_PREFIX_PATH=${Torch_DIR}
cmake --build .
cmake --install .

Expand Down
2 changes: 1 addition & 1 deletion examples/1_SimpleNet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()

find_package(FTorch)
find_package(FTorch REQUIRED)
message(STATUS "Building with Fortran PyTorch coupling")

# Fortran example
Expand Down
2 changes: 1 addition & 1 deletion examples/2_ResNet18/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()

find_package(FTorch)
find_package(FTorch REQUIRED)
message(STATUS "Building with Fortran PyTorch coupling")

# Fortran example
Expand Down
2 changes: 1 addition & 1 deletion examples/3_MultiGPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()

find_package(FTorch)
find_package(FTorch REQUIRED)
find_package(MPI REQUIRED)
message(STATUS "Building with Fortran PyTorch coupling")

Expand Down
2 changes: 1 addition & 1 deletion pages/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ If doing this you need to include the following in the `CMakeLists.txt` file to
find the FTorch installation and link it to the executable.

```CMake
find_package(FTorch)
find_package(FTorch REQUIRED)
target_link_libraries( <executable> PRIVATE FTorch::ftorch )
message(STATUS "Building with Fortran PyTorch coupling")
```
Expand Down
Loading