vtopt / DelaunaySparse

Interpolation via a Sparse Subset of the Delaunay Triangulation

Home Page:https://vtopt.github.io/DelaunaySparse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python bindings not creating delsparse_clib.so

gillette7 opened this issue · comments

I'm now encountering this error when trying to run example.py from the python subfolder. The first part are slatec errors, which are explained in Issue # 8. The issue here is that (possibly because of that?) it's not creating the file delsparsee_clib.so, which is required for the python bindings to work. Here's the error; system info at the bottom of the issue:

$ python example.py 
Running command
   gfortran -fPIC -shared -O3 -fopenmp -std=legacy delsparse_src/blas.f delsparse_src/lapack.f delsparse_src/real_precision.f90 delsparse_src/slatec.f delsparse_src/delsparse.f90 delsparse_src/delsparse_bind_c.f90 -o /Users/gillette7/Desktop/dataqual - results/delSp-repo/DelaunaySparse/python/delsparse_clib.so
delsparse_src/slatec.f:953:24:

  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2   
......
  953 |          CALL DCOPY (N, WS, 1, X, 1)
      |                        1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
delsparse_src/slatec.f:965:25:

  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2    
......
  965 |       CALL DCOPY (KRANK, W, MDW+1, WS(N2), 1)
      |                         1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-2)
delsparse_src/slatec.f:3040:25:

  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2    
......
 3040 |             CALL DCOPY(N,X,0,X,1)
      |                         1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
delsparse_src/slatec.f:3955:28:

  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2       
......
 3955 |          CALL DCOPY (NSOLN, Z, 1, X, 1)
      |                            1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
delsparse_src/slatec.f:4123:25:

  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2    
......
 4123 |       CALL DCOPY (NSOLN, Z, 1, X, 1)
      |                         1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
delsparse_src/slatec.f:595:26:

  595 |   160 CALL DCOPY (KRANKE, W, MDW+1, WS(KRANKE+1), 1)
      |                          1
......
  860 |       CALL DCOPY (N, 0.D0, 0, WS, 1)
      |                     2     
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-2)
gfortran: error: -E or -x required when input is from standard input
Traceback (most recent call last):
  File "example.py", line 3, in <module>
    import delsparse
  File "/Users/gillette7/Desktop/dataqual - results/delSp-repo/DelaunaySparse/python/delsparse.py", line 51, in <module>
    delsparse_clib = ctypes.CDLL(path_to_lib)
  File "/opt/miniconda3/envs/gbcNN/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/gillette7/Desktop/dataqual - results/delSp-repo/DelaunaySparse/python/delsparse_clib.so, 6): image not found

MacOS BigSur 11.7.6
intel processor
$ gfortran --version
GNU Fortran (Homebrew GCC 13.1.0) 13.1.0
$ python --version
Python 3.7.11
Running in a conda env

Likely this is a gfortran issue as I am able to run on a linux machine that has
$ gfortran --version
GNU Fortran (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

Any fix welcome, even if it's just advice on how to compel the use of an older version of gfortran.

This one looks like it's failing because there's whitespace in your path and no double quotes around the '-o' parameter for compilation. You should be able to
'cd' into the directory of the file that's running that compilation command and run it from the terminal yourself, just add '"' around the output path.

or even easier... if possible, you could also change the name of that directory so it doesn't contain any whitespace, right?

You know... I wondered if that was the issue but didn't think to check. Resolved the problem. Thanks!