Hi Stephan:

I am glad to help you!

The error message suggests the compiler cannot find the hdf5 libraries.

The problem with hdf5 library could be related with some installation issues as
well. I think you could try to check that you have installed the following
Ubuntu/Debian packages and their dependencies:


hdf5-tools
h5utils
libhdf5-serial
libhdf5-serial-dev

If this works, then you'll have a complete development platform for meep
programming. The following link will help you to understand the code:

http://www.glenstark.net/meeppp/docu/index.html

Regards,

Rafael Gómez Alcalá
Asociate Professor
Universidad de Extremadura
Escuela Politécnica
E10003 Cáceres (SPAIN)


> Hi Rafael,
> great, that worked! Thanks a lot!
>
> Now I just have a little problem left, I get this warning from the compiler:
>
> /usr/bin/ld: cannot find -lhdf5
> collect2: ld returned 1 exit status
>
>
> Here is the test.cpp, by the way:
>
> #include <meep.hpp>
> using namespace meep;
>
> double eps(const vec &p) {
>    if (p.x() < 2 && p.y() < 3)
>      return 12.0;
>    return 1.0;
> }
>
> int main(int argc, char **argv) {
>    initialize mpi(argc, argv); // do this even for non-MPI Meep
>    double resolution = 20; // pixels per distance
>    grid_volume v = vol2d(5,10, resolution); // 5x10 2d cell
>    structure s(v, eps, pml(1.0));
>    fields f(&s);
>
>    f.output_hdf5(Dielectric, v.surroundings());
>
>    double freq = 0.3, fwidth = 0.1;
>    gaussian_src_time src(freq, fwidth);
>    f.add_point_source(Ey, src, vec(1.1, 2.3));
>    while (f.time() < f.last_source_time()) {
>      f.step();
>    }
>
>    f.output_hdf5(Hz, v.surroundings());
>
>    return 0;
> }
>
>
>
> Do you maybe also know what the problem here could be?
> Thanks a lot for your great help!!!
> Stefan
>
>
>
> On 01/17/2011 05:40 PM, [email protected] wrote:
>> Hi Stephan,
>>
>> Perhaps there is a more fast solution: try to install the Ubuntu
>> package "libmeep-dev" . It seems that is this package that contains
>> meep.pc and installs it under /usr/lib/pkgconfig/
>>
>> If this works, you can compile your cpp files with procedure number two, 
>> i.e.,
>> using
>> pkg-config.
>>
>> Regards,
>>
>> Rafael Gómez Alcalá
>> Asociated Professor
>> Universidad de Extremadura
>> Escuela Politécnica
>> E10003 Cáceres (SPAIN)
>>
>>
>>> Hi Stephan,
>>>
>>> The configure script creates a file named `meep.pc', the one
>>> pkg-config is complaining about. First, check that meep.pc
>>> exists under meep-1.1.1/ directory.
>>>
>>> My own version of meep.pc contains the following:
>>>
>>> prefix=/usr
>>> exec_prefix=${prefix}
>>> libdir=${exec_prefix}/lib
>>> includedir=${prefix}/include
>>>
>>> Name: MEEP
>>> Description: time-domain electromagnetic simulation
>>> Version: 1.1.1
>>> Libs: -L${libdir} -lmeep  -lhdf5 -lz -lgsl 
>>> -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4
>>> -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/lib
>>> -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../.. -lharminv -llapack -lcblas 
>>> -lblas
>>> -latlas -lgfortranbegin -lgfortran -lm   -lfftw3 -lm
>>> Cflags: -I${includedir}  -malign-double -march=native
>>>
>>> If you have this file, try to compile one of the test files under tests. If 
>>> you
>>> don't have this file, could you post the "config.log" under meep-1.1.1/
>>> directory?
>>>
>>> It doesn't matter where you uncompress meep-1.1.1.tar.gz . You must check 
>>> also
>>> that
>>> a Makefile is created under tests/ directory.
>>>
>>> Regards,
>>>
>>> Rafael Gómez Alcalá
>>> Asociated Professor
>>> Universidad de Extremadura
>>> Escuela Politécnica
>>> E10003 Cáceres (SPAIN)
>>>
>>>> Hi Rafael,
>>>> I ran the configure script now, but still get the same resulting error
>>>> code, when I try to compile using version 2):
>>>>
>>>> Package meep was not found in the pkg-config search path.
>>>> Perhaps you should add the directory containing `meep.pc'
>>>> to the PKG_CONFIG_PATH environment variable
>>>> No package 'meep' found
>>>> Package meep was not found in the pkg-config search path.
>>>> Perhaps you should add the directory containing `meep.pc'
>>>> to the PKG_CONFIG_PATH environment variable
>>>> No package 'meep' found
>>>> test.cpp:1:20: error: meep.hpp: No such file or directory
>>>> test.cpp:2: error: ‘meep’ is not a namespace-name
>>>> test.cpp:2: error: expected namespace-name before ‘;’ token
>>>> test.cpp: In function ‘int main(int, char**)’:
>>>> test.cpp:5: error: ‘initialize’ was not declared in this scope
>>>> test.cpp:5: error: expected ‘;’ before ‘mpi’
>>>> test.cpp:7: error: ‘grid_volume’ was not declared in this scope
>>>> test.cpp:7: error: expected ‘;’ before ‘v’
>>>> test.cpp:8: error: ‘structure’ was not declared in this scope
>>>> test.cpp:8: error: expected ‘;’ before ‘s’
>>>> test.cpp:9: error: ‘fields’ was not declared in this scope
>>>> test.cpp:9: error: expected ‘;’ before ‘f’
>>>> test.cpp:11: error: ‘f’ was not declared in this scope
>>>> test.cpp:11: error: ‘Dielectric’ was not declared in this scope
>>>> test.cpp:11: error: ‘v’ was not declared in this scope
>>>> test.cpp:14: error: ‘gaussian_src_time’ was not declared in this scope
>>>> test.cpp:14: error: expected ‘;’ before ‘src’
>>>> test.cpp:15: error: ‘Ey’ was not declared in this scope
>>>> test.cpp:15: error: ‘src’ was not declared in this scope
>>>> test.cpp:15: error: ‘vec’ was not declared in this scope
>>>> test.cpp:20: error: ‘Hz’ was not declared in this scope
>>>> test.cpp: At global scope:
>>>> test.cpp:25: error: ISO C++ forbids declaration of ‘vec’ with no type
>>>> test.cpp:25: error: expected ‘,’ or ‘...’ before ‘&’ token
>>>> test.cpp: In function ‘double eps(int)’:
>>>> test.cpp:26: error: ‘p’ was not declared in this scope
>>>>
>>>> Do I have to unpack the downloaded files in a special directory, because
>>>> I just did that in a random directory? Do I have to do something with
>>>> the files created by the action you suggested?
>>>>
>>>> As I wrote in the initial email version 1) brings this error on my 
>>>> computer:
>>>>
>>>> make: *** No rule to make target `test.dac'.  Stop.
>>>>
>>>> Any ideas on that?
>>>> Thanks a lot!
>>>> Stefan
>>>>
>>>>
>>>>
>>>> On 01/17/2011 01:46 PM, [email protected] wrote:
>>>>> Hi Stephan:
>>>>>
>>>>> Yes, you must use the configure script:
>>>>>
>>>>> yourshell $   ./configure --prefix=/usr
>>>>>
>>>>> There are many  options, but I think
>>>>> this would be enough to create the appropriate Makefile under
>>>>> tests/
>>>>>
>>>>> By the way, you can also use the first way to compile and link
>>>>> the tests:
>>>>>
>>>>> yourshell $  make known_results.dac
>>>>>     CXX    known_results.o
>>>>> /bin/sh ../libtool --silent --tag=CXX   --mode=link g++
>>>>> -O3 -malign-double -fstrict-aliasing -march=native
>>>>>    -o known_results.dac known_results.o ../src/libmeep.la -lhdf5 -lz -lgsl
>>>>>    -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4
>>>>>    
>>>>> -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/lib
>>>>> -L/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../.. -lharminv
>>>>>    -llapack -lcblas -lblas -latlas -lgfortranbegin -lgfortran -lm   
>>>>> -lfftw3 -lm
>>>>>
>>>>> I am using Gentoo Linux, with gcc version 4.4.4
>>>>>
>>>>> Hope this helps!
>>>>>
>>>>> Regards,
>>>>>
>>>>> Rafael Gómez Alcalá
>>>>> Asociated Professor
>>>>> Universidad de Extremadura
>>>>> Escuela Politécnica
>>>>> E10003 Cáceres (SPAIN)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 11:29 Mon 17 Jan     , Stefan Kapser wrote:
>>>>>> Hi Rafael,
>>>>>> thanks a lot for your quick reply! I downloaded meep-1.1.1.tar.gz from 
>>>>>> the
>>>>>> website and extracted everything. What exactly do you mean with 
>>>>>> generating
>>>>>> a complete configuration using the configure program? There is a shell
>>>>>> script called configure, do you mean that one? And what exactly should I 
>>>>>> do
>>>>>> with it?
>>>>>> Thanks a lot!
>>>>>> Stefan
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 01/17/2011 11:15 AM, [email protected] wrote:
>>>>>>> Hi Stefan:
>>>>>>>
>>>>>>> My suggestion is:
>>>>>>>
>>>>>>> 1. Download the source package (meep -whatever- .tar.gz) and extract
>>>>>>> the complete directory structure.
>>>>>>> 2. Generate a complete compilation configuration using configure program
>>>>>>> 3. Inside "test" directory use method 2) outlined down (g++ `pkg-config
>>>>>>> ...etc)
>>>>>>>
>>>>>>> This worked for me.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Rafael Gómez Alcalá
>>>>>>> Asociated Professor
>>>>>>> Universidad de Extremadura
>>>>>>> Escuela Politécnica
>>>>>>> E10003 Cáceres (SPAIN)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 10:55 Mon 17 Jan     , Stefan Kapser wrote:
>>>>>>>> Hi,
>>>>>>>> I hope you can help me with this problem:
>>>>>>>> Currently I am just trying to compile the first test program from the
>>>>>>>> Meep
>>>>>>>> C++ Tutorial, but can't really manage to do so.
>>>>>>>> I tryed the three ways given in se section Compiling:
>>>>>>>>
>>>>>>>> 1) make test.dac
>>>>>>>>
>>>>>>>> gave me:
>>>>>>>>
>>>>>>>> make: *** No rule to make target `test.dac'.  Stop.
>>>>>>>>
>>>>>>>> 2) g++ `pkg-config --cflags meep` test.cpp -o test `pkg-config --libs
>>>>>>>> meep`
>>>>>>>>
>>>>>>>> gave me:
>>>>>>>>
>>>>>>>> Package meep was not found in the pkg-config search path.
>>>>>>>> Perhaps you should add the directory containing `meep.pc'
>>>>>>>> to the PKG_CONFIG_PATH environment variable
>>>>>>>> No package 'meep' found
>>>>>>>> Package meep was not found in the pkg-config search path.
>>>>>>>> Perhaps you should add the directory containing `meep.pc'
>>>>>>>> to the PKG_CONFIG_PATH environment variable
>>>>>>>> No package 'meep' found
>>>>>>>> test.cpp:1:20: error: meep.hpp: No such file or directory
>>>>>>>> test.cpp:2: error: ‘meep’ is not a namespace-name
>>>>>>>> test.cpp:2: error: expected namespace-name before ‘;’ token
>>>>>>>> test.cpp: In function ‘int main(int, char**)’:
>>>>>>>> test.cpp:5: error: ‘initialize’ was not declared in this scope
>>>>>>>> test.cpp:5: error: expected ‘;’ before ‘mpi’
>>>>>>>> test.cpp:7: error: ‘grid_volume’ was not declared in this scope
>>>>>>>> test.cpp:7: error: expected ‘;’ before ‘v’
>>>>>>>> test.cpp:8: error: ‘structure’ was not declared in this scope
>>>>>>>> test.cpp:8: error: expected ‘;’ before ‘s’
>>>>>>>> test.cpp:9: error: ‘fields’ was not declared in this scope
>>>>>>>> test.cpp:9: error: expected ‘;’ before ‘f’
>>>>>>>> test.cpp:11: error: ‘f’ was not declared in this scope
>>>>>>>> test.cpp:11: error: ‘Dielectric’ was not declared in this scope
>>>>>>>> test.cpp:11: error: ‘v’ was not declared in this scope
>>>>>>>> test.cpp:14: error: ‘gaussian_src_time’ was not declared in this
>>>>>>>> scope
>>>>>>>> test.cpp:14: error: expected ‘;’ before ‘src’
>>>>>>>> test.cpp:15: error: ‘Ey’ was not declared in this scope
>>>>>>>> test.cpp:15: error: ‘src’ was not declared in this scope
>>>>>>>> test.cpp:15: error: ‘vec’ was not declared in this scope
>>>>>>>> test.cpp:20: error: ‘Hz’ was not declared in this scope
>>>>>>>> test.cpp: At global scope:
>>>>>>>> test.cpp:25: error: ISO C++ forbids declaration of ‘vec’ with no 
>>>>>>>> type
>>>>>>>> test.cpp:25: error: expected ‘,’ or ‘...’ before ‘&’ token
>>>>>>>> test.cpp: In function ‘double eps(int)’:
>>>>>>>> test.cpp:26: error: ‘p’ was not declared in this scope
>>>>>>>>
>>>>>>>>
>>>>>>>> So I guess the meep stuff is not in the past where my compiler is 
>>>>>>>> looking
>>>>>>>> for it. I installed Meep on Ubuntu via the Ubuntu Software Center and 
>>>>>>>> did
>>>>>>>> not get to pick anything during the installation.
>>>>>>>> I would be thankful for tipps how to make this work.
>>>>>>>> Thanks a lot!
>>>>>>>> Stefan
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> meep-discuss mailing list
>>>>>>>> [email protected]
>>>>>>>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>>>>
>>>>> _______________________________________________
>>>>> meep-discuss mailing list
>>>>> [email protected]
>>>>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> meep-discuss mailing list
>>> [email protected]
>>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>>
>>
>>
>>
>> _______________________________________________
>> meep-discuss mailing list
>> [email protected]
>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>



_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to