ut-issl / s2e-core

Spacecraft Simulation Environment Core codes
MIT License
45 stars 17 forks source link

ExtLibraries build failed on Visual Studio 2022 #214

Open sksat opened 1 year ago

sksat commented 1 year ago

Overview

SSIA

Details

Description

reported from @Yoshiki-Iwasa error log:

ExtLibraries install dir: C:/Users/iwasa/SILS/S2E/s2e_core_oss/ExtLibraries/../../ExtLibraries/
downloading SpaceWeather-v1.2.txt
install nrlmsise to C:/Users/iwasa/SILS/S2E/s2e_core_oss/ExtLibraries/../../ExtLibraries//nrlmsise00
URLhttp://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Windows_VisualC_32bit/packages/cspice.zip
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.23/Modules/ExternalProject.cmake:2650 (message):
  URL_HASH is set to

    SHA256=bc566e6a975c888fc5fd89d76554329501446bda88c8bab937c0725faead170f;DOWNLOAD_EXTRACT_TIMESTAMP;false

  but must be ALGO=value where ALGO is

    MD5|SHA1|SHA224|SHA256|SHA384|SHA512|SHA3_224|SHA3_256|SHA3_384|SHA3_512

  and value is a hex string.
Call Stack (most recent call first):
  C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.23/Modules/ExternalProject.cmake:3640 (_ep_add_download_command)
  cspice/CMakeLists.txt:29 (ExternalProject_Add)
-- Configuring incomplete, errors occurred!

Conditions of occurrence

Additional information

files, link, etc, if any.

Task

Scope of influence

eg. All tools are not working.

Supplement

Write additional comments if you need.

Note

sksat commented 1 year ago

問題が発生しているのはここ https://github.com/ut-issl/s2e-core/blob/ec8d0aa15000e8e1067da07d5c5aede6e5914b1a/ExtLibraries/cspice/CMakeLists.txt#L29-L38

sksat commented 1 year ago

URL_HASHがおかしくなってるのかと思ったけれど,本当の問題は直後のDOWNLOAD_EXTRACT_TIMESTAMP.これがCMake 3.24からの機能だった. https://cmake.org/cmake/help/latest/module/ExternalProject.html

DOWNLOAD_EXTRACT_TIMESTAMP New in version 3.24. When specified with a true value, the timestamps of the extracted files will match those in the archive. When false, the timestamps of the extracted files will reflect the time at which the extraction was performed. If the download URL changes, timestamps based off those in the archive can result in dependent targets not being rebuilt when they potentially should have been. Therefore, unless the file timestamps are significant to the project in some way, use a false value for this option. If DOWNLOAD_EXTRACT_TIMESTAMP is not given, the default is false. See policy CMP0135.

sksat commented 1 year ago

対処案としては,

があり,できれば前者で行きたいものの, Visual Studio 2022でCMakeが3.23の環境が存在しているので難しい.

sksat commented 1 year ago

https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html CMake Visual Studio 17 2022 Generatorが

New in version 3.21.

とのことなので,3.21からもあり得るか

Yoshiki-Iwasa commented 1 year ago

build後の cmake --install でなぜかCドライブ直下に ExtLibrariesがインストールされる事象もありましたね

sksat commented 1 year ago

あれは絶対パスを指定すべきやつでしたねたぶん(Windowsのパス周りは渋いので......)

Yoshiki-Iwasa commented 1 year ago

ふむー じゃあこのissueのスコープとはまた違いそうですね

sksat commented 1 year ago

ですね(まあいずれにしろドキュメントは書かないといけない)

KOBA789 commented 1 year ago

参考情報: