cmdstanpy: install_cmdstan fails on W10

Summary:

Running python bin/install_cmdstan fails on Windows 10.

Tested with conda install m2w64-toolchain -c msys2 and MAKE=mingw32-make

and

RTools35

Description:

Trying to install on W10 leads to errors :

...
bin/cmdstan/stanc.o:stanc.cpp:(.text+0x13d4e): undefined reference to `stan::lang::block_var_decl::type() const'
...
bin/cmdstan/stanc.o:stanc.cpp:(.text$_ZN5boost6detail7variant15backup_assignerINS_7variantINS_17recursive_wrapperIN4stan4lang3nilEEEINS4_INS6_11int_literalEEENS4_INS6_14double_literalEEENS4_INS6_10array_exprEEENS4_INS6_11matrix_exprEEENS4_INS6_15row_vector_exprEEENS4_INS6_8variableEEENS4_INS6_3funEEENS4_INS6_12integrate_1dEEENS4_INS6_13integrate_odeEEENS4_INS6_21integrate_ode_controlEEENS4_INS6_14algebra_solverEEENS4_INS6_22algebra_solver_controlEEENS4_INS6_8map_rectEEENS4_INS6_8index_opEEENS4_INS6_15index_op_slicedEEENS4_INS6_14conditional_opEEENS4_INS6_9binary_opEEENS4_INS6_8unary_opEEEEEEE14construct_implISY_EEvPvPKv[_ZN5boost6detail7variant15backup_assignerINS_7variantINS_17recursive_wrapperIN4stan4lang3nilEEEINS4_INS6_11int_literalEEENS4_INS6_14double_literalEEENS4_INS6_10array_exprEEENS4_INS6_11matrix_exprEEENS4_INS6_15row_vector_exprEEENS4_INS6_8variableEEENS4_INS6_3funEEENS4_INS6_12integrate_1dEEENS4_INS6_13integrate_odeEEENS4_INS6_21integrate_ode_controlEEENS4_INS6_14algebra_solverEEENS4_INS6_22algebra_solver_controlEEENS4_INS6_8map_rectEEENS4_INS6_8index_opEEENS4_INS6_15index_op_slicedEEENS4_INS6_14conditional_opEEENS4_INS6_9binary_opEEENS4_INS6_8unary_opEEEEEEE14construct_implISY_EEvPvPKv]+0x26): undefined reference to `stan::lang::map_rect::map_rect(stan::lang::map_rect const&)'
...
collect2.exe: error: ld returned 1 exit status
make: *** [make/stanc:23: bin/stanc.exe] Error 1

Additional Information:

I have probably fixed this before, but currently, I don’t remember what I did, so I added this issue and at the same time we can document the fix.

Works fine with Ubuntu 18

Current Version:

cmdstanpy master cmdstan 2.20

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (17 by maintainers)

Most upvoted comments

hmm, looks like we need more documentation on function install_cxx_toolchain - https://github.com/stan-dev/cmdstanpy/blob/master/cmdstanpy/install_cxx_toolchain.py (unit tests here: https://github.com/stan-dev/cmdstanpy/blob/master/test/test_cxx_installation.py)

try this:

from cmdstanpy import install_cxx_toolchain
config = install_cxx_toolchain.get_config('C:\\RTools', True)
install_cxx_toolchain.get_toolchain_name()

Yes.

I hope in future we can have those few missing tools from conda, so we would not need to recommend different environments for pystan and cmdstanpy.