[ET Trac] #2548: Compilation failure: "const" assignment in LoopControl/src/loopcontrol.cc

Bernard Kelly trac-noreply at einsteintoolkit.org
Fri Aug 6 06:52:05 CDT 2021


#2548: Compilation failure: "const" assignment in LoopControl/src/loopcontrol.cc

 Reporter: Bernard Kelly
   Status: new
Milestone: ET_2021_05
  Version: ET_2021_05
     Type: bug
 Priority: blocker
Component: EinsteinToolkit thorn

Fresh download & first compilation of the latest ETK release. Compilation fails during LoopControl because a dynamic variable is used to set a const constexpr parameter “lc\_random\_range”. Here’s the error message:  
  
`COMPILING Carpet/LoopControl/src/loopcontrol.cc
/gpfs/scratch/bjk0015/codes/Cactus_ET_2021_05/arrangements/Carpet/LoopControl/src/loopcontrol.cc(70): error: function call must have a constant value in a constant expression
      lc_random.max() - lc_random.min() + 1;
                ^

/gpfs/scratch/bjk0015/codes/Cactus_ET_2021_05/arrangements/Carpet/LoopControl/src/loopcontrol.cc(70): error: function call must have a constant value in a constant expression
      lc_random.max() - lc_random.min() + 1;`

… though it’s useful to see the full assignment, which begins the line before \(line 69\):

`
minstd_rand::result_type const constexpr lc_random_range =
    lc_random.max() - lc_random.min() + 1;`

Fix: take out the “const” and “constexpr” descriptors from the lc\_random\_range declaration. git diff is attached.

Further notes:

The compilation is on the WVU machine Spruce Knob, using the Intel 17.0.1 compiler. I’m using the following configuration options:

CC=icc

CFLAGS=-Ofast -qopenmp -xHost  -align -std=gnu99

CPP=cpp

CPPFLAGS=-DMPICH\_IGNORE\_CXX\_SEEK

CPP\_DEBUG\_FLAGS=-DCARPET\_DEBUG

CPP\_OPENMP\_FLAGS=-fopenmp

CROSS\_COMPILE=yes

CXX=icpc

CXXFLAGS=-Ofast -qopenmp -xHost  -align -std=gnu\+\+11

CXX\_DEBUG\_FLAGS=-O0

CXX\_NO\_OPTIMISE\_FLAGS=-O0

CXX\_OPENMP\_FLAGS=-fopenmp

CXX\_OPTIMISE\_FLAGS=-Ofast

CXX\_PROFILE\_FLAGS=-pg

C\_DEBUG\_FLAGS=-O0

C\_LINE\_DIRECTIVES=yes

C\_NO\_OPTIMISE\_FLAGS=-O0

C\_OPENMP\_FLAGS=-fopenmp

C\_OPTIMISE\_FLAGS=-Ofast

C\_PROFILE\_FLAGS=-pg
attachment: git_diff_loopcontrol_dot_cc.txt (https://api.bitbucket.org/2.0/repositories/einsteintoolkit/tickets/issues/2548/attachments/git_diff_loopcontrol_dot_cc.txt)


--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2548/compilation-failure-const-assignment-in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20210806/5c84130b/attachment.html 


More information about the Trac mailing list