Skip to content

Commit 005c43e

Browse files
authored
Merge pull request #79 from Project-SEA-Stack/feature/chrono-fsi-interface
Refactor Chrono linkage and improve build, data, and test infrastructure
2 parents 314f1e2 + c1bb209 commit 005c43e

337 files changed

Lines changed: 2116 additions & 219939 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ _build/
4444

4545
# General
4646
build/
47-
data/
4847
demos/F3OF/f3of/
4948
sandbox/
5049
Testing/Temporary/CTestCostData.txt

CMakeLists.txt

Lines changed: 419 additions & 477 deletions
Large diffs are not rendered by default.

app/CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
message(STATUS "Add run_hydrochrono program")
2+
3+
add_executable(run_hydrochrono
4+
run_hydrochrono.cpp
5+
../include/hydroc/runner/run_from_yaml.h
6+
../src/hydro/runner/run_from_yaml.cpp
7+
../src/utils/misc_options.cpp
8+
)
9+
10+
# Set C++ standard
11+
target_compile_features(run_hydrochrono PUBLIC ${HC_CXX_STANDARD})
12+
13+
target_link_libraries(run_hydrochrono
14+
PRIVATE HydroChrono HydroChronoGUI Chrono::Chrono_parsers
15+
)
16+
17+
# Safety net: if HDF5 was not propagated, link executable explicitly as well
18+
if(HC_HDF5_TARGETS)
19+
target_link_libraries(run_hydrochrono PRIVATE ${HC_HDF5_TARGETS})
20+
elseif(DEFINED HDF5_CXX_LIBRARIES OR DEFINED HDF5_LIBRARIES)
21+
target_link_libraries(run_hydrochrono PRIVATE ${HDF5_CXX_LIBRARIES} ${HDF5_LIBRARIES})
22+
endif()
23+
24+
target_include_directories(run_hydrochrono
25+
PRIVATE
26+
${PROJECT_SOURCE_DIR}/include
27+
${PROJECT_SOURCE_DIR}/src/utils
28+
# Fallback include paths for Chrono Parsers when using a build-tree Chrono_DIR
29+
$<IF:$<BOOL:${Chrono_DIR}>,${Chrono_DIR}/../../install/include,>
30+
$<IF:$<BOOL:${Chrono_DIR}>,${Chrono_DIR}/../include,>
31+
$<IF:$<BOOL:${Chrono_DIR}>,${Chrono_DIR}/../../src,>
32+
)
33+
34+
if(MSVC)
35+
set_target_properties(run_hydrochrono PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:run_hydrochrono>")
36+
endif()
37+
38+
set_target_properties(run_hydrochrono PROPERTIES
39+
OUTPUT_NAME "run_hydrochrono"
40+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
41+
)

app/run_hydrochrono.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <hydroc/runner/run_from_yaml.h>
7+
#include <hydroc/config.h>
78
#include <hydroc/version.h>
89
#include "../src/utils/misc_options.h"
910
#include <hydroc/logging.h>

build.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,12 +744,25 @@ function Package-Artifacts {
744744
}
745745
$hdf5Bin = Join-Path $hdf5Root "bin"
746746
if (Test-Path $hdf5Bin) {
747+
Write-Info "Copying HDF5 DLLs from: $hdf5Bin"
748+
$hdf5Count = 0
747749
Get-ChildItem -Path $hdf5Bin -Filter "*.dll" -ErrorAction SilentlyContinue | ForEach-Object {
748750
$dest = Join-Path $installBin $_.Name
749-
if (-not (Test-Path $dest)) {
750-
Copy-Item -Path $_.FullName -Destination $dest -Force -ErrorAction SilentlyContinue
751-
}
751+
Copy-Item -Path $_.FullName -Destination $dest -Force -ErrorAction SilentlyContinue
752+
$hdf5Count++
752753
}
754+
Write-Info "Copied $hdf5Count HDF5 DLL(s)"
755+
} else {
756+
Write-Warning "HDF5 bin directory not found: $hdf5Bin"
757+
}
758+
759+
# Copy Irrlicht DLL
760+
$irrlichtDll = Join-Path $Config.IrrlichtDir "bin\Win64-VisualStudio\Irrlicht.dll"
761+
if (Test-Path $irrlichtDll) {
762+
Copy-Item -Path $irrlichtDll -Destination $installBin -Force -ErrorAction SilentlyContinue
763+
Write-Info "Copied Irrlicht.dll"
764+
} else {
765+
Write-Warning "Irrlicht.dll not found at: $irrlichtDll"
753766
}
754767
# Also copy DLLs from this project's build bin (Release/Debug) into install\bin
755768
$hcDllSource = Join-Path (Get-Location) "bin\$BuildType"

cmake/config.h.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef HYDROC_CONFIG_H
2+
#define HYDROC_CONFIG_H
3+
4+
/**
5+
* @file config.h
6+
* @brief HydroChrono configuration header file.
7+
*
8+
* This header file is automatically created during the CMake configuration
9+
* of HydroChrono and is tailored for a BUILD or INSTALL tree.
10+
*/
11+
12+
// If HydroChrono was built with Irrlicht support, define HYDROCHRONO_HAVE_IRRLICHT
13+
@HC_HAS_IRRLICHT@
14+
15+
// If HydroChrono was built with VSG support, define HYDROCHRONO_HAVE_VSG
16+
@HC_HAS_VSG@
17+
18+
// Path to HydroChrono data directory
19+
@HC_DATA_DIR@
20+
21+
// Path to Chrono data directory
22+
@CH_DATA_DIR@
23+
24+
#endif

0 commit comments

Comments
 (0)