groupeLIAMG / ttcr

Codes to do raytracing for geophysical applications
GNU General Public License v3.0
85 stars 34 forks source link

Failed Python install - error: no matching constructor for initialization of 'ttcr::mesh' #17

Closed jbmuir closed 5 years ago

jbmuir commented 5 years ago

I'm trying to install the python wrapper (Python 3.6.6, Cython 0.29, clang-1000.10.44.4 on Mac Mojave); compilation of the 3D mesh code fails with the following error.

Mesh3Dttcr.cpp:47:29: error: no matching constructor for initialization of
      'ttcr::mesh' (aka 'Grid3Dunfs<double, unsigned int>')
        mesh_instance = new mesh(no, tet, eps, maxit, refPts, 2, rp, nt);
                            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ttcr/Grid3Dunfs.h:42:9: note: candidate constructor not viable: no known
      conversion from 'std::vector<sxyz<double> >' to 'const bool' for 5th
      argument
        Grid3Dunfs(const std::vector<sxyz<T1>>& no,
        ^
../ttcr/Grid3Dunfs.h:52:9: note: candidate constructor not viable: requires at
      least 10 arguments, but 8 were provided
        Grid3Dunfs(const std::vector<sxyz<T1>>& no,
        ^
../ttcr/Grid3Dunfs.h:40:11: note: candidate constructor (the implicit copy
      constructor) not viable: requires 1 argument, but 8 were provided
    class Grid3Dunfs : public Grid3Dun<T1,T2,Node3Dn<T1,T2>> {
bernard-giroux commented 5 years ago

I have made substantial changes to the C++ interface and did not yet update the python wrapper. Should be done in the upcoming days...

bernard-giroux commented 5 years ago

That should work now. Please confirm.

jbmuir commented 5 years ago

My compilation now works - I've got a separate issue though (ImportError: cannot import name 'cmesh2d') which I can raise if its not just me being stupid....

bernard-giroux commented 5 years ago

the compiled files should be in your PYTHONPATH

jbmuir commented 5 years ago

How exactly should I set it up? Currently the folder pathtottcr/ttcr is included in PYTHONPATH, so the module ttcr loads and a pycache is build for mesh.py

bernard-giroux commented 5 years ago

Is it pathtottcr/ttcr or pathtottcr/ttcrpy ?

jbmuir commented 5 years ago

The former

bernard-giroux commented 5 years ago

Then I guess you should import ttcrpy.cmesh2d

bernard-giroux commented 5 years ago

I assume that you got it working