# Running MEGANv3.1 preprocessor

**URL:** <https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451>\
**Category:** MEGAN\
**Created:** [June 25, 2021, 1:23pm UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451 "2021-06-25T13:23:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cicy996](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cicy996/32/1261_2.png) [@cicy996](https://forum.cmascenter.org/u/cicy996)\
**Post date:** [June 25, 2021, 1:23pm UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451/1 "2021-06-25T13:23:35Z")

</div>

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.

```auto
(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

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [June 27, 2021, 5:57pm UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451/2 "2021-06-27T17:57:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cicy996](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cicy996/32/1261_2.png) [@cicy996](https://forum.cmascenter.org/u/cicy996)\
**Post date:** [June 28, 2021, 2:12pm UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451/3 "2021-06-28T14:12:10Z")

</div>

Thanks for your reply.

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

---

<div class="post-metadata">

**Author:** ![wang5](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wang5](https://forum.cmascenter.org/u/wang5)\
**Post date:** [August 11, 2022, 4:32am UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451/4 "2022-08-11T04:32:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rrezaei83](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@rrezaei83](https://forum.cmascenter.org/u/rrezaei83)\
**Post date:** [August 15, 2022, 10:23am UTC](https://forum.cmascenter.org/t/running-meganv3-1-preprocessor/2451/5 "2022-08-15T10:23:01Z")

</div>

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

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