AMGX
AMGX copied to clipboard
pyamgx built against HEAD raises `undefined symbol: omp_get_num_threads`
$ python test_amgx.py
Traceback (most recent call last):
File "/data/guyer/fipy/test_amgx.py", line 5, in <module>
import pyamgx
ImportError: /toolbox/guyer/AMGX/build/libamgxsh.so: undefined symbol: omp_get_num_threads
It works with AMGX v2.3.0
test_amgx.py
is pyamgx demo code.
Obviously could be a pyamgx issue, and I've reported shwina/pyamgx#33, but pyamgx doesn't have this symbol
AMGX's CMake doesn't have explicit dependency on OMP. What is cmake configuration did you use to build AMGX?
What is cmake configuration did you use to build AMGX?
$ cmake \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCUDA_ARCH="60" ..
I have had the same issue this week. I have a dual-boot system, and with AMGX built using cmake 3.23 under windows11/wsl2/ubuntu, pyamgx ran fine. Under Ubuntu 22.04 latest, I built AMGX using cmake 3.22, and pyamgx gave the gomp error. My guess is that this is a cmake issue.
The quick ugly hack to get pyamgx running, assuming pyamgx is already installed, is to:
- delete the "build" folder (at least the contents) in the pyamgx source
- run (with your directory path equivalents) AMGX_DIR=~/Downloads/AMGX-main CFLAGS=-I~/Downloads/AMGX-main/include LDFLAGS="-L/lib/x86_64-linux-gnu/ -lgomp" python setup.py build_ext --library-dirs=/lib/x86_64-linux-gnu/ --libraries=gomp
- copy the resulting shared library and then replace the library file in the pyamgx install directory.
pyamgx is running fine under Ubuntu now