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

Update s2e-core v8 #102

Merged
merged 26 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
ls cspice/include
ls cspice/generic_kernels
ls nrlmsise00
ls nrlmsise00/table
ls nrlmsise00/lib
ls nrlmsise00/lib/libnrlmsise00.lib
ls nrlmsise00/src
Expand Down Expand Up @@ -180,7 +179,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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CMakeBuilds/
.vs/

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

# ExtLibraries
ExtLibraries/
Expand All @@ -30,3 +30,9 @@ build/
# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Setting files
settings/environment/cspice
settings/environment/space_weather
settings/environment/gravity_field
settings/environment/star_catalogue
79 changes: 55 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ cmake_policy(SET CMP0048 NEW)
project(S2E_AOBC
LANGUAGES CXX
DESCRIPTION "S2E_AOBC"
VERSION 5.0.4
VERSION 6.0.0
)

cmake_minimum_required(VERSION 3.13)

# build config
option(USE_HILS "Use HILS" OFF)
option(USE_C2A "Use C2A" ON)
option(USE_C2A_COMMAND_SENDER "Use command sender to C2A" ON)

# Mac user setting
option(APPLE_SILICON "Build with Apple Silicon" OFF)
# Force build with 64bit for APPLE
if(APPLE)
option(BUILD_64BIT "Build 64bit" ON)
endif()

# preprocessor
if(WIN32)
Expand All @@ -33,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/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 @@ -80,8 +88,12 @@ add_subdirectory(${S2E_CORE_DIR}/src/disturbances s2e_core/disturbances)
add_subdirectory(${S2E_CORE_DIR}/src/dynamics s2e_core/dynamics)
add_subdirectory(${S2E_CORE_DIR}/src/environment/global s2e_core/environment/global)
add_subdirectory(${S2E_CORE_DIR}/src/environment/local s2e_core/environment/local)
add_subdirectory(${S2E_CORE_DIR}/src/library s2e_core/library)
add_subdirectory(${S2E_CORE_DIR}/src/logger s2e_core/logger)
add_subdirectory(${S2E_CORE_DIR}/src/math_physics s2e_core/math_physics)
add_subdirectory(${S2E_CORE_DIR}/src/setting_file_reader s2e_core/setting_file_reader)
add_subdirectory(${S2E_CORE_DIR}/src/simulation s2e_core/simulation)
add_subdirectory(${S2E_CORE_DIR}/src/utilities s2e_core/utilities)
add_subdirectory(${S2E_CORE_DIR}/ExtLibraries/inih)

# Add all cpp files as SOURCE_FILES
file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
Expand All @@ -92,25 +104,44 @@ list(FILTER SOURCE_FILES EXCLUDE REGEX ${CMAKE_CURRENT_LIST_DIR}/src/component/a
add_executable(${PROJECT_NAME} ${SOURCE_FILES})

## cspice library
if(CYGWIN)
if(APPLE)
if(APPLE_SILICON)
# APPLE Silicon
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_apple_silicon64/lib)
else()
# APPLE Intel
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_apple_intel64/lib)
endif()
elseif(CYGWIN)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
find_library(CSPICE_LIB
NAMES cspice.a csupport.a
PATHS ${CSPICE_DIR}/cspice_cygwin/lib)
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_cygwin/lib)
elseif(UNIX)
find_library(CSPICE_LIB
NAMES cspice.a csupport.a
PATHS ${CSPICE_DIR}/cspice_unix/lib)
elseif(WIN32)
if(BUILD_64BIT)
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_unix64/lib)
else()
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_unix/lib)
endif()
endif()

if(WIN32)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
if(BUILD_64BIT)
find_library(CSPICE_LIB
NAMES cspice.lib csupport.lib
PATHS ${CSPICE_DIR}/cspice_msvs64/lib)
else()
find_library(CSPICE_LIB
NAMES cspice.lib csupport.lib
PATHS ${CSPICE_DIR}/cspice_msvs/lib)
endif()
else()
find_library(CSPICE_LIB
NAMES cspice.lib csupport.lib
PATHS ${CSPICE_DIR}/cspice_msvs/lib)
NAMES cspice.a csupport.a
PATHS ${CSPICE_LIB_DIR})
endif()
if(NOT CSPICE_LIB)
message(FATAL_ERROR "cspice not found in ${EXT_LIB_DIR}")
message(FATAL_ERROR "cspice not found in ${CSPICE_LIB_DIR}")
endif()
#target_link_libraries(${PROJECT_NAME} ${CSPICE_LIB})

## nrlmsise00 library
if(CYGWIN)
Expand All @@ -131,20 +162,20 @@ endif()
if(NOT NRLMSISE00_LIB)
message(FATAL_ERROR "nrlmsise00 not found in ${EXT_LIB_DIR}")
endif()
#target_link_libraries(${PROJECT_NAME} ${NRLMSISE00_LIB})

## Linking libraries
set(S2E_LIBRARIES
IGRF WRAPPER_NRLMSISE00 INIH SGP4 UTIL OPTICS RELATIVE_ORBIT_MODELS ORBIT_MODELS GEODESY MATH
)
# 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

This file was deleted.

3 changes: 0 additions & 3 deletions data/initialize_files/scenario/scenario.ini

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion s2e-core
Submodule s2e-core updated 450 files
Empty file.
Empty file.
File renamed without changes.
Empty file.
Empty file.
Loading
Loading