Compiler Problems

1,301 views
Skip to first unread message

Matt Ellis

unread,
Sep 5, 2014, 12:21:46 AM9/5/14
to moose...@googlegroups.com
Hello everyone,

I am trying to compile OpenMC with MOOSE using the MOOSE distribution package in Ubuntu.  The compiling process has worked on many systems before, but I have gone through some system changes recently (namely an upgrade to Ubuntu 14.04).  I get the following error when using the Fortran compiler:


/home/matt/closedmc/src/error.f90:36.6:

  use mpi
      1
Fatal Error: Cannot read module file 'mpi.mod' opened at (1), because it was created by a different version of GNU Fortran


I couldn't find a log file in the /opt/moose/ directories stating what version of gfortran was used to build the binaries.  Did I miss it?  Does anyone know which version of gfortran was used?  My gfortran version is 4.8.2.

Thanks!


--

Matthew S. Ellis I Nuclear Engineering Graduate Research Assistant mell...@mit.edu

NW12-312 Cambridge, MA 02139 

Cody Permann

unread,
Sep 5, 2014, 9:27:08 AM9/5/14
to moose...@googlegroups.com
Jason should be able to tell you for sure but he's off until Monday.  You may be able to dig information out with the "objdump" utility.  It's worth checking out anyway.

Cody

Sent from my evil iPad
--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at http://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CAEAqLp9hdkXrwsm0tuchzsh_u8bTJ9XHW8NhGocqabZn2Xw58A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mathias Winkel

unread,
Sep 5, 2014, 10:31:00 AM9/5/14
to moose...@googlegroups.com
Dear Matt,
Sometimes you can be lucky in finding the compiler version used for
creating some library or binary (in your case the MPI library that
accompanies mpi.mod, for example) using
strings -a <binary/library> | grep "GCC"
This only works if the information has not been stripped to reduce file
size.

GCC's .mod files themselves also contain a version number. For older
compilers, these files were just plain text and the file format version
could be read using
head -n 1 mpi.mod
Today, however, they are compressed and you have to do
zcat mpi.mod | head -n 1

Unfortunately, I am not aware of any relation of this number to the GCC
build version. The only numbers I know of are
GCC-4.10/trunk: 13
GCC-4.8.2: 10
However, with these number you know a search direction for the right
version ;-)
As far as I know, the number is bumped infrequently whenever a
modification of the respective file format is performed during compiler
development.

Cheers,
Mathias

On 09/05/2014 03:27 PM, Cody Permann wrote:
> Jason should be able to tell you for sure but he's off until Monday.
> You may be able to dig information out with the "objdump" utility.
> It's worth checking out anyway.
>
> Cody
>
> Sent from my evil iPad
>
> On Sep 4, 2014, at 10:21 PM, Matt Ellis <mell...@mit.edu
> <mailto:mell...@mit.edu>> wrote:
>
>> Hello everyone,
>>
>> I am trying to compile OpenMC with MOOSE using the MOOSE distribution
>> package in Ubuntu. The compiling process has worked on many systems
>> before, but I have gone through some system changes recently (namely
>> an upgrade to Ubuntu 14.04). I get the following error when using the
>> Fortran compiler:
>>
>>
>> /home/matt/closedmc/src/error.f90:36.6:
>>
>> use mpi
>> 1
>> Fatal Error: Cannot read module file 'mpi.mod' opened at (1), because
>> it was created by a different version of GNU Fortran
>>
>>
>> I couldn't find a log file in the /opt/moose/ directories stating what
>> version of gfortran was used to build the binaries. Did I miss it?
>> Does anyone know which version of gfortran was used? My
>> gfortran version is 4.8.2.
>>
>> Thanks!
>>
>>
>> --
>>
>> *Matthew S. Ellis*INuclear Engineering Graduate Research AssistantI
>> mell...@mit.edu <mailto:mell...@mit.edu>
>>
>> NW12-312 Cambridge, MA 02139
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "moose-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to moose-users...@googlegroups.com
>> <mailto:moose-users...@googlegroups.com>.
>> <https://groups.google.com/d/msgid/moose-users/CAEAqLp9hdkXrwsm0tuchzsh_u8bTJ9XHW8NhGocqabZn2Xw58A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "moose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to moose-users...@googlegroups.com
> <mailto:moose-users...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/moose-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/moose-users/6A8D6CFD-22E1-4D44-AD07-CE26776F4569%40gmail.com
> <https://groups.google.com/d/msgid/moose-users/6A8D6CFD-22E1-4D44-AD07-CE26776F4569%40gmail.com?utm_medium=email&utm_source=footer>.

Matt Ellis

unread,
Sep 5, 2014, 10:53:03 AM9/5/14
to moose...@googlegroups.com
Thanks for the help - those commands and insights were really helpful!

I used the head -n 1 mpi.mod got that:

"GFORTRAN module version '6' created from src/binding/f90/mpi.f90 on Thu Dec 12 16:02:22 2013"

My OpenMC module files return:

GFORTRAN module version '10' created from /home/matt/closedmc/src/ace_header.f90

Clearly there is a mismatch in module versions.  

Maybe I should install the newest MOOSE distribution package and see what version is used in that?  Cody, is there anything special I have to do in order to remove an old distribution package and install a new one?

Thanks again!



--
You received this message because you are subscribed to the Google
Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send
--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Matthew S. Ellis I Nuclear Engineering Graduate Research Assistant mell...@mit.edu

NW12-312 Cambridge, MA 02139

Cody Permann

unread,
Sep 5, 2014, 11:02:04 AM9/5/14
to moose...@googlegroups.com
Nope, just delete the whole folder
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CAEAqLp_S09M2kWt%3DTLVqhuJFxuSOWZOAJLWzRjbQ8DeVA-BMrw%40mail.gmail.com.

Derek Gaston

unread,
Sep 5, 2014, 11:03:46 AM9/5/14
to MOOSE
Ummmm - no.  Not on Ubuntu because it's installed by the package manager.

You need to run a command to uninstall the MOOSE package using the package manager... that information is around here somewhere... let me dig it up.

Derek



Derek Gaston

unread,
Sep 5, 2014, 11:04:39 AM9/5/14
to MOOSE
It's right at the bottom of the Ubuntu getting started page: http://mooseframework.org/getting-started/ubuntu-1204/

sudo -E dpkg -r moose-environment

Matt Ellis

unread,
Sep 5, 2014, 11:16:39 AM9/5/14
to moose...@googlegroups.com
Thanks for the help, everyone.  Even with the new package it looks like I'll have different .mod versions.  I'll poke around to see if I can get a compiler to match or wait to hear from Jason on Monday.  

Cheers,



For more options, visit https://groups.google.com/d/optout.

Mark DeHart

unread,
Jul 15, 2016, 12:37:09 PM7/15/16
to moose-users, mell...@mit.edu, jason....@inl.gov
Was a resolution ever found for this issue?  I have the latest compiler package installed (Mac OX 10.11.5, moose-environment-42_elcapitan-10.11_x86_64.pkg) and am getting a similar error trying to build instant within rattlesnake:

$ make instant

MOOSE Compiling Yak Fortran90 (in opt mode) ~/projects/mammoth/yak/contrib/instant/src/precision.f90...

~/projects/mammoth/yak/contrib/instant/src/precision.f90:19.8:


    USE MPI, ONLY : MPI_REAL8, MPI_INTEGER, MPI_DOUBLE_PRECISION, MPI_INTEGER8,

        1

Fatal Error: Cannot read module file 'mpi.mod' opened at (1), because it was created by a different version of GNU Fortran



Cody Permann

unread,
Jul 15, 2016, 1:32:06 PM7/15/16
to moose-users, mell...@mit.edu, jason....@inl.gov
Well this issue probably comes up repeatedly since compiler versions are always advancing. Fortran90+'s *.mod files get generated during compilation, If versions of the compiler switch by the time you compile the first package (usually done by Jason) to the last Fortran file in your application (INSTANT). You may receive this error. That being said, I'm not sure why this would happen because presumably the mpi.mod file was compiled by the Fortran compiler in the same package (i.e. the one you are hopefully using). That's the explanation of what's happening, I'll leave it to Jason to try to understand why it's happening.

Cody

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.

Wang, Yaqi

unread,
Jul 15, 2016, 1:54:09 PM7/15/16
to moose-users
Mark,

You can try 'make cleaninstant' to see if it can fix the problem.

Yaqi

Mark DeHart

unread,
Jul 15, 2016, 2:11:27 PM7/15/16
to moose...@googlegroups.com
Nope - that didn't help.  Same error.

--
You received this message because you are subscribed to a topic in the Google Groups "moose-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/moose-users/tEsc-mXekRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to moose-users...@googlegroups.com.

Miller, Jason M

unread,
Jul 15, 2016, 3:37:22 PM7/15/16
to moose...@googlegroups.com
I am building this now on my machine so I can test with it. It is mammoth though, so it will be a bit.

Miller, Jason M

unread,
Jul 18, 2016, 9:50:38 AM7/18/16
to moose...@googlegroups.com
I can not seem to replicate this. `make instant` seems to work fine.
I did complete an entire make first though. Here were my steps:


clone mammoth (master)
git submodule update --init
build libMesh
build mammoth `make -j 6`
build instant `make instant`

BUT, I did just realize it was with a build of the moose-environment I have not made public yet :/
Let me try again with build 42. 

Jason


Miller, Jason M

unread,
Jul 18, 2016, 10:06:05 AM7/18/16
to moose...@googlegroups.com
Starting over using build 42 made me realize, that in order to build mammoth again properly (cleanly), I have to perform a `make clobberall`. Otherwise I do run the risk of using previous libraries built with the previous compiler stack I had installed (build 47 in my case).

Perhaps that is what is happening to you (remnants of libraries built with a previous moose-environment package).

In any case, I am rebuilding mammoth using moose-environment build 42 after performing a `make clobberall`. I'll post my findings when that is finished.

Jason

Miller, Jason M

unread,
Jul 18, 2016, 12:02:11 PM7/18/16
to moose...@googlegroups.com
Mark,

I am still unable to reproduce this issue. I can build mammoth in its entirety, as well as `make instant` with out issues using build 42.

I can also perform `make instant` with out building mammoth first. Though when I do build with `make instant` with out first building Mammoth, I run into a linking error with a missing mesh-opt library (mesh-opt gets built when one builds mammoth normally I suppose).


If you have no changes to commit, it should be safe to perform a `make clobberall` in mammoth. I'd like you to try that, and attempt to rebuild libMesh, mammoth, and then the `make instant` method. Others here can explain why `make cleanall` does not exactly clean _everything_ that a `make clobberall` does.

Again, use caution when using `clobberall`, it has the ability to delete any new files that have yet to be committed into the repository (or so I have been told).

Thanks!
Jason

Miller, Jason M

unread,
Jul 18, 2016, 12:50:15 PM7/18/16
to moose...@googlegroups.com
Oh I see what I did wrong. I didn't rebuild libMesh when I performed that `make clobberall; make instant` and received the missing mesh-opt...
Didn't have to say anything, but I figured I would.

Mark DeHart

unread,
Jul 18, 2016, 12:50:32 PM7/18/16
to moose...@googlegroups.com
Jason,

I just did a make clobberall and am doing a fresh rebuild of mammoth.  As you noted, this can take a while.

However, one of the things I did do before I posted was to remove /opt/moose and and build it from scratch with the latest moose environment build to get rid of any potential conflicts. That didn't help.

We'll see what happens when this one is finished building.  I'll let you know.

Mark


Miller, Jason M

unread,
Jul 18, 2016, 1:04:09 PM7/18/16
to moose...@googlegroups.com
On Mon, Jul 18, 2016 at 10:50 AM, Mark DeHart <markd...@aggienetwork.com> wrote:
Jason,

I just did a make clobberall and am doing a fresh rebuild of mammoth.  As you noted, this can take a while.

However, one of the things I did do before I posted was to remove /opt/moose and and build it from scratch with the latest moose environment build to get rid of any potential conflicts. That didn't help.

We'll see what happens when this one is finished building.  I'll let you know.

Mark


Those conflicts would have been in your git repository.
Just so you know, when I say:
 

On Mon, Jul 18, 2016 at 8:05 AM, Miller, Jason M <jason....@inl.gov> wrote:
Starting over using build 42 made me realize, that in order to build mammoth again properly (cleanly), I have to perform a `make clobberall`. Otherwise I do run the risk of using previous libraries built with the previous compiler stack I had installed (build 47 in my case).

Perhaps that is what is happening to you (remnants of libraries built with a previous moose-environment package).


What I am trying to convey, is I need to clean stuff out of my git repository sitting in my home directory, not the /opt/moose 'read only' directory. Nothing in /opt/moose is or can be changed while you are building a MOOSE application. Unless of course, you upgraded to a later moose-environment package while you were building Mammoth :)


Jason
 
Reply all
Reply to author
Forward
0 new messages