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

Fixed major error in CMakeLists.txt #69

Merged
merged 1 commit into from
Dec 27, 2024
Merged
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
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ option(GUROBI_ROOT "Path to Gurobi installation" "")
set(GUROBI_ROOT $ENV{HOME}/.local/lib/gurobi1103/linux64)

# LibTorch Configuration
option(CDDP_CPP_TORCH "Whether to use LibTorch" OFF)
option(CDDP_CPP_TORCH_GPU "Whether to use GPU support in LibTorch" OFF)
option(CDDP_CPP_TORCH "Whether to use LibTorch" ON)
option(CDDP_CPP_TORCH_GPU "Whether to use GPU support in LibTorch" ON)
set(LIBTORCH_DIR $ENV{HOME}/.local/lib/libtorch CACHE PATH "Path to local LibTorch installation") # FIXME: Change this to your local LibTorch installation directory

# Python Configuration
Expand Down Expand Up @@ -177,8 +177,6 @@ if (CDDP_CPP_TORCH)

# Export LibTorch variables for other parts of the build
set(TORCH_INSTALL_PREFIX ${Torch_DIR}/../../../ CACHE PATH "LibTorch installation directory")

target_compile_definitions(${PROJECT_NAME} PRIVATE CDDP_CPP_TORCH_ENABLED=1)
endif()


Expand All @@ -205,7 +203,7 @@ set(cddp_core_srcs
)

if (CDDP_CPP_TORCH)
list(APPEND cddp_core_srcs src/cddp_core/torch_helper.cpp)
list(APPEND cddp_core_srcs src/cddp_core/neural_dynamical_system.cpp)
endif()

set(dynamics_model_srcs
Expand Down Expand Up @@ -236,6 +234,7 @@ target_link_libraries(${PROJECT_NAME}
)

if (CDDP_CPP_TORCH)
target_compile_definitions(${PROJECT_NAME} PRIVATE CDDP_CPP_TORCH_ENABLED=1)
target_link_libraries(${PROJECT_NAME} ${TORCH_LIBRARIES})
endif()

Expand Down
Loading