Issue about library Hi-CLASS and Python3.9 (both built from macOS Intel API) : segfault on a script

115 Views Asked by At

have a problem with a unique python3.9 interpreter on 2 codes :

the first one works fine and not the second one.

I have installed on MacOS 14.0 all the Intel oneapi framework.

Then, I have compiled the library " hi_classy.cpython-39-darwin.so" from Hi-CLASS Boltzmann code ( https://miguelzuma.github.io/hi_class_public/ )

With "-qopenmp" flag for the compilation, it depends on :

# 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)

As you can see, there is a " libomp.dylib " dependance.

You can also see it in attachment.

For the original library, I have the following dependances :

# 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.)

For most of all my python scripts, there is no problem with that dependance but with a script, I have always a segmentation fault whereas  if I take the original version (no "-qopenmp" flag, everythig works fine.

So, I am looking for someone that can help me to circumdent this issue.

The goal is to get a uique libray that makes work the 2 codes.

I tried to build a unique hi-classy library but I have still get this segmentation fault

1

There are 1 best solutions below

0
Andrey Volodin On

you may like to try to set stacksize environmental parameters Examples

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

To show current evnironmental settings:

export OMP_DISPLAY_ENV=true
 ulimit -a 

To set:

export OMP_STACKSIZE=16M

for MacOS:

  ulimit -s hard

for non Mac OS

ulimit -s unlimited

References:

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