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

Python module in local repository not built during `make` after editing C++ source files #2565

Closed oskooi closed 1 year ago

oskooi commented 1 year ago

The Meep Python module in my local git repository at ${GIT_REPO}/python/meep.py (where ${GIT_REPO} is something like ${HOME}/install/meep) which depends on the compiled library _meep_la-meep-python.o also in that folder is not built when I run make within ${GIT_REPO} after editing the C++ source files (i.e., src/step_db.cpp). Since my ${PYTHONPATH} environment variable contains the directory ${GIT_REPO}/python, this means that the Python module in ${GIT_REPO}/python/ does not contain my local changes.

To get around this, I have to manually force the build of the files in ${GIT_REPO}/python by doing something like touch ${GIT_REPO}/src/meep.hpp before running make. This should not be necessary.

oskooi commented 1 year ago

There was no bug after all in the Automake scripts. Rather there was a bug in the way, as part of development work on #2538, I was adding print statements to inspect local variables in the special update equations for r=0 of step_db.cpp.

I was using master_printf within step_db.cpp and not seeing any debugging output. This seemed to suggest a problem in the way the Python module was being built. The actual reason for the lack of output was because the chunk containing the r=0 boundary was not the master process. Replacing master_printf with printf or simply running without parallelization fixed the issue.