Skip to content

Commit 6c3387e

Browse files
Fixed major error in CMakeLists.txt (#69)
1 parent 1e08692 commit 6c3387e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ option(GUROBI_ROOT "Path to Gurobi installation" "")
4040
set(GUROBI_ROOT $ENV{HOME}/.local/lib/gurobi1103/linux64)
4141

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

4747
# Python Configuration
@@ -177,8 +177,6 @@ if (CDDP_CPP_TORCH)
177177

178178
# Export LibTorch variables for other parts of the build
179179
set(TORCH_INSTALL_PREFIX ${Torch_DIR}/../../../ CACHE PATH "LibTorch installation directory")
180-
181-
target_compile_definitions(${PROJECT_NAME} PRIVATE CDDP_CPP_TORCH_ENABLED=1)
182180
endif()
183181

184182

@@ -205,7 +203,7 @@ set(cddp_core_srcs
205203
)
206204

207205
if (CDDP_CPP_TORCH)
208-
list(APPEND cddp_core_srcs src/cddp_core/torch_helper.cpp)
206+
list(APPEND cddp_core_srcs src/cddp_core/neural_dynamical_system.cpp)
209207
endif()
210208

211209
set(dynamics_model_srcs
@@ -236,6 +234,7 @@ target_link_libraries(${PROJECT_NAME}
236234
)
237235

238236
if (CDDP_CPP_TORCH)
237+
target_compile_definitions(${PROJECT_NAME} PRIVATE CDDP_CPP_TORCH_ENABLED=1)
239238
target_link_libraries(${PROJECT_NAME} ${TORCH_LIBRARIES})
240239
endif()
241240

0 commit comments

Comments
 (0)