diff --git a/CMakeLists.txt b/CMakeLists.txt index c169162e..10ede10f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,8 @@ endif() message(STATUS "Include ${CMAKE_CURRENT_SOURCE_DIR}/cmake/parameters.cmake") include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/parameters.cmake) find_package(Eigen3 REQUIRED) -find_package(Torch REQUIRED) find_package(Cantera) +#find_package(Torch) ## 3. set up project system libraries ## message(STATUS "3. Set up system libraries") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 07092247..53cdf7b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -61,7 +61,11 @@ add_subdirectory(special) add_subdirectory(single_column) add_subdirectory(diagnostics) add_subdirectory(forcing) -add_subdirectory(modules) + +if (${Torch_FOUND}) + add_subdirectory(torch) + add_subdirectory(modules) +endif() #add_subdirectory(nbody) set(CANOE_LIBRARY_${buildu} @@ -86,7 +90,7 @@ set(CANOE_LIBRARY_${buildu} "scm_${buildl}" "diagnostics_${buildl}" "forcing_${buildl}" - "modules_${buildl}" + #"modules_${buildl}" ${YAML_CPP_LIBRARIES} ${CPPDISORT_LIBRARY_${buildu}} ${PYTHON_LIBRARY_RELEASE} diff --git a/src/torch/CMakeLists.txt b/src/torch/CMakeLists.txt new file mode 100644 index 00000000..3d425eaf --- /dev/null +++ b/src/torch/CMakeLists.txt @@ -0,0 +1,28 @@ +set(namel torch) +string(TOUPPER ${namel} nameu) + +file(GLOB src_files + eos/*.cpp + hydro/*.cpp + riemann/*.cpp + recon/*.cpp + column/*.cpp + ) + +string(TOLOWER ${CMAKE_BUILD_TYPE} buildl) +string(TOUPPER ${CMAKE_BUILD_TYPE} buildu) + +add_library(${namel}_${buildl} + OBJECT + ${src_files} + ) + +set_target_properties(${namel}_${buildl} + PROPERTIES + COMPILE_FLAGS ${CMAKE_CXX_FLAGS_${buildu}} + ) + +target_include_directories(${namel}_${buildl} + PRIVATE + ${EIGEN3_INCLUDE_DIR} + ) diff --git a/src/snap/decomposition/decom.cpp b/src/torch/column/decom.cpp similarity index 100% rename from src/snap/decomposition/decom.cpp rename to src/torch/column/decom.cpp diff --git a/src/snap/decomposition/decom.hpp b/src/torch/column/decom.hpp similarity index 100% rename from src/snap/decomposition/decom.hpp rename to src/torch/column/decom.hpp diff --git a/src/snap/eos/eos.cpp b/src/torch/eos/eos.cpp similarity index 100% rename from src/snap/eos/eos.cpp rename to src/torch/eos/eos.cpp diff --git a/src/snap/eos/eos.hpp b/src/torch/eos/eos.hpp similarity index 100% rename from src/snap/eos/eos.hpp rename to src/torch/eos/eos.hpp diff --git a/src/snap/eos/eos_hydro_ideal.cpp b/src/torch/eos/eos_hydro_ideal.cpp similarity index 100% rename from src/snap/eos/eos_hydro_ideal.cpp rename to src/torch/eos/eos_hydro_ideal.cpp diff --git a/src/exo3/exo3.cpp b/src/torch/exo3/exo3.cpp similarity index 100% rename from src/exo3/exo3.cpp rename to src/torch/exo3/exo3.cpp diff --git a/src/exo3/exo3.hpp b/src/torch/exo3/exo3.hpp similarity index 100% rename from src/exo3/exo3.hpp rename to src/torch/exo3/exo3.hpp diff --git a/src/snap/hydro/flux_divergence.cpp b/src/torch/hydro/flux_divergence.cpp similarity index 100% rename from src/snap/hydro/flux_divergence.cpp rename to src/torch/hydro/flux_divergence.cpp diff --git a/src/snap/hydro/hydro.hpp b/src/torch/hydro/hydro.hpp similarity index 100% rename from src/snap/hydro/hydro.hpp rename to src/torch/hydro/hydro.hpp diff --git a/src/snap/reconstruct/interpolation.cpp b/src/torch/recon/interpolation.cpp similarity index 100% rename from src/snap/reconstruct/interpolation.cpp rename to src/torch/recon/interpolation.cpp diff --git a/src/snap/reconstruct/interpolation.hpp b/src/torch/recon/interpolation.hpp similarity index 100% rename from src/snap/reconstruct/interpolation.hpp rename to src/torch/recon/interpolation.hpp diff --git a/src/snap/reconstruct/recon.hpp b/src/torch/recon/recon.hpp similarity index 100% rename from src/snap/reconstruct/recon.hpp rename to src/torch/recon/recon.hpp diff --git a/src/snap/reconstruct/weno5.cpp b/src/torch/recon/weno5.cpp similarity index 100% rename from src/snap/reconstruct/weno5.cpp rename to src/torch/recon/weno5.cpp diff --git a/src/snap/riemann/riemann.cpp b/src/torch/riemann/riemann.cpp similarity index 100% rename from src/snap/riemann/riemann.cpp rename to src/torch/riemann/riemann.cpp diff --git a/src/snap/riemann/riemann.hpp b/src/torch/riemann/riemann.hpp similarity index 100% rename from src/snap/riemann/riemann.hpp rename to src/torch/riemann/riemann.hpp diff --git a/src/snap/riemann/rs_hydro_lmars.cpp b/src/torch/riemann/rs_hydro_lmars.cpp similarity index 100% rename from src/snap/riemann/rs_hydro_lmars.cpp rename to src/torch/riemann/rs_hydro_lmars.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 44f86f2e..847365b3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,11 +8,13 @@ configure_file(globals.cpp.in globals.cpp @ONLY) enable_testing() # torch tests -setup_test(test_eos) -setup_test(test_weno) -setup_test(test_reconstruct) -setup_test(test_riemann) -setup_test(test_hydro) +if (${Torch_FOUND}) + setup_test(test_eos) + setup_test(test_weno) + setup_test(test_reconstruct) + setup_test(test_riemann) + setup_test(test_hydro) +endif() # athena tests setup_test(test_mesh)