Running MEGANv3.1 preprocessor

Hi,

I am having a problem about running MEGANv3.1 preprocessor (compiled by gfortran).
When I type ./prepmegan4cmaq.grwform.x < prepmegan4cmaq.inp. It shows Segmentation fault (core dumped) and generate a core. file.

Then I typed gdb -c core. prepmegan4cmaq.grwform.x to check the error.
Here is the detail info.

(gdb) bt
#0  0x00007f3df9d2c6ae in _gfortrani_generate_error_common (cmp=0x7ffe4c0bffc0, family=-1, message=0x0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/runtime/error.c:666
#1  0x00007f3df9d2c850 in _gfortrani_generate_error (cmp=cmp@entry=0x7ffe4c0bffc0, family=family@entry=-1, message=message@entry=0x0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/runtime/error.c:732
#2  0x00007f3df9e5d2dc in hit_eof (dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4614
#3  _gfortrani_hit_eof (dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4605
#4  0x00007f3df9e5dc5d in next_record_r (done=1, dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:3664
#5  _gfortrani_next_record (dtp=dtp@entry=0x7ffe4c0bffc0, done=done@entry=1)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4062
#6  0x00007f3df9e5fdc3 in finalize_transfer (dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4199
#7  0x00007f3df9e5fe3f in _gfortrani_st_read_done_worker (dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4313
#8  0x00007f3df9e5ff33 in _gfortran_st_read_done (dtp=0x7ffe4c0bffc0)
    at /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601690338510/work/.build/x86_64-conda-linux-gnu/src/gcc/libgfortran/io/transfer.c:4358
#9  0x000000000041a07b in MAIN__ ()
#10 0x000000000040176d in main ()

It really puzzled me what this error means. Do I need to compile the .x again?

Regards and thanks,
Chang

It would be best to re-compile with -g -O0 -fbacktrace in order to get a core-file with the indexing info gdb needs in order to know what is going on.

1 Like

Thanks for your reply.

I recompile the megan preprocessing tools (.x) and it get resolved.

HI thanks for your question when i run my MEGAN3.2 preprocessing tools have same question. can you tell me who to add -g etc., option to compile .in the makefile(flage option) ? and i add it in make file but not exist the core file. thank you very much i hope can receive your reply.

@wang5
These are the gfortran flag options in the makefiles:

FFLAGS = -O3 -ffixed-line-length-132 -ffast-math -funroll-loops -m64 -fopenmp