Python-Meep cannot be installed due to g++ failure

Asked by i2000s on 2013-08-02

Hi,

I tried to install python-meep 1.4.2 in my Ubuntu 12.04. I followed the process given in http://fzu.cz/~dominecf/misc/meep/index.html. However, the python-meep cannot be built at the last step. Errors occured as below:

q@ubuntu2:~/Programs/python-meep$ sudo ./make${pm_opt} -I/usr/local/include -L/usr/local/lib
[sudo] password for qxd:
Directories for SWIG -I option : ['/usr/local/include']
Directories for -L option : ['/usr/local/lib']
running clean
removing 'build/temp.linux-x86_64-2.7' (and everything under it)
removing 'build/lib.linux-x86_64-2.7' (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
removing 'build'
Directories for SWIG -I option : ['/usr/local/include']
Directories for -L option : ['/usr/local/lib']
running build_ext
building '_meep' extension
swigging meep.i to meep_wrap.cpp
swig -python -c++ -w503,389,302,362,314,509,451 -I/usr/local/include -o meep_wrap.cpp meep.i
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c meep_wrap.cpp -o build/temp.linux-x86_64-2.7/meep_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
meep_wrap.cpp: In function ‘PyObject* _wrap_iveccyl(PyObject*, PyObject*)’:
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +4)’ may be used uninitialized in this function [-Wuninitialized]
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +8)’ may be used uninitialized in this function [-Wuninitialized]
creating build/lib.linux-x86_64-2.7
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/meep_wrap.o -L/usr/local/lib -lmeep -o build/lib.linux-x86_64-2.7/_meep.so
/usr/bin/ld: cannot find -lmeep
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Directories for SWIG -I option : ['/usr/local/include']
Directories for -L option : ['/usr/local/lib']
running install
running build
running build_py
copying meep.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_meep' extension
swigging meep.i to meep_wrap.cpp
swig -python -c++ -w503,389,302,362,314,509,451 -I/usr/local/include -o meep_wrap.cpp meep.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c meep_wrap.cpp -o build/temp.linux-x86_64-2.7/meep_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
meep_wrap.cpp: In function ‘PyObject* _wrap_iveccyl(PyObject*, PyObject*)’:
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +4)’ may be used uninitialized in this function [-Wuninitialized]
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +8)’ may be used uninitialized in this function [-Wuninitialized]
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/meep_wrap.o -L/usr/local/lib -lmeep -o build/lib.linux-x86_64-2.7/_meep.so
/usr/bin/ld: cannot find -lmeep
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
Directories for SWIG -I option : ['/usr/local/include']
Directories for -L option : ['/usr/local/lib']
running bdist
running bdist_dumb
running build
running build_py
copying meep.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_meep' extension
swigging meep.i to meep_wrap.cpp
swig -python -c++ -w503,389,302,362,314,509,451 -I/usr/local/include -o meep_wrap.cpp meep.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c meep_wrap.cpp -o build/temp.linux-x86_64-2.7/meep_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
meep_wrap.cpp: In function ‘PyObject* _wrap_iveccyl(PyObject*, PyObject*)’:
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +4)’ may be used uninitialized in this function [-Wuninitialized]
meep_wrap.cpp:9752:15: warning: ‘*((void*)& result +8)’ may be used uninitialized in this function [-Wuninitialized]
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/meep_wrap.o -L/usr/local/lib -lmeep -o build/lib.linux-x86_64-2.7/_meep.so
/usr/bin/ld: cannot find -lmeep
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Any way to fix it? Thanks.

Cordially,
Qi

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu meep Edit question
Assignee:
No assignee Edit question
Solved by:
i2000s
Solved:
2016-11-21
Last query:
2016-11-21
Last reply:
2016-11-21
Manfred Hampl (m-hampl) said : #1

What meep-related packages have you installed?

Maybe you are missing libmeep-dev

i2000s (i2000s) said : #2

Thanks for your prompt reply. I am using meep 1.2.1 which was compiled from
source. I tried "sudo apt-get install libmeep-dev", and the python-meep
interface seems working. However, the situation becomes a little wired:
first, I cannot even start meep in /usr/local/bin! Secondly, when I use
python-meep to compile codes, mpi option seems always turned on but always
with 1-CPU whatever I use either "from meep_mpi import * " or "from meep
import * " option in the *.py code.

____________________________________________
q@ubuntu2:/usr/local/bin$ meep
meep: error while loading shared libraries: libmeep.so.7: cannot open
shared object file: No such file or directory
____________________________________________

Another example of running python-meep in a 2-core thinkpad X200
laptop-----------------
--------With "from meep_mpi import * " and "from meep import * " in the
*.py give the same
output------------------------------------------------------
q@ubuntu2:~/Programs/python-meep/samples/bent_waveguide$ python
python_meep_bent_wg_numpy_matrix.py

Python-meep starting...
Global initialisation done.
No site-specific initialisations.
Site-specific initialisation done.

==> Warning : in python-meep, the center of the coordinate system is in the
upper left corner (this behaviour is different from the Scheme-Meep v1.1.1,
where the center of the coordinate system is in the middle of your
computational volume). You can use the function center_origin on the
computational volume to change this (see example in section 3 of the
documentation). Set global variable DISABLE_WARNING_COORDINATESYSTEM to
True in your script (or in 'meep-site-init.py' and rebuild python-meep) to
suppress this warning.

==> Warning : eps-averaging is disabled by default in python-meep (this
behaviour is different from the Scheme-Meep v1.1.1, where eps-averaging is
enabled by default). You can use function use_averaging(True) to enable
eps-averaging. Set global variable DISABLE_WARNING_EPS_AVERAGING to True in
your script (or 'meep-site-init.py' and rebuild python-meep) to suppress
this warning.

==> Warning : calculation is done with complex fields by default in
python-meep (this behaviour is different from the Scheme-Meep v1.1.1, where
real fields are used by default). You can call function use_real_fields()
on your fields-object to enable calculation with real fields only. Set
global variable DISABLE_WARNING_REAL_FIELDS to True in your script (or in
'meep-site-init.py' and rebuild python-meep) to suppress this warning.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> Welcome to Python-Meep version 1.4.2 - running in MPI mode. <<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
** Bent waveguide sample, version 17-11-2009 **
Running on 1 processor(s)...
*1* Starting the case with no bend...
Creating the material matrix....
Setting the material matrix...
2D material matrix dimension : 160 x 320 - Meep resolution : 10 - Numpy
matrix resolution : 10
MeepMaterial object initialized.
Eps-averaging set on with : integration tolerance = 0.0001 , maximum number
of function evaluations = 100000.
time for set_epsilon = 1.32556 s
Callback function for amplitude factor activated.
Fetching amplitude factor for x=0.000000 - y=-0.500000
Fetching amplitude factor for x=0.000000 - y=-0.400000
Fetching amplitude factor for x=0.000000 - y=-0.300000
Fetching amplitude factor for x=0.000000 - y=-0.200000
Fetching amplitude factor for x=0.000000 - y=-0.100000
Fetching amplitude factor for x=0.000000 - y=0.000000
Fetching amplitude factor for x=0.000000 - y=0.100000
Fetching amplitude factor for x=0.000000 - y=0.200000
Fetching amplitude factor for x=0.000000 - y=0.300000
Fetching amplitude factor for x=0.000000 - y=0.400000
Fetching amplitude factor for x=0.000000 - y=0.500000
Field created...
Calculating...HDF5 output interval : 50 steps.
on time step 451 (time=22.55), 0.00892838 s/step
on time step 935 (time=46.75), 0.00827591 s/step
on time step 1411 (time=70.55), 0.00840898 s/step
on time step 1895 (time=94.75), 0.00826525 s/step
on time step 2371 (time=118.55), 0.00840738 s/step
Source has decayed... counting down... 50
Source has decayed... counting down... 40
Source has decayed... counting down... 30
Source has decayed... counting down... 20
Source has decayed... counting down... 10
Steps per time unit : 20.000000Done..!creating output file
"./minusflux.h5"...
*2* Starting the case with bend...
Creating the material matrix....
Setting the material matrix...
2D material matrix dimension : 160 x 320 - Meep resolution : 10 - Numpy
matrix resolution : 10
MeepMaterial object initialized.
Eps-averaging set on with : integration tolerance = 0.0001 , maximum number
of function evaluations = 100000.
time for set_epsilon = 1.5643 s
Callback function for amplitude factor activated.
Fetching amplitude factor for x=0.000000 - y=-0.500000
Fetching amplitude factor for x=0.000000 - y=-0.400000
Fetching amplitude factor for x=0.000000 - y=-0.300000
Fetching amplitude factor for x=0.000000 - y=-0.200000
Fetching amplitude factor for x=0.000000 - y=-0.100000
Fetching amplitude factor for x=0.000000 - y=0.000000
Fetching amplitude factor for x=0.000000 - y=0.100000
Fetching amplitude factor for x=0.000000 - y=0.200000
Fetching amplitude factor for x=0.000000 - y=0.300000
Fetching amplitude factor for x=0.000000 - y=0.400000
Fetching amplitude factor for x=0.000000 - y=0.500000
Field created...
Calculating...
on time step 396 (time=19.8), 0.0101136 s/step
on time step 734 (time=36.7), 0.0118532 s/step
on time step 1151 (time=57.55), 0.00967877 s/step
on time step 1572 (time=78.6), 0.00951488 s/step
on time step 1986 (time=99.3), 0.00966763 s/step
on time step 2401 (time=120.05), 0.00965845 s/step
on time step 2823 (time=141.15), 0.00949331 s/step
on time step 3234 (time=161.7), 0.00974239 s/step
on time step 3651 (time=182.55), 0.0096508 s/step
on time step 4074 (time=203.7), 0.0094655 s/step
on time step 4458 (time=222.9), 0.0104169 s/step
Source has decayed... counting down... 50
Source has decayed... counting down... 40
Source has decayed... counting down... 30
Source has decayed... counting down... 20
Source has decayed... counting down... 10
Steps per time unit : 20.000000Done..!
Field time usage:
    connnecting chunks: 0.177147 s
         time stepping: 25.4765 s
         communicating: 1.81444 s
     outputting fields: 13.1727 s
    Fourier transforming: 5.28456 s
       everything else: 0.837078 s

Field time usage:
    connnecting chunks: 0.178015 s
         time stepping: 15.1139 s
         communicating: 1.0789 s
     outputting fields: 3.604 s
    Fourier transforming: 3.14091 s
       everything else: 0.539641 s
------------------------------------------------------------------------------
------------------------------------------------------------------------------

I should mention that I first installed meep-mpi, it seems working. Then I
installed the meep with single cpu support. All installations passed "make
check". Correspondingly, I also tried installing python-meep interface
twice immediately after each installation of meeps. Python-meep was
compiled in the same folder for the two cases. Now, my single-CPU-supported
meep seems not working, but meep_mpi option seems not working properly
neither. Is anything mixed up due to multiple installations?

Thanks again.

Take care,
Qi

On Fri, Aug 2, 2013 at 7:36 AM, Manfred Hampl <
<email address hidden>> wrote:

> Your question #233420 on meep in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/meep/+question/233420
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> What meep-related packages have you installed?
>
> Maybe you are missing libmeep-dev
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/meep/+question/233420/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/meep/+question/233420
>
> You received this question notification because you asked the question.
>

Manfred Hampl (m-hampl) said : #3

I guess the problem is mixing different versions. You should stick to one version of meep from one source.

e.g. you see an error message about missing /usr/lib/libmeep.so.7
The Ubuntu versions deliver /usr/lib/libmeep.so.6
So you apparently have a version conflict.

i2000s (i2000s) said : #4

3 years later, I still couldn't make it installed on Ubuntu 16.04. Similar error.

'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it

Manfred Hampl (m-hampl) said : #5

Are you still looking for help?

If yes, then please provide more information about the problems you are seeing, e.g. basic information about your system (uname -a; lsb_release -crid), the full log of your attempt to build the program, etc.

i2000s (i2000s) said : #6

I just found Filip Dominec's script on configuring and installing the package. It appeared to be working now except for MPB. I think you can close this issue for now. I will figure out the MPB issue later. Thanks.