Skip to content

Commit

Permalink
Merge pull request #704 from ut-issl/develop
Browse files Browse the repository at this point in the history
develop merge to main for major version update v8
  • Loading branch information
200km authored Oct 3, 2024
2 parents a9a6962 + 6ca93ed commit 1c0256a
Show file tree
Hide file tree
Showing 450 changed files with 7,671 additions and 6,028 deletions.
61 changes: 42 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: cache extlib
id: cache-extlib
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: extlib-${{ runner.os }}-${{ hashFiles('./ExtLibraries/**') }}-${{ matrix.build_bit }}
path: ./ExtLibraries
Expand Down Expand Up @@ -90,6 +90,7 @@ jobs:
working-directory: ./ExtLibraries
run: |
cmake --install .
- name: check extlib
shell: powershell
working-directory: ./ExtLibraries
Expand All @@ -99,38 +100,48 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.lib
ls nrlmsise00/src
- name: copy to settings
if: steps.cache-extlib.outputs.cache-hit == 'true'
shell: powershell
run: |
ls ./settings/environment/cspice
cp -r "./ExtLibraries/cspice/generic_kernels" "./settings/environment/cspice"
ls ./settings/environment/cspice
ls ./settings/environment/cspice/generic_kernels/lsk
ls ./settings/environment/cspice/generic_kernels/pck
ls ./settings/environment/cspice/generic_kernels/spk
- name: build 32bit
if: matrix.build_bit == 'BUILD_64BIT=OFF'
shell: cmd
run: |
cl.exe
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DEXT_LIB_DIR=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake --build .
- name: build 64bit
if: matrix.build_bit == 'BUILD_64BIT=ON' && matrix.use_c2a == 'USE_C2A=OFF'
shell: cmd
run: |
cl.exe
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DEXT_LIB_DIR=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DFLIGHT_SW_DIR=./c2a-core -DC2A_NAME=Examples/minimum_user -D${{ matrix.use_c2a }} -D${{ matrix.build_bit }}
cmake --build .
- name: fix simulation config
shell: bash
working-directory: ./data/sample/initialize_files
working-directory: ./settings
run: |
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/..\/ExtLibraries/..\/..\/ExtLibraries/g' {} \;
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/logs/.\/logs/g' {} \;
- name: run simulation(SampleSat)
if: matrix.build_bit == 'BUILD_64BIT=OFF' || (matrix.build_bit == 'BUILD_64BIT=ON' && matrix.use_c2a == 'USE_C2A=OFF')
working-directory: ./data/sample
working-directory: ./
run: |
..\..\Debug\S2E.exe
.\Debug\S2E.exe
build_s2e_linux:
name: Build on Linux
Expand All @@ -149,8 +160,8 @@ jobs:
run: |
COMPILER="${{ matrix.compiler }}"
read -r -a COMPILER <<< "$COMPILER"
echo "::set-output name=CC::${COMPILER[0]}"
echo "::set-output name=CXX::${COMPILER[1]}"
echo "CC=${COMPILER[0]}" >> "$GITHUB_OUTPUT"
echo "CXX=${COMPILER[1]}" >> "$GITHUB_OUTPUT"
- name: install deps
run: |
Expand All @@ -174,7 +185,7 @@ jobs:
- name: cache extlib
id: cache-extlib
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: extlib-${{ runner.os }}-${{ hashFiles('./ExtLibraries/**') }}-${{ matrix.build_bit }}
path: ExtLibraries
Expand All @@ -190,6 +201,7 @@ jobs:
working-directory: ./ExtLibraries
run: |
cmake --install .
- name: check extlib
working-directory: ./ExtLibraries
run: |
Expand All @@ -198,35 +210,45 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.a
ls nrlmsise00/src
- name: copy to settings
if: steps.cache-extlib.outputs.cache-hit == 'true'
run: |
ls ./settings/environment/cspice
cp -r "./ExtLibraries/cspice/generic_kernels" "./settings/environment/cspice"
ls ./settings/environment/cspice
ls ./settings/environment/cspice/generic_kernels/lsk
ls ./settings/environment/cspice/generic_kernels/pck
ls ./settings/environment/cspice/generic_kernels/spk

- name: build
env:
CC: ${{ steps.compiler.outputs.CC }}
CXX: ${{ steps.compiler.outputs.CXX }}
run: |
cmake . -DEXT_LIB_DIR=./ExtLibraries -D${{ matrix.build_bit }}
cmake . -DEXT_LIB_DIR=./ExtLibraries -DEXT_LIB_DIR_FROM_EXE=./ExtLibraries -DSETTINGS_DIR_FROM_EXE=./settings -DCORE_DIR_FROM_EXE=./ -D${{ matrix.build_bit }}
cmake --build .
- name: fix simulation config
working-directory: ./data/sample/initialize_files
working-directory: ./settings
run: |
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/..\/ExtLibraries/..\/..\/ExtLibraries/g' {} \;
find . -type f -name '*.ini' -exec sed -i 's/..\/..\/logs/.\/logs/g' {} \;
- name: run simulation(SampleSat)
working-directory: ./data/sample
working-directory: ./
run: |
../../S2E
./S2E
- name: generate graph
working-directory: ./scripts/Plot
run: |
sudo apt-get install -y gnuplot
pip3 install yq
LOG=$(ls ../../data/sample/logs/logs_*/*.csv)
LOG=$(ls ../../logs/logs_*/*.csv)
echo "plot $LOG"
./gen_graph.sh "${LOG}"
ls
Expand All @@ -239,7 +261,7 @@ jobs:
ver=$(grep python_version ./Pipfile | sed -e 's/^python_version\s=\s"\(.*\)"$/\1/')
echo "version=$ver" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v5.0.0
- uses: actions/setup-python@v5.2.0
with:
python-version: ${{ steps.python-version.outputs.version }}

Expand All @@ -248,6 +270,7 @@ jobs:
run: |
pip install pipenv
pipenv install
pipenv run pip list
pipenv run python plot_gs_visibility.py --no-gui
ls ./*_gs_visibility.png
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/google-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: cache extlib
id: cache-extlib
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: extlib-${{ runner.os }}-${{ hashFiles('./ExtLibraries/**') }}}
path: ExtLibraries
Expand All @@ -85,7 +85,6 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib*
ls nrlmsise00/lib*/libnrlmsise00.a
ls nrlmsise00/src
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
ver=$(grep python_version ./Pipfile | sed -e 's/^python_version\s=\s"\(.*\)"$/\1/')
echo "version=${ver}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v5.0.0
- uses: actions/setup-python@v5.2.0
with:
python-version: ${{ steps.python-version.outputs.version }}

Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ src/.vscode/
build/

# Log files
data/**/logs/
**/logs/

# CSIPCE
scripts/tmp_cspice/
Expand All @@ -34,3 +34,9 @@ Icon

# Python
__pycache__/

# Setting files
settings/environment/cspice
settings/environment/space_weather
settings/environment/gravity_field
settings/environment/star_catalogue
29 changes: 17 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13)
project(S2E
LANGUAGES CXX
DESCRIPTION "S2E: Spacecraft Simulation Environment"
VERSION 7.2.9
VERSION 8.0.0
)

# build config
Expand Down Expand Up @@ -41,8 +41,8 @@ if(NOT DEFINED C2A_NAME)
endif()

## Directory path for ini files
if(NOT DEFINED INI_FILE_DIR_FROM_EXE)
set(INI_FILE_DIR_FROM_EXE ../../data/sample/initialize_files)
if(NOT DEFINED SETTINGS_DIR_FROM_EXE)
set(SETTINGS_DIR_FROM_EXE ../../settings)
endif()

if(NOT DEFINED EXT_LIB_DIR_FROM_EXE)
Expand Down Expand Up @@ -89,7 +89,11 @@ add_subdirectory(src/environment/local)
add_subdirectory(src/dynamics)
add_subdirectory(src/disturbances)
add_subdirectory(src/components)
add_subdirectory(src/library)
add_subdirectory(src/math_physics)
add_subdirectory(src/setting_file_reader)
add_subdirectory(src/logger)
add_subdirectory(src/utilities)
add_subdirectory(ExtLibraries/inih)

set(SOURCE_FILES
src/s2e.cpp
Expand Down Expand Up @@ -178,13 +182,14 @@ endif()
#target_link_libraries(${PROJECT_NAME} ${NRLMSISE00_LIB})

# Initialize link
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION LIBRARY)
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE LIBRARY)
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LIBRARY ${NRLMSISE00_LIB})
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT MATH_PHYSICS SETTING_FILE_READER LOGGER UTILITIES)
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION MATH_PHYSICS)
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT MATH_PHYSICS)
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE MATH_PHYSICS)
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} MATH_PHYSICS)
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} MATH_PHYSICS)
target_link_libraries(MATH_PHYSICS ${NRLMSISE00_LIB})
target_link_libraries(SETTING_FILE_READER INIH)

target_link_libraries(${PROJECT_NAME} DYNAMICS)
target_link_libraries(${PROJECT_NAME} DISTURBANCE)
Expand Down Expand Up @@ -235,7 +240,7 @@ if(GOOGLE_TEST)

add_executable(${TEST_PROJECT_NAME} ${TEST_FILES})
target_link_libraries(${TEST_PROJECT_NAME} gtest gtest_main gmock)
target_link_libraries(${TEST_PROJECT_NAME} LIBRARY)
target_link_libraries(${TEST_PROJECT_NAME} MATH_PHYSICS)
include_directories(${TEST_PROJECT_NAME})
add_test(NAME s2e-test COMMAND ${TEST_PROJECT_NAME})
enable_testing()
Expand Down
6 changes: 5 additions & 1 deletion ExtLibraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ if(NOT DEFINED EXT_LIB_DIR)
set(EXT_LIB_DIR "${CMAKE_CURRENT_LIST_DIR}/../../ExtLibraries/")
endif()

if(NOT DEFINED SETTINGS_DIR)
set(SETTINGS_DIR "${CMAKE_CURRENT_LIST_DIR}/../settings/")
endif()

# windows path
string(REPLACE "\\" "/" EXT_LIB_DIR ${EXT_LIB_DIR})
string(REPLACE "\\" "/" SETTINGS_DIR ${SETTINGS_DIR})

message("ExtLibraries install dir: ${EXT_LIB_DIR}")

add_subdirectory(nrlmsise00)
add_subdirectory(cspice)
add_subdirectory(GeoPotential)
add_subdirectory(lunar_gravity_field)
11 changes: 0 additions & 11 deletions ExtLibraries/GeoPotential/CMakeLists.txt

This file was deleted.

4 changes: 3 additions & 1 deletion ExtLibraries/cspice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include(FetchContent)
set(CSPICE_INSTALL_DIR ${EXT_LIB_DIR}/cspice)
set(GENERIC_KERNEL_URL_BASE https://naif.jpl.nasa.gov/pub/naif/generic_kernels)

set(GENERIC_KERNEL_INSTALL_DIR ${SETTINGS_DIR}/environment/cspice)

if(WIN32)
# Windows
if(BUILD_64BIT)
Expand Down Expand Up @@ -118,5 +120,5 @@ configure_file(
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generic_kernels
DESTINATION ${CSPICE_INSTALL_DIR}
DESTINATION ${GENERIC_KERNEL_INSTALL_DIR}
)
9 changes: 9 additions & 0 deletions ExtLibraries/inih/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project(INIH)
cmake_minimum_required(VERSION 3.13)

add_library(${PROJECT_NAME} STATIC
ini.c
cpp/INIReader.cpp
)

include(../../common.cmake)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ExtLibraries/lunar_gravity_field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.18)

include(FetchContent)

set(LUNAR_GRAVITY_FIELD_INSTALL_DIR ${EXT_LIB_DIR}/lunar_gravity_field)
set(LUNAR_GRAVITY_FIELD_INSTALL_DIR ${SETTINGS_DIR}/environment/gravity_field)

set(LUNAR_GRAVITY_FIELD_URL_BASE https://pds-geosciences.wustl.edu/grail/grail-l-lgrs-5-rdr-v1/grail_1001/shadr)
set(LUNAR_GRAVITY_FIELD_FILE gggrx_1200a_sha.tab)
Expand Down
3 changes: 2 additions & 1 deletion ExtLibraries/nrlmsise00/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include(ExternalProject)
include(FetchContent)

set(NRLMSISE_INSTALL_DIR ${EXT_LIB_DIR}/nrlmsise00)
set(TABLE_FILE_INSTALL_DIR ${SETTINGS_DIR}/environment/space_weather)

set(NRLMSISE_TABLE_URL_BASE ftp://ftp.agi.com/pub/DynamicEarthData)
set(NRLMSISE_TABLE_FILE SpaceWeather-v1.2.txt)
Expand Down Expand Up @@ -90,5 +91,5 @@ install(FILES ${NRLMSISE_TMP_DIR}/nrlmsise-00_data.c

## install table
install(FILES ${NRLMSISE_TMP_DIR}/${NRLMSISE_TABLE_FILE}
DESTINATION ${NRLMSISE_INSTALL_DIR}/table
DESTINATION ${TABLE_FILE_INSTALL_DIR}
)
2 changes: 1 addition & 1 deletion common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${S2E_DIR}/src)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# Directory path setting
target_compile_definitions(${PROJECT_NAME} PRIVATE "INI_FILE_DIR_FROM_EXE=\"${INI_FILE_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "SETTINGS_DIR_FROM_EXE=\"${SETTINGS_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "EXT_LIB_DIR_FROM_EXE=\"${EXT_LIB_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "CORE_DIR_FROM_EXE=\"${CORE_DIR_FROM_EXE}\"")

Expand Down
Loading

0 comments on commit 1c0256a

Please sign in to comment.