debug ( " %s ", e ) return None if not os. info ( 'No CmdStan installation found.' ) get_logger (). join ( cmdstan_path (), 'makefile' ) except ValueError as e : get_logger (). Lenient behavoir required for CI tests, per comment: """ try : makefile = os. If CmdStan installation is not found or cannot parse version from makefile logs warning and returns None. def cmdstan_version () -> Optional ]: """ Parses version string out of CmdStan makefile variable CMDSTAN_VERSION, returns Tuple(Major, minor). ' 'Re-install cmdstan by running command "install_cmdstan ' '-overwrite", or Python code "import cmdstanpy ' 'cmdstanpy.install_cmdstan(overwrite=True)"' ) lower () != "false" : url_end = f 'v /bin. system () = "Linux" : arch = determine_linux_arch () if arch and arch. get ( "CMDSTAN_ARCH", "" ) if not arch and platform. stdout : arch = "armel" else : arch = "armhf" elif machine = "mips64" : arch = "mips64el" elif machine = "ppc64el" or machine = "ppc64le" : arch = "ppc64el" elif machine = "s390x" : arch = "s390x" return arch def get_download_url ( version : str ) -> str : arch = os. PIPE, text = True, ) if "Tag_ABI_VFP_args" in readelf. run (, check = True, stdout = subprocess. machine () arch = "" if machine = "aarch64" : arch = "arm64" elif machine = "armv7l" : # Telling armel and armhf apart is nontrivial # c.f. system () = 'Windows' else '' def determine_linux_arch () -> str : machine = platform. logging import get_logger EXTENSION = '.exe' if platform. """ Utilities for finding and installing CmdStan """ import os import platform import subprocess import sys from collections import OrderedDict from typing import Callable, Dict, Optional, Tuple, Union from to import tqdm from cmdstanpy import _DOT_CMDSTAN from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |