AMGX icon indicating copy to clipboard operation
AMGX copied to clipboard

pyamgx built against HEAD raises `undefined symbol: omp_get_num_threads`

Open guyer opened this issue 2 years ago • 4 comments

$ 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.

guyer avatar Jul 20 '22 19:07 guyer

Obviously could be a pyamgx issue, and I've reported shwina/pyamgx#33, but pyamgx doesn't have this symbol

guyer avatar Jul 20 '22 19:07 guyer

AMGX's CMake doesn't have explicit dependency on OMP. What is cmake configuration did you use to build AMGX?

marsaev avatar Aug 01 '22 13:08 marsaev

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" ..

guyer avatar Aug 02 '22 23:08 guyer

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:

  1. delete the "build" folder (at least the contents) in the pyamgx source
  2. 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
  3. copy the resulting shared library and then replace the library file in the pyamgx install directory.

pyamgx is running fine under Ubuntu now

braidedlogix avatar Aug 10 '22 16:08 braidedlogix