@@ -151,9 +151,14 @@ def validate_cmdstan_path(path: str) -> None:
151151 """
152152 if not os .path .isdir (path ):
153153 raise ValueError (f'No CmdStan directory, path { path } does not exist.' )
154+ if not os .path .isfile (os .path .join (path , "makefile" )):
155+ raise ValueError (
156+ 'CmdStan folder does not contain "makefile". '
157+ f'Are you sure this is the correct path: { path } ?'
158+ )
154159 if not os .path .exists (os .path .join (path , 'bin' , 'stanc' + EXTENSION )):
155160 raise ValueError (
156- 'CmdStan installataion missing binaries. '
161+ f 'CmdStan installataion missing binaries in { path } /bin . '
157162 'Re-install cmdstan by running command "install_cmdstan '
158163 '--overwrite", or Python code "import cmdstanpy; '
159164 'cmdstanpy.install_cmdstan(overwrite=True)"'
@@ -299,7 +304,7 @@ def cxx_toolchain_path(
299304 if os .path .exists (os .path .join (toolchain_root , 'mingw64' )):
300305 compiler_path = os .path .join (
301306 toolchain_root ,
302- 'mingw64' if (sys .maxsize > 2 ** 32 ) else 'mingw32' ,
307+ 'mingw64' if (sys .maxsize > 2 ** 32 ) else 'mingw32' ,
303308 'bin' ,
304309 )
305310 if os .path .exists (compiler_path ):
@@ -323,7 +328,7 @@ def cxx_toolchain_path(
323328 elif os .path .exists (os .path .join (toolchain_root , 'mingw_64' )):
324329 compiler_path = os .path .join (
325330 toolchain_root ,
326- 'mingw_64' if (sys .maxsize > 2 ** 32 ) else 'mingw_32' ,
331+ 'mingw_64' if (sys .maxsize > 2 ** 32 ) else 'mingw_32' ,
327332 'bin' ,
328333 )
329334 if os .path .exists (compiler_path ):
@@ -375,7 +380,7 @@ def cxx_toolchain_path(
375380 if version not in ('35' , '3.5' , '3' ):
376381 compiler_path = os .path .join (
377382 toolchain_root ,
378- 'mingw64' if (sys .maxsize > 2 ** 32 ) else 'mingw32' ,
383+ 'mingw64' if (sys .maxsize > 2 ** 32 ) else 'mingw32' ,
379384 'bin' ,
380385 )
381386 if os .path .exists (compiler_path ):
@@ -400,7 +405,7 @@ def cxx_toolchain_path(
400405 else :
401406 compiler_path = os .path .join (
402407 toolchain_root ,
403- 'mingw_64' if (sys .maxsize > 2 ** 32 ) else 'mingw_32' ,
408+ 'mingw_64' if (sys .maxsize > 2 ** 32 ) else 'mingw_32' ,
404409 'bin' ,
405410 )
406411 if os .path .exists (compiler_path ):
@@ -1361,7 +1366,7 @@ def install_cmdstan(
13611366 logger .warning ('CmdStan installation failed.\n %s' , str (e ))
13621367 return False
13631368
1364- set_cmdstan_path (args .dir )
1369+ set_cmdstan_path (os . path . join ( args .dir , f"cmdstan- { args . version } " ) )
13651370
13661371 return True
13671372
0 commit comments