NVIDIA / AMGX

Distributed multigrid linear solver library on GPU
487 stars 141 forks source link

pyamgx built against HEAD raises `undefined symbol: omp_get_num_threads` #196

Open guyer opened 2 years ago

guyer commented 2 years ago
$ 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 commented 2 years ago

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

marsaev commented 2 years ago

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

guyer commented 2 years ago

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" ..
braidedlogix commented 2 years ago

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