s2e-core icon indicating copy to clipboard operation
s2e-core copied to clipboard

ExtLibraries build failed on Visual Studio 2022

Open sksat opened this issue 3 years ago • 9 comments

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

  • Visual Studio 2022
  • CMake 3.23

Additional information

files, link, etc, if any.

Task

  • [ ] Fix xxx
  • [ ] Do yyy

Scope of influence

eg. All tools are not working.

Supplement

Write additional comments if you need.

Note

  • If there are related Projects, tie them together.
  • Set priority label if possible.
  • Assignees should be set if possible.
  • Write a conclusion when closing the issue.

sksat avatar Oct 28 '22 06:10 sksat

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

sksat avatar Oct 28 '22 06:10 sksat

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 avatar Oct 28 '22 07:10 sksat

対処案としては,

  • cmake_minimum_requiredを3.24に上げる
  • DOWNLOAD_EXTRACT_TIMESTAMPを使うのを一旦やめる

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

sksat avatar Oct 28 '22 07:10 sksat

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からもあり得るか

sksat avatar Oct 28 '22 07:10 sksat

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

Yoshiki-Iwasa avatar Oct 28 '22 08:10 Yoshiki-Iwasa

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

sksat avatar Oct 28 '22 08:10 sksat

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

Yoshiki-Iwasa avatar Oct 28 '22 08:10 Yoshiki-Iwasa

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

sksat avatar Oct 28 '22 08:10 sksat

参考情報:

  • jammy(22.04)は 3.22.1
  • kinetic(22.10)だと 3.24.2

KOBA789 avatar Dec 30 '22 03:12 KOBA789