illegal instruction constexpr v1712 v1806
Trying to compile a new solver on windows 10 bash with ubuntu. Compiler returns an error saying illegal instruction constexpr. This has occurred on versions 1712 and 1806 in the header file floatScalar.H. I believe it has been a repeated issue from what I have seen on the forums so others will probably be able to provide more information. I don't know if this is a version issue because I updated all my compilers. I only come because the only solution I have seen found to this anywhere is revert to OF5. I have seen this exact issue reported on v1706 as well.
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Developer
- Maintainer
@Pawan - do you know which compiler version is used there?
- Reporter
@mark: gcc-6.3 (compiled and shipped in third party folder)
- Author Maintainer
Is there any progress on this issue?
By Cole Mueller on 2018-07-17T17:33:08 (imported from GitLab project)
- Maintainer
Hi Cole, It took me a bit to get gcc-6.3 working on my system - got a bit stuck with building gcc63 at all on my newer system. Now I'm compiling through with gcc-6.3.0 (on Linux) and see no issues. This makes me wonder if this is something specific to ubuntu+windows.
The difference between
constexpr scalar
vsstatic const scalar
is not a revert, but also about how these constant are being defined. We have them asconstexpr
since the values are indeed compile-time constants, and we have elected to use known, fixed values. Eg,constexpr floatScalar floatScalarROOTVSMALL = 1.0e-18;
It instead you used some mathematical operation
floatScalarROOTVSMALL = ::sqrt(1.0e-36);
this could be known at compile time, but no guarantee and thus not constexpr.
So the question: why does this occur for your installation, but not mine? I took a very quick look at the cfd-online forum, but didn't immediately see any further information.
Thanks, /mark
- Author Maintainer
Is the solution here a valid solution?
It is saying install OF5? I can't seem to find that on OF.com or the sourceforge site. Is openfoam.org and affiliate or a valid site to download from? I only ask because there are several places recommending this download as a potential solution.
Cole
By Cole Mueller on 2018-07-20T19:22:21 (imported from GitLab project)
- Maintainer
Thank you for the link, I've cross-posted there now. Interestingly, the problem mentioned there was originally related to
static const floatScalar
which we do not have in the last two versions.As Mattijs mentioned in #776 (closed) - it might be a general gcc on windows issue, or perhaps only a gcc-6.3.0 on windows issue. With gcc-6.3.0 installed on opensuse, I didn't encounter any compilation issue. I've also tried with ubuntu-18.04 in a virtualbox, but that comes with gcc-7.3.0 and doesn't exhibit any issues either.
Can you try with a different gcc version. The ThirdParty makeGcc script helps there. After this gets compiled, you need to defined WM_COMPILER=Gcc64 and WM_COMPILER_TYPE=ThirdParty in the etc/bashrc or a corresponding etc/prefs.sh file. If the problem persists, we can try something else afterwards.
Re: openfoam.org etc. The OpenFOAM Foundation Ltd was originally established by OpenCFD for release purposes (see a brief history) and was managed by OpenCFD and SGI (later ESI). After 2014, some of the individuals tasked with managing the Foundation's activities left OpenCFD to establish their own company.
- Author Maintainer
So I'm not very experienced with this type of stuff. Currently I have gcc 6.4.0 installed and will run if I execute "gcc-6" but I can't get OpenFOAM to take it or use it any way probably because I don't know what I'm doing. I can't really find anything online describing how to force openfoam to use a different compiler. For the limited descriptions out there of people doing this it is entirely different file layout from the v1706+ layouts where settings.sh and other such files have been remove, changed, or moved to places I cannot seem to find. I have changed several things and it always defaults to the OpenFOAM gcc 6.3.0 rather than the gcc-6 that contains the 6.4.0. Also on my machine it seems that OpenFOAM's gcc 6.3.0 version supersedes the ubuntu version as default and I do not know the purpose for this. It seems to also prevent me from changing that as well which may be why if I select system gcc compilation settings and the like it defaults to the OpenFOAM compiler instead of others on the system.
Sorry for the long response. I'm frustrated and can't seem to find anything online describing necessary modifications to force OpenFOAM to use other gcc versions.
By Cole Mueller on 2018-07-23T15:41:29 (imported from GitLab project)
- Maintainer
I can understand your pain - it's almost as painful being at the other end and not knowing what is going wrong or what your machine looks like.
For configuring different types of compilers there are two variables that determine the preferences. Both of these have some description in the
etc/bashrc
file.# [WM_COMPILER_TYPE] - Compiler location: # = system | ThirdParty export WM_COMPILER_TYPE=system # [WM_COMPILER] - Compiler: # = Gcc | Gcc4[8-9] | Gcc5[1-5] | Gcc6[1-4] | Gcc7[1-3] | Gcc8[1] | GccKNL | # Clang | Clang3[7-9] | Clang[4-6]0 | Icc | IccKNL | Cray | Arm export WM_COMPILER=Gcc
If you set
WM_COMPILER_TYPE=ThirdParty
, the compiler is expected to be an OpenFOAM one under the corresponding ThirdParty directory. Withsystem
it doesn't attempt to do anything special there.Setting
WM_COMPILER=Gcc
orClang
orIcc
will determine which flavour of compiler you have. If you have a system compiler, this means it callsg++
,clang++
etc. However, if you haveWM_COMPILER=Gcc64
combined with this will not cause it to invokegcc-6
or something. It will still only callgcc
. If you have that combined withWM_COMPILER_TYPE=ThirdParty
- then the ThirdParty directory is added to the path, causing its gcc to be seen first.In a plain (non-OpenFOAM) shell, what does
type gcc
point to and what value do you get forgcc --version
? In an OpenFOAM shell: what are the values for WM_COMPILER and WM_COMPILER_TYPE (you may need to re-source the etc/bashrc)? And again, what dotype gcc
andgcc --version
return? - Author Maintainer
In a plain shell gcc --version shows ubuntu 6.4.0. type gcc returns the standard "gcc is hashed (/usr/bin/gcc)" as expected. When in a OF shell it type gcc returns "gcc is hashed (/opt/OpenFOAM/ThirdParty-v1806/platforms/linux64/gcc-6.3.0/bin/gcc)" and gcc --version returns 6.3.0.
The values for WM_COMPILER is Gcc63 and _Type is ThirdParty in the bashrc file. In the makeGcc file WM_COMPILER is Gcc and _Type is ThirdParty.
And I understand your pain haha. Trying to diagnose an issue without seeing the computer is difficult to say the least.
By Cole Mueller on 2018-07-23T17:46:47 (imported from GitLab project)
- Maintainer
OK, lets try this.
WM_COMPILER_TYPE=system WM_COMPILER=Gcc
If you wish, you can also set
WM_COMPILER=Gcc64
instead, which won't affect the behaviour (still uses system gcc) but changes where the objects are generated. This is probably only useful if you have some other existing objects that you don't want to mess with.Refresh your OpenFOAM shell with the new settings and it should now be using gcc 6.4.0 from your system gcc. Let's hope that this solves the problem before we both lose our minds!
Edited by Mark OLESEN - Author Maintainer
That worked. It is likely a 6.3.0 issue on windows then for some reason.
By Cole Mueller on 2018-07-24T13:38:27 (imported from GitLab project)
- Maintainer
Good to hear it is now working.
- So it could be a gcc-6.3.0 on windows issue,
- or maybe some conflicts between ThirdParty gcc and system includes (I don't really believe it 100%, but you never know).
Anyhow, if you could also post your success story onto cfd-online so that others can benefit from the possible solution.
@Pawan : this might be something that we need to investigate more, but I don't have any windows.
- Maintainer
@colemuel - OK if we now call this closed?
- Author Maintainer
Yes we can Thank You
By Cole Mueller on 2018-07-24T21:34:17 (imported from GitLab project)
- Admin closed
closed
By Cole Mueller on 2018-07-24T21:34:17 (imported from GitLab project)
- Reporter
@mark : Thanks. I will check this on my windows machine .
- Mark OLESEN assigned to @mark
assigned to @mark
- Admin mentioned in issue #1487 (closed)
mentioned in issue #1487 (closed)
By Rodrigo André Zelada Mancini on 2019-11-09T15:21:15 (imported from GitLab project)