有关 Hi-CLASS 库和 Python3.9 的问题(均由 macOS Intel API 构建):脚本上的段错误

问题描述 投票:0回答:1

独特的 python3.9 解释器对 2 个代码有问题:

第一个工作正常,第二个则不行。

我已经在 MacOS 14.0 上安装了所有 Intel oneapi 框架。

然后,我从 Hi-CLASS Boltzmann 代码编译了库“ hi_classy.cpython-39-darwin.so”(https://miguelzuma.github.io/hi_class_public/

使用“-qopenmp”标志进行编译,它取决于:

# otool -L hi_classy.cpython-39-darwin.so

hi_classy.cpython-39-darwin.so:

@rpath/libomp.dylib (compatibility version 5, current version 5.)

@rpath/libc++.1.dylib (compatibility version 1. current version 1.)

/usr/lib/libSystem.B.dylib (compatibility version 1. current version 1311)

如您所见,存在“libomp.dylib”依赖性。

您也可以在附件中看到。

对于原始库,我有以下依赖项:

# otool -L hi_classy.cpython-39-darwin.so_SAVE_ORIGINAL

hi_classy.cpython-39-darwin.so_SAVE_ORIGINAL:

@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.)

对于我的大多数 python 脚本来说,这种依赖性没有问题,但对于脚本,我总是遇到分段错误,而如果我采用原始版本(没有“-qopenmp”标志,则一切正常。

所以,我正在寻找可以帮助我解决这个问题的人。

我们的目标是获得一个独特的库,使这两个代码能够工作。

我尝试构建一个独特的高级库,但我仍然遇到这个分段错误

python python-3.x openmp intel intel-oneapi
1个回答
0
投票

您可能想尝试设置 stacksize 环境参数 例子

setenv OMP_STACKSIZE 2000500B 
setenv OMP_STACKSIZE "3000 k " 
setenv OMP_STACKSIZE 10M 
setenv OMP_STACKSIZE " 10 M " 
setenv OMP_STACKSIZE "20 m " 
setenv OMP_STACKSIZE " 1G" 
setenv OMP_STACKSIZE 20000

显示当前环境设置:

export OMP_DISPLAY_ENV=true
 ulimit -a 

设置:

export OMP_STACKSIZE=16M

对于 MacOS:

  ulimit -s hard

适用于非 Mac 操作系统

ulimit -s unlimited

参考资料:

https://depts.washington.edu/clawpack/sampledocs/v570_docs/v5.3.0/openmp.html https://www.openmp.org/spec-html/5.0/openmpse54.html#:~:text=%20OMP_STACKSIZE%20environment%20variable%20controls,stack%20for%20an%20initial%20thread.

© www.soinside.com 2019 - 2024. All rights reserved.