NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.19k stars 610 forks source link

Build from source make error #2580

Closed Theod0reWu closed 1 year ago

Theod0reWu commented 1 year ago

When I tried to build MEEP from the source I'm getting this error:

meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_n_set(PyObject*, PyObject*)':
meep-python.cxx:141711:51: error: 'struct meep::eigenmode_data' has no member named 'n'
       for (; ii < (size_t)3; ++ii) *(int *)&arg1->n[ii] = *((int *)arg2 + ii);
                                                   ^
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_n_get(PyObject*, PyObject*)':
meep-python.cxx:141737:36: error: 'struct meep::eigenmode_data' has no member named 'n'
   result = (int *)(int *) ((arg1)->n);
                                    ^
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_s_set(PyObject*, PyObject*)':
meep-python.cxx:141773:54: error: 'struct meep::eigenmode_data' has no member named 's'
       for (; ii < (size_t)3; ++ii) *(double *)&arg1->s[ii] = *((double *)arg2 + ii);
                                                      ^
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_s_get(PyObject*, PyObject*)':
meep-python.cxx:141799:42: error: 'struct meep::eigenmode_data' has no member named 's'
   result = (double *)(double *) ((arg1)->s);
                                          ^
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_Gk_set(PyObject*, PyObject*)':
meep-python.cxx:141835:54: error: 'struct meep::eigenmode_data' has no member named 'Gk'
       for (; ii < (size_t)3; ++ii) *(double *)&arg1->Gk[ii] = *((double *)arg2 + ii);
                                                      ^~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_Gk_get(PyObject*, PyObject*)':
meep-python.cxx:141861:42: error: 'struct meep::eigenmode_data' has no member named 'Gk'
   result = (double *)(double *) ((arg1)->Gk);
                                          ^~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_center_set(PyObject*, PyObject*)':
meep-python.cxx:141891:21: error: 'struct meep::eigenmode_data' has no member named 'center'
   if (arg1) (arg1)->center = *arg2;
                     ^~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_center_get(PyObject*, PyObject*)':
meep-python.cxx:141913:36: error: 'struct meep::eigenmode_data' has no member named 'center'
   result = (meep::vec *)& ((arg1)->center);
                                    ^~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_amp_func_set(PyObject*, PyObject*)':
meep-python.cxx:141951:21: error: 'struct meep::eigenmode_data' has no member named 'amp_func'
   if (arg1) (arg1)->amp_func = arg2;
                     ^~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_amp_func_get(PyObject*, PyObject*)':
meep-python.cxx:141973:22: error: 'struct meep::eigenmode_data' has no member named 'amp_func'
   result =  ((arg1)->amp_func);
                      ^~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_band_num_set(PyObject*, PyObject*)':
meep-python.cxx:142003:21: error: 'struct meep::eigenmode_data' has no member named 'band_num'
   if (arg1) (arg1)->band_num = arg2;
                     ^~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_band_num_get(PyObject*, PyObject*)':
meep-python.cxx:142025:27: error: 'struct meep::eigenmode_data' has no member named 'band_num'
   result = (int) ((arg1)->band_num);
                           ^~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_frequency_set(PyObject*, PyObject*)':
meep-python.cxx:142055:21: error: 'struct meep::eigenmode_data' has no member named 'frequency'
   if (arg1) (arg1)->frequency = arg2;
                     ^~~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_frequency_get(PyObject*, PyObject*)':
meep-python.cxx:142077:30: error: 'struct meep::eigenmode_data' has no member named 'frequency'
   result = (double) ((arg1)->frequency);
                              ^~~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_group_velocity_set(PyObject*, PyObject*)':
meep-python.cxx:142107:21: error: 'struct meep::eigenmode_data' has no member named 'group_velocity'
   if (arg1) (arg1)->group_velocity = arg2;
                     ^~~~~~~~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap_eigenmode_data_group_velocity_get(PyObject*, PyObject*)':
meep-python.cxx:142129:30: error: 'struct meep::eigenmode_data' has no member named 'group_velocity'
   result = (double) ((arg1)->group_velocity);
                              ^~~~~~~~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap__get_eigenmode(PyObject*, PyObject*)':
meep-python.cxx:142333:54: error: void value not ignored as it ought to be
       result = (meep::eigenmode_data *)_get_eigenmode(arg1,arg2,arg3,SWIG_STD_MOVE(arg4),SWIG_STD_MOVE(arg5),arg6,(meep::vec const &)*arg7,arg8,arg9,arg10,arg11,arg12);
                                        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
meep-python.cxx: In function 'PyObject* _wrap__get_eigenmode_Gk(PyObject*, PyObject*)':
meep-python.cxx:142362:28: error: '_get_eigenmode_Gk' was not declared in this scope
       result = (PyObject *)_get_eigenmode_Gk(arg1);
                            ^~~~~~~~~~~~~~~~~
meep-python.cxx:142362:28: note: suggested alternative: '_get_eigenmode'
       result = (PyObject *)_get_eigenmode_Gk(arg1);
                            ^~~~~~~~~~~~~~~~~
                            _get_eigenmode

I'm not sure what's causing this. I don't have MPB installed. However, the latest release says that MPB is not required. I'm building this from the latest release 1.27.0 from the [meep-1.27.0.tar.gz] file. The flags I've passed into configure are: --enable-shared --enable-single --without-scheme

AlexKyriacou92 commented 8 months ago

Hi, I've recently encountered the exact same problem when trying to build meep, but this even happened after I install mpb. Did you find a solution in the end?

stevengj commented 8 months ago

It looks like that may happen when you build from source using the release tarball .tar.gz but aren't linking with MPB.

Solution: compile and install MPB as well, or re-build the SWIG file (remove python/meep-python.cxx and configure with --enable-maintainer-mode).

If that's indeed the problem, we should really fix it so that the release tarballs compile as-is without MPB.

Theod0reWu commented 8 months ago

Just to add on. I got it to work by installing MPB, I tried to re-build the SWIG files from those instructions and wasn't able to get it work that way.