NanoComp / meep

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

Compilation error - maxwell_data was not declared #938

Open rprechelt opened 5 years ago

rprechelt commented 5 years ago

I am attempting to compile meep on a Fedora 29 workstation - freshly installed guile, libctl, and python 3.6.

I downloaded the latest release from Github, ./configure and then make.

I am able to install this using conda but I would like the ability to install this outside of conda.

Info: gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2) Python 3.6.8 libctl-4.3.0

Let me know if there's any other information you need!

The compile log:

make[3]: Entering directory '/opt/build/sources/meep-1.10.0/scheme'
  CXX      meep-main.o
  CXX      meep-meep_wrap.o
  CXX      meep-meep.o
  CXX      meep-structure.o
  CXX      meep-geom.o
  CXX      meep-ctl-io.o
geom.cpp:22: warning: "_GNU_SOURCE" redefined
 #define _GNU_SOURCE

<command-line>: note: this is the location of the previous definition
meep_wrap.cxx:1413: warning: "SCM_VECTORP" redefined
 #  define SCM_VECTORP(o) scm_vector_p(o)

In file included from /usr/include/guile/2.0/libguile.h:126,
                 from meep_wrap.cxx:749:
/usr/include/guile/2.0/libguile/deprecated.h:475: note: this is the location of the previous definition
 #define SCM_VECTORP(x)         scm_i_vectorp(x)

meep_wrap.cxx:1414: warning: "SCM_VECTOR_LENGTH" redefined
 #  define SCM_VECTOR_LENGTH(o) scm_c_vector_length(o)

In file included from /usr/include/guile/2.0/libguile.h:126,
                 from meep_wrap.cxx:749:
/usr/include/guile/2.0/libguile/deprecated.h:476: note: this is the location of the previous definition
 #define SCM_VECTOR_LENGTH(x)   scm_i_vector_length(x)

  CXXLD    meep
make[3]: Leaving directory '/opt/build/sources/meep-1.10.0/scheme'
make[2]: Leaving directory '/opt/build/sources/meep-1.10.0/scheme'
Making all in python
make[2]: Entering directory '/opt/build/sources/meep-1.10.0/python'
make  all-am
make[3]: Entering directory '/opt/build/sources/meep-1.10.0/python'
  CXX      _meep_la-meep-python.lo
meep-python.cxx: In function ‘PyObject* _wrap_eigenmode_data_mdata_set(PyObject*, PyObject*)’:
meep-python.cxx:97925:3: error: ‘maxwell_data’ was not declared in this scope
   maxwell_data *arg2 = (maxwell_data *) 0 ;
   ^~~~~~~~~~~~
meep-python.cxx:97925:3: note: suggested alternative: ‘random_data’
   maxwell_data *arg2 = (maxwell_data *) 0 ;
   ^~~~~~~~~~~~
   random_data
meep-python.cxx:97925:17: error: ‘arg2’ was not declared in this scope
   maxwell_data *arg2 = (maxwell_data *) 0 ;
oskooi commented 5 years ago

The error seems related to Guile. What version of Guile and SWIG are using? Can you try compiling with --without-scheme?

dmacks commented 4 years ago

I see this (among several other undefined types and functions) on my OS X. My libctl is 4.4.0 (latest upstream); I'm using guile-2.0.14, will try 2.2.6 that I also have laying around...

dmacks commented 4 years ago

Same result (using guile-2.2.6 for both libctl and meep). In addition to maxwell_data, I have (with both guile versions) a similar set of errors about undeclared type scalar_complex and 'struct meep::eigenmode_data' has no member named 'fft_data_E' (and also some other unknown members), and undeclared type evectmatrix, and 'struct meep::eigenmode_data' has no member named 'H'.

It all looks like #915, and I do not have mpb installed. Off to install it...

dmacks commented 4 years ago

Installing mpb-1.5 (what I had laying around), ./configure detected it, but then there was a build failure due to meep using struct elements of mpb that were only added in later versions (NanoComp/mpb@fc55636ab0fd2961b4d1a46c039dcb469d37149e). Updating to mpb-1.9.0 allowed meep to build successfully. So meep needs to check for of "mbp>1.6" not just "mpb". There's clearly something wrong in whatever meep does when external mpb is not available, but "install external support instead of building local workaround" is definitely the solution for me.