Firstly, if I have missed a post on this issue since the exchange 
between Gidi Lasovski and Zheng Li, please accept my apologies. 
Please point me in the right direction.  I have been attempting to 
run MEEP under cygwin and get a segmentation fault running the tests 
(and examples).  The fault occurs in very first line of main() - that 
is, the program doesn't get past

int main(int argc, char **argv) {

Any pointers as to how to resolve this issue would be greatly 
appreciated.  I know the real solution is "don't use Windows," but I 
am stuck for the time being.

Below is a detailed description of the problem and some information 
on warnings received during configuration and make.  Also given are 
the versions of each of the required packages.  I suppose I should 
also apologise for the length of this post.

John

Problem Description
================

All compiles fine (with some warnings - see later), except when I get 
to running "make check," at which point batch.dac.exe fails with a 
segmentation fault.  The stack dump gives:

Exception: STATUS_ACCESS_VIOLATION at eip=00000000
eax=0000C001 ebx=007B0218 ecx=00000000 edx=0000C001 esi=0047E6F0 edi=007B0248
edp=0022CBF8 esp=0022CB6C 
program=C:\cygwin\home\johnd\meep\meep-0.20.3\tests\be
nch.dac.exe, pid 4520, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
End of stack track

I compiled the system using -enable-debug and then ran batch.dac.exe 
under gdb.  Below is the result of running the program to the 
segmentation fault and then doing a back trace.  (Actually I get the 
same result running batch.exe or any of the examples, even the one in 
the doc directory, which, apparently, doesn't use the libctl/Scheme interface.)

$ gdb bench.dac.exe
GNU gdb 6.8.0.30080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pcpcygwin"...
(gdb) r
Starting program: /home/johnd/meep/meep-0.20.3/tests/bench.dac.exe
[New thread 5796.0x14b4]
[New thread 5796.0x2e4]

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0047e6ab in __w32_sharedptr_initialize ()
     At /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex:387
#2  0x0047da05 in _Unwind_SjLj_Register ()
     At /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex:387
#3  0x00404993 in main (argc=1, argv=0x7b30a8) at bench.cpp:262
(gdb)

The result seems strange - there "appears" to be a problem with the 
return from overload definition for minus for complex numbers.  I 
would doubt this is the case.  Rather I think it points to a problem 
in compilation or perhaps a cygwin/w32 interface problem.

Warnings Received During Configuration and Compliation
===============================================

Configuration:

Only one warning received:
checking for latex2html... no
configure: WARNING: cannot find latex2html in your path!

The only checks that returned "no" were:
  1) checking whether to enable maintainer-specific portions of Makefiles... no
  2) checking whether we are cross compiling... no
  3) checking if gcc supports -fno-rtti -fno-exceptions... no
  4) checking whether to build shared libraries... no
  5) checking for ghc... no
  6) checking for basename in -lgen... no
  7) checking for feenableexcept... no
  8) checking whether feenableexcept declaration is usable... no
  9) checking whether to catch and ignore SIGFPE signals... no
10) checking for BSDgettimeofday... no

The check 4) above is a little strange because it is part of the 
following dialog

checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
configure: creating libtool

which would indicate that shared libraries are OK.

Make
Two warnings are raised during the make, related to autoimporting 
during linking.  The errors occur in the directories libctl and 
tests.  The relevant sections of the make file dialog are given 
below.  I also get similar warnings compiling harminv, but harminv 
works with no problems (using the example programs given in the 
harminv package).

For the libctl directory:

/bin/sh ../libtool --tag=CXX   --mode=link g++  -O2 
-malign-double   -o meep.exe meep.o structure.o meep_wrap.o  main.o 
geom.o ctl-io.o ../src/libmeep.la -lctl  -lguile -lltdl  -L/usr/lib 
-L/usr/bin -L/usr/lib/w32api -lgmp -lcrypt -lm -lltdl -lhdf5 -lz 
-lgsl -L/usr/local/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. -lharminv -llapack 
-lblas -lm -lfrtbegin -lg2c -lcygwin -luser32 -lkernel32 -ladvapi32 
-lshell32   -lfftw3 -lm  -lhdf5 -lz -lgsl -L/usr/local/lib 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. -lharminv -llapack 
-lblas -lm -lfrtbegin -lg2c -lcygwin -luser32 -lkernel32 -ladvapi32 
-lshell32   -lfftw3 -lm

g++ -O2 -malign-double -o meep.exe meep.o structure.o meep_wrap.o 
main.o geom.o ctl-io.o  ../src/.libs/libmeep.a -L/usr/local/lib 
/usr/local/lib/libctl.a -L/usr/lib -L/usr/bin -L/usr/lib/w32api 
/usr/lib/libguile.dll.a /usr/lib/libintl.dll.a 
/usr/lib/libiconv.dll.a /usr/lib/libgmp.dll.a -lcrypt 
/usr/lib/libltdl.dll.a -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. /usr/lib/libhdf5.dll.a 
-lssl -lcrypto -lz /usr/lib/libgsl.dll.a /usr/local/lib/libharminv.a 
-llapack -lblas -lfrtbegin /usr/lib/gcc/i686-pc-cygwin/3.4.4/libg2c.a 
-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 /usr/lib/libfftw3.dll.a

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: 
warning: auto-importing has been activated without 
--enable-auto-import specified on the command line.

This should work unless it involves constant data structures 
referencing symbols from auto-imported DLLs.Info: resolving 
_scm_i_freelist2 by linking to __imp__scm_i_freelist2 (auto-import)
Info: resolving _scm_cells_allocated by linking to 
__imp__scm_cells_allocated (auto-import)
Info: resolving _scm_i_master_freelist2 by linking to 
__imp__scm_i_master_freelist2 (auto-import)
Info: resolving _H5P_CLS_FILE_ACCESS_g by linking to 
__imp__H5P_CLS_FILE_ACCESS_g (auto-import)
Info: resolving _H5T_NATIVE_DOUBLE_g by linking to 
__imp__H5T_NATIVE_DOUBLE_g (auto-import)
Info: resolving _H5T_C_S1_g by linking to __imp__H5T_C_S1_g (auto-import)
Info: resolving _H5P_CLS_DATASET_CREATE_g by linking to 
__imp__H5P_CLS_DATASET_CREATE_g (auto-import)
Info: resolving _H5T_NATIVE_FLOAT_g by linking to 
__imp__H5T_NATIVE_FLOAT_g (auto-import)

For the tests directory

make[2]: Entering directory `/home/johnd/meep/meep-0.20.3/tests'
/bin/sh ../libtool --tag=CXX   --mode=link g++  -O2 
-malign-double   -o bench.exe bench.o ../src/libmeep.la -lhdf5 -lz 
-lgsl -L/usr/local/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. -lharminv -llapack 
-lblas -lm -lfrtbegin -lg2c -lcygwin -luser32 -lkernel32 -ladvapi32 
-lshell32   -lfftw3 -lm

g++ -O2 -malign-double -o bench.exe bench.o  ../src/.libs/libmeep.a 
-L/usr/local/lib /usr/lib/libhdf5.dll.a -lssl -lcrypto -lz 
/usr/lib/libgsl.dll.a -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. 
/usr/local/lib/libharminv.a -llapack -lblas -lfrtbegin 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/libg2c.a -lcygwin -luser32 
-lkernel32 -ladvapi32 -lshell32 /usr/lib/libfftw3.dll.a

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: 
warning: auto-importing has been activated without 
--enable-auto-import specified on the command line.

This should work unless it involves constant data structures 
referencing symbols from auto-imported DLLs.Info: resolving 
_H5P_CLS_FILE_ACCESS_g by linking to __imp__H5P_CLS_FILE_ACCESS_g (auto-import)
Info: resolving _H5T_NATIVE_DOUBLE_g by linking to 
__imp__H5T_NATIVE_DOUBLE_g (auto-import)
Info: resolving _H5T_C_S1_g by linking to __imp__H5T_C_S1_g (auto-import)
Info: resolving _H5P_CLS_DATASET_CREATE_g by linking to 
__imp__H5P_CLS_DATASET_CREATE_g (auto-import)
Info: resolving _H5T_NATIVE_FLOAT_g by linking to 
__imp__H5T_NATIVE_FLOAT_g (auto-import)

Program Versions:
meep                    0.20.3
libctl
harminv
Cygwin supplied programs and libraries including fftw, guile, hdf5, 
pkg-config, etc
autoconf                6-1
automake                3-1
fftw3                   3.1.2-2
gcc                     3.4.4-3
gcc-core                3.4.4-3
gcc-g++                 3.4.4-3
gcc-g77                 3.4.4-3
gsl                     1.12-1
guile                   1.8.2-1
libfftw3-devel          3.1.2-2
libfftw3_3              3.1.2-2
libgmp-devel            4.2.4-1
libgmp3         4.2.4-1
libguile12              1.6.7-4
libguile17              1.8.2-1
libhdf5-devel           1.6.7-2
libhdf5_0               1.6.7-2
libiconv                        1.12-1
libiconv2               1.12-1
make                    3.81-2
openssl                 0.9.8i-1
openssl-devel           0.9.8i-1
openssl097              0.9.7l-1
pkg-config              0.23a-2
readline                5.2.13-11
w32api                  3.13-1


John Dell
Microelectronics Research Group
School of Electrical, Electronic and Computer Engineering
The University of Western Australia
35 Stirling Hwy, Crawley, WA, 6009
AUSTRALIA
Tel: +61 8 6488 3112
Fax: +61 8 6488 1095
Web: http://mrg.ee.uwa.edu.au/ 



_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to