SUSE HPC环境中Pystan<=2.19.1.1编译报错排查求助
背景
- 必须安装≤2.19.1.1版本的pystan才能运行指定DLM程序,无法修改程序代码
- 运行环境:HPC节点(SUSE Linux Enterprise Server 12 SP3)
- 初始尝试pip安装失败,改用Conda创建名为
pystan_env的Python3.6环境,安装gcc_linux-64、gxx_linux-64后,pystan可正常import,但执行python compile_stan_models.py编译模型时出现错误
错误信息
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_729eef6811cff55a4a17cdcb48871fe0 NOW.
Traceback (most recent call last):
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command '/home/sarahv/anaconda3/envs/pystan_env/bin/x86_64-conda-linux-gnu-cc' failed with exit status 1During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "compile_stan_models.py", line 5, in
model_vanilla_ar1 = pystan.StanModel(model_code=dlm_vanilla_ar1)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/site-packages/pystan/model.py", line 378, in init
build_extension.run()
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/sarahv/anaconda3/envs/pystan_env/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/home/sarahv/anaconda3/envs/pystan_env/bin/x86_64-conda-linux-gnu-cc' failed with exit status 1
已尝试操作
- 执行
conda install gcc、conda install gxx,问题未解决 - HPC环境无权限使用
apt-get
需求
- 解释该错误的具体原因
- 提供在当前Conda环境内解决编译失败的方法
- 提供其他可正常
import并成功编译模型的pystan安装方案
内容的提问来源于stack exchange,提问作者theWrongAlice

