mdolab / pyspline

pySpline produces B-spline curves, surfaces, and volumes
Other
39 stars 26 forks source link

Error importing libspline.so - How to solve this issue? #48

Closed rcruzfardilha99 closed 2 years ago

rcruzfardilha99 commented 2 years ago

make[1]: Entering directory '/home/bolseiros/packages/pyspline' mkdir -p obj ln -sf config/config.mk config.mk making module in src/

make[2]: Entering directory '/home/bolseiros/packages/pyspline/src' make precision.o adtProjections.o make[3]: Entering directory '/home/bolseiros/packages/pyspline/src' make[3]: '..//obj/precision.o' is up to date. make[3]: '..//obj/adtProjections.o' is up to date. make[3]: Leaving directory '/home/bolseiros/packages/pyspline/src' cp -f *.mod ../mod make evaluations.o basis.o knots.o insertKnot.o getBasisPt.o parameterizations.o findSpan.o compute_curve.o compute_surface.o compute_volume.o eval_curve.o eval_surface.o eval_volume.o projections.o tfi2d.o make[3]: Entering directory '/home/bolseiros/packages/pyspline/src' make[3]: '..//obj/evaluations.o' is up to date. make[3]: '..//obj/basis.o' is up to date. make[3]: '..//obj/knots.o' is up to date. make[3]: '..//obj/insertKnot.o' is up to date. make[3]: '..//obj/getBasisPt.o' is up to date. make[3]: '..//obj/parameterizations.o' is up to date. make[3]: '..//obj/findSpan.o' is up to date. make[3]: '..//obj/compute_curve.o' is up to date. make[3]: '..//obj/compute_surface.o' is up to date. make[3]: '..//obj/compute_volume.o' is up to date. make[3]: '..//obj/eval_curve.o' is up to date. make[3]: '..//obj/eval_surface.o' is up to date. make[3]: '..//obj/eval_volume.o' is up to date. make[3]: '..//obj/projections.o' is up to date. make[3]: '..//obj/tfi2d.o' is up to date. make[3]: Leaving directory '/home/bolseiros/packages/pyspline/src' make[2]: Leaving directory '/home/bolseiros/packages/pyspline/src' (cd lib && make) make[2]: Entering directory '/home/bolseiros/packages/pyspline/lib' creating library ...

ar -rvs libspline.a ../obj/*.o r - ../obj/adtProjections.o r - ../obj/basis.o r - ../obj/compute_curve.o r - ../obj/compute_surface.o r - ../obj/compute_volume.o r - ../obj/eval_curve.o r - ../obj/eval_surface.o r - ../obj/eval_volume.o r - ../obj/evaluations.o r - ../obj/findSpan.o r - ../obj/getBasisPt.o r - ../obj/insertKnot.o r - ../obj/knots.o r - ../obj/parameterizations.o r - ../obj/precision.o r - ../obj/projections.o r - ../obj/tfi2d.o

    library libspline.a created.

make[2]: Leaving directory '/home/bolseiros/packages/pyspline/lib' (cd src/f2py && make) make[2]: Entering directory '/home/bolseiros/packages/pyspline/src/f2py'

------------------------------------------------------

Python Inclue Flags -I/usr/include/python3.8 -I/usr/include/python3.8

------------------------------------------------------

------------------------------------------------------

Numpy Include Directory: /home/bolseiros/.local/lib/python3.8/site-packages/numpy/core/include

------------------------------------------------------

------------------------------------------------------

f2py root directory: /home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py

------------------------------------------------------

cp f2py_f2cmap.ref .f2py_f2cmap f2py pyspline.pyf Reading f2cmap from '.f2py_f2cmap' ... Mapping "real(kind=realtype)" to "double" Successfully applied user defined f2cmap changes Reading fortran codes... Reading file 'pyspline.pyf' (format:free) Post-processing... Block: libspline Block: knots_interp Block: knots_lms Block: insertknot Block: curve_jacobian_wrap Block: constr_jac Block: poly_length Block: curve_para_corr Block: surface_jacobian_wrap Block: para3d Block: tfi2d Block: volume_jacobian_wrap Block: eval_curve Block: eval_curve_deriv Block: eval_curve_deriv2 Block: eval_curve_c Block: eval_curve_deriv_c Block: eval_curve_deriv2_c Block: eval_surface Block: eval_surface_deriv Block: eval_surface_deriv2 Block: eval_volume Block: eval_volume_deriv Block: eval_volume_deriv2 Block: point_curve Block: point_surface Block: point_volume Block: curve_curve Block: curve_surface Block: point_curve_start Block: point_surface_start Block: point_volume_start Block: curve_curve_start Block: curve_surface_start Block: line_plane Block: plane_line Block: point_plane Block: getbasisptsurface Block: getbasisptvolume Block: basis Block: derivbasis Block: findspan Block: adtprojections Block: searchquads Post-processing (stage 2)... Block: libspline Block: unknown_interface Block: knots_interp Block: knots_lms Block: insertknot Block: curve_jacobian_wrap Block: constr_jac Block: poly_length Block: curve_para_corr Block: surface_jacobian_wrap Block: para3d Block: tfi2d Block: volume_jacobian_wrap Block: eval_curve Block: eval_curve_deriv Block: eval_curve_deriv2 Block: eval_curve_c Block: eval_curve_deriv_c Block: eval_curve_deriv2_c Block: eval_surface Block: eval_surface_deriv Block: eval_surface_deriv2 Block: eval_volume Block: eval_volume_deriv Block: eval_volume_deriv2 Block: point_curve Block: point_surface Block: point_volume Block: curve_curve Block: curve_surface Block: point_curve_start Block: point_surface_start Block: point_volume_start Block: curve_curve_start Block: curve_surface_start Block: line_plane Block: plane_line Block: point_plane Block: getbasisptsurface Block: getbasisptvolume Block: basis Block: derivbasis Block: findspan Block: adtprojections Block: searchquads Building modules... Building module "libspline"... Constructing wrapper function "knots_interp"... t = knots_interp(x,deriv_ptr,k,[n,nd]) Constructing wrapper function "knots_lms"... t = knots_lms(x,nctl,k,[n]) Constructing wrapper function "insertknot"... r,t_new,coef_new,ileft = insertknot(u,r,t,k,coef,[nctl,ndim]) Constructing wrapper function "curve_jacobian_wrap"... vals,row_ptr,col_ind = curve_jacobian_wrap(s,sd,t,k,nctl,vals,row_ptr,col_ind,[n,nd]) Constructing wrapper function "constr_jac"... j_val,j_col_ind,j_row_ptr = constr_jac(a_val,a_row_ptr,a_col_ind,b_val,b_row_ptr,b_col_ind,c_val,c_row_ptr,c_col_ind,an,[am,cm,annz,bnnz,cnnz]) Constructing wrapper function "poly_length"... length = poly_length(x,[n,ndim]) Constructing wrapper function "curve_para_corr"... curve_para_corr(t,k,s,coef,length,x,[nctl,ndim,n]) Constructing wrapper function "surface_jacobian_wrap"... vals,row_ptr,col_ind = surface_jacobian_wrap(u,v,tu,tv,ku,kv,nctlu,nctlv,[nu,nv]) Constructing wrapper function "para3d"... s,u,v,w = para3d(x,[n,m,l,ndim]) Constructing wrapper function "tfi2d"... x = tfi2d(e0,e1,e2,e3,[nu,nv]) Constructing wrapper function "volume_jacobian_wrap"... vals,row_ptr,col_ind = volume_jacobian_wrap(u,v,w,tu,tv,tw,ku,kv,kw,nctlu,nctlv,nctlw,[nu,nv,nw]) Constructing wrapper function "eval_curve"... val = eval_curve(s,t,k,coef,[nctl,ndim,n]) Constructing wrapper function "eval_curve_deriv"... val = eval_curve_deriv(s,t,k,coef,[nctl,ndim]) Constructing wrapper function "eval_curve_deriv2"... val = eval_curve_deriv2(s,t,k,coef,[nctl,ndim]) Constructing wrapper function "eval_curve_c"... val = eval_curve_c(s,t,k,coef,[nctl,ndim,n]) Constructing wrapper function "eval_curve_deriv_c"... val = eval_curve_deriv_c(s,t,k,coef,[nctl,ndim]) Constructing wrapper function "eval_curve_deriv2_c"... val = eval_curve_deriv2_c(s,t,k,coef,[nctl,ndim]) Constructing wrapper function "eval_surface"... val = eval_surface(u,v,tu,tv,ku,kv,coef,[nctlu,nctlv,ndim,n,m]) Constructing wrapper function "eval_surface_deriv"... val = eval_surface_deriv(u,v,tu,tv,ku,kv,coef,[nctlu,nctlv,ndim]) Constructing wrapper function "eval_surface_deriv2"... val = eval_surface_deriv2(u,v,tu,tv,ku,kv,coef,[nctlu,nctlv,ndim]) Constructing wrapper function "eval_volume"... val = eval_volume(u,v,w,tu,tv,tw,ku,kv,kw,coef,[nctlu,nctlv,nctlw,ndim,n,m,l]) Constructing wrapper function "eval_volume_deriv"... val = eval_volume_deriv(u,v,w,tu,tv,tw,ku,kv,kw,coef,[nctlu,nctlv,nctlw,ndim]) Constructing wrapper function "eval_volume_deriv2"... val = eval_volume_deriv2(u,v,w,tu,tv,tw,ku,kv,kw,coef,[nctlu,nctlv,nctlw,ndim]) Constructing wrapper function "point_curve"... s,diff = point_curve(x0,t,k,coef,niter,eps,s,[nctl,ndim]) Constructing wrapper function "point_surface"... u,v,diff = point_surface(x0,tu,tv,ku,kv,coef,niter,eps,u,v,[nctlu,nctlv,ndim]) Constructing wrapper function "point_volume"... u,v,w,diff = point_volume(x0,tu,tv,tw,ku,kv,kw,coef,niter,eps,u,v,w,[nctlu,nctlv,nctlw,ndim]) Constructing wrapper function "curve_curve"... s,t,diff = curve_curve(t1,k1,coef1,t2,k2,coef2,niter,eps,s,t,[n1,n2,ndim]) Constructing wrapper function "curve_surface"... u,v,s,diff = curve_surface(tc,kc,coefc,tu,tv,ku,kv,coefs,niter,eps,u,v,s,[nctlc,nctlu,nctlv,ndim]) Constructing wrapper function "point_curve_start"... u = point_curve_start(x0,uu,data,[nu,ndim,n]) Constructing wrapper function "point_surface_start"... u,v = point_surface_start(x0,uu,vv,data,[nu,nv,ndim,n]) Constructing wrapper function "point_volume_start"... u,v,w = point_volume_start(x0,uu,vv,ww,data,[nu,nv,nw,ndim,n]) Constructing wrapper function "curve_curve_start"... s1,s2 = curve_curve_start(data1,uu1,data2,uu2,[nu1,nu2,ndim]) Constructing wrapper function "curve_surface_start"... s,u,v = curve_surface_start(data1,uu1,data2,uu2,vv2,[nu1,nu2,nv2,ndim]) Constructing wrapper function "line_plane"... sol,pid,n_sol = line_plane(ia,vc,p0,v1,v2,[n]) Constructing wrapper function "plane_line"... sol,n_sol = plane_line(ia,vc,p0,v1,v2,[n]) Constructing wrapper function "point_plane"... sol,n_sol,best_sol = point_plane(pt,p0,v1,v2,[n]) Constructing wrapper function "getbasisptsurface"... vals,col_ind = getbasisptsurface(u,v,tu,tv,ku,kv,vals,col_ind,istart,l_index,[nctlu,nctlv,nnz]) Constructing wrapper function "getbasisptvolume"... vals,col_ind = getbasisptvolume(u,v,w,tu,tv,tw,ku,kv,kw,vals,col_ind,istart,l_index,[nctlu,nctlv,nctlw,nnz]) Constructing wrapper function "basis"... b = basis(t,nctl,k,u,ind) Constructing wrapper function "derivbasis"... bd = derivbasis(t,nctl,ku,u,ind,n) Constructing wrapper function "findspan"... ind = findspan(u,k,t,nctl) Constructing F90 module support for "adtprojections"... Constructing wrapper function "adtprojections.searchquads"... faceid,uv = searchquads(pts,conn,searchpts,[npts,nconn,nsearchpts]) Wrote C/API module "libspline" to file "./libsplinemodule.c" Fortran 90 wrappers are saved to "./libspline-f2pywrappers2.f90"

gcc -O2 -fPIC -I/usr/include/python3.8 -I/usr/include/python3.8 -I/home/bolseiros/.local/lib/python3.8/site-packages/numpy/core/include \ -I/home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py/src -c libsplinemodule.c In file included from /usr/include/python3.8/numpy/ndarraytypes.h:1830, from /usr/include/python3.8/numpy/ndarrayobject.h:12, from /usr/include/python3.8/numpy/arrayobject.h:4, from /home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.h:13, from libsplinemodule.c:20: /usr/include/python3.8/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~ libsplinemodule.c: In function ‘int_from_pyobj’: libsplinemodule.c:143:14: warning: implicit declaration of function ‘Npy__PyLong_AsInt’ [-Wimplicit-function-declaration] 143 | *v = Npy__PyLong_AsInt(obj); | ^~~~~ libsplinemodule.c: In function ‘PyInit_libspline’: libsplinemodule.c:9702:5: warning: implicit declaration of function ‘Py_SET_TYPE’; did you mean ‘Py_TYPE’? [-Wimplicit-function-declaration] 9702 | Py_SET_TYPE(&PyFortran_Type, &PyType_Type); | ^~~ | Py_TYPE gcc -O2 -fPIC -I/usr/include/python3.8 -I/usr/include/python3.8 -I/home/bolseiros/.local/lib/python3.8/site-packages/numpy/core/include -c \ /home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c -o fortranobject.o In file included from /usr/include/python3.8/numpy/ndarraytypes.h:1830, from /usr/include/python3.8/numpy/ndarrayobject.h:12, from /usr/include/python3.8/numpy/arrayobject.h:4, from /home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.h:13, from /home/bolseiros/.local/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c:2: /usr/include/python3.8/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~ gfortran -I../../mod -fdefault-real-8 -O2 -fPIC -std=f2008 -I./ -c libspline-f2pywrappers2.f90 gfortran -fPIC -shared fortranobject.o libsplinemodule.o libspline-f2pywrappers2.o -fdefault-real-8 -O2 -fPIC -std=f2008 -L../../lib -lspline -o libspline.so python importTest.py Testing if module pyspline can be imported... Error importing libspline.so make[2]: [Makefile:37: all] Error 1 make[2]: Leaving directory '/home/bolseiros/packages/pyspline/src/f2py' make[1]: [Makefile:36: module] Error 2 make[1]: Leaving directory '/home/bolseiros/packages/pyspline' make: *** [Makefile:7: default] Error 2

bernardopacini commented 2 years ago

Without any information about your operating system, Python version, compilers, and installed dependencies we cannot offer much assistance. Please checkout Issue #46 and see if that solves the error.

In the future, please provide more information than the unformatted error message alone, as we can do little to help without background for the problem.

rcruzfardilha99 commented 2 years ago

Thank you! It worked.

Regarding the CGNS view, I am having this error

The file n0012.cgns was written with a more recent version of the CGNS library. You must update your CGNS library before trying to read this file.

This file requires the 4.2.0 that is the one that I have installed but when I open the CGNS view, the version of the library is the 3.4.

eirikurj commented 2 years ago

Make sure you are using the cgnsview binary from the package, not some system installed one. For more information, see https://mdolab-mach-aero.readthedocs-hosted.com/en/latest/installInstructions/install3rdPartyPackages.html#installing-cgns-tools-optional

rcruzfardilha99 commented 2 years ago

It did not work the warning of Policy CMP0072 appears despite the installation of the indicated packages.

Do you have other similar issue that might help?

On Wed, 21 Sept 2022, 15:42 Eirikur Jonsson, @.***> wrote:

Make sure you are using the cgnsview binary from the package, not some system installed one. For more information, see https://mdolab-mach-aero.readthedocs-hosted.com/en/latest/installInstructions/install3rdPartyPackages.html#installing-cgns-tools-optional

— Reply to this email directly, view it on GitHub https://github.com/mdolab/pyspline/issues/48#issuecomment-1253813537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZRYGCAYLKTREZBDBTWDU63V7MNGZANCNFSM6AAAAAAQPMJVAE . You are receiving this because you authored the thread.Message ID: @.***>