From a6ffe30e1901d33a318f65ef0c1464628d6a1c8a Mon Sep 17 00:00:00 2001 From: sksat Date: Sat, 4 May 2024 02:02:12 +0900 Subject: [PATCH 1/2] make ExtLibraries/cspice configure command configurable --- ExtLibraries/cspice/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ExtLibraries/cspice/CMakeLists.txt b/ExtLibraries/cspice/CMakeLists.txt index 43b879ee9..24bb5b3db 100644 --- a/ExtLibraries/cspice/CMakeLists.txt +++ b/ExtLibraries/cspice/CMakeLists.txt @@ -25,11 +25,13 @@ elseif(APPLE) # APPLE Silicon set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacM1_OSX_clang_64bit/packages/cspice.tar.Z) set(CSPICE_SHA256 "0deae048443e11ca4d093cac651d9785d4f2594631a183d85a3d58949f4d0aa9") + set(CSPICE_CONFIGURE_COMMAND "") set(CSPICE_BUILD_COMMAND "") else() # APPLE Intel set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z) set(CSPICE_SHA256 "6f4980445fee4d363dbce6f571819f4a248358d2c1bebca47e0743eedfe9935e") + set(CSPICE_CONFIGURE_COMMAND "") set(CSPICE_BUILD_COMMAND "") endif() else() @@ -37,10 +39,12 @@ else() if(BUILD_64BIT) set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z) set(CSPICE_SHA256 "60a95b51a6472f1afe7e40d77ebdee43c12bb5b8823676ccc74692ddfede06ce") + set(CSPICE_CONFIGURE_COMMAND "") set(CSPICE_BUILD_COMMAND "") else() set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z) set(CSPICE_SHA256 "33d75cd94acf6546e53d7ebc4e7d3d6d42ac27c83cb0d8f04c91a8b50c1149e3") + set(CSPICE_CONFIGURE_COMMAND "") set(CSPICE_BUILD_COMMAND "") endif() endif() @@ -51,7 +55,7 @@ ExternalProject_Add(cspice URL_HASH SHA256=${CSPICE_SHA256} # DOWNLOAD_EXTRACT_TIMESTAMP false # prepare for CMake 3.24 SOURCE_DIR "cspice" - CONFIGURE_COMMAND "" + CONFIGURE_COMMAND ${CSPICE_CONFIGURE_COMMAND} BUILD_IN_SOURCE true BUILD_COMMAND "${CSPICE_BUILD_COMMAND}" INSTALL_COMMAND "" From faf57c615980bb353926cfda23c08a896d912a86 Mon Sep 17 00:00:00 2001 From: sksat Date: Sat, 4 May 2024 02:07:07 +0900 Subject: [PATCH 2/2] support cspice unix64 installation on non-x86_64 environment --- ExtLibraries/cspice/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ExtLibraries/cspice/CMakeLists.txt b/ExtLibraries/cspice/CMakeLists.txt index 24bb5b3db..7ee4010b0 100644 --- a/ExtLibraries/cspice/CMakeLists.txt +++ b/ExtLibraries/cspice/CMakeLists.txt @@ -41,6 +41,15 @@ else() set(CSPICE_SHA256 "60a95b51a6472f1afe7e40d77ebdee43c12bb5b8823676ccc74692ddfede06ce") set(CSPICE_CONFIGURE_COMMAND "") set(CSPICE_BUILD_COMMAND "") + + # If we build on aarch64 linux, we cannot use binary package. Let's (super-slow) build + if(NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") + # super remove no-need compile option + set(CSPICE_CONFIGURE_COMMAND find . -type f -exec sed -i "s/-m64//g" {} +) + + # build cspice by host C-compiler with original build logic + set(CSPICE_BUILD_COMMAND "./makeall.csh") + endif() else() set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_32bit/packages/cspice.tar.Z) set(CSPICE_SHA256 "33d75cd94acf6546e53d7ebc4e7d3d6d42ac27c83cb0d8f04c91a8b50c1149e3")