Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error in Getting Started #131

Closed
49takashi opened this issue Jul 13, 2022 · 10 comments
Closed

Compile error in Getting Started #131

49takashi opened this issue Jul 13, 2022 · 10 comments

Comments

@49takashi
Copy link

Hi,

I'm trying to run IAMR following Getting Started. When I execute make, I encountered the following error

Compiling AMReX_MLEBNodeFDLaplacian.cpp ...
g++ -MMD -MP  -Werror=return-type -g -O3 -std=c++14  -pthread    -DBL_SPACEDIM=2 -DAMREX_SPACEDIM=2 -DBL_FORT_USE_UNDERSCORE -DAMREX_FORT_USE_UNDERSCORE -DBL_Linux -DAMREX_Linux -DNDEBUG -DAMREX_NO_PROBINIT -Itmp_build_dir/s/2d.gnu.EXE -I. -I. -I../../Source -I../../Source/prob -I../../Source/Utilities -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Slopes -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Utils -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/MOL -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Godunov -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/BDS -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Projections -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Base -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Base/Parser -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/AmrCore -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Amr -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Boundary -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Tools/C_scripts  -c /dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.cpp -o tmp_build_dir/o/2d.gnu.EXE/AMReX_MLEBNodeFDLaplacian.o
In file included from /dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.cpp:1:0:
/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H:122:71: error: array must be initialized with a brace-enclosed initializer
     GpuArray<Real,AMREX_SPACEDIM> m_sigma{AMREX_D_DECL(1_rt,1_rt,1_rt)};
                                                                       ^
/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H:122:71: error: too many initializers for ‘amrex::GpuArray<double, 2u>’
/dfs/user/takashi279/plasma/design/multiscale/amrex/Tools/GNUMake/Make.rules:255: recipe for target 'tmp_build_dir/o/2d.gnu.EXE/AMReX_MLEBNodeFDLaplacian.o' failed
make: *** [tmp_build_dir/o/2d.gnu.EXE/AMReX_MLEBNodeFDLaplacian.o] Error 1

The options I set in the GNUMakefile is as follows:

#AMREX_HOME defines the directory in which we will find the BoxLib directory
AMREX_HOME=/dfs/user/takashi279/plasma/design/multiscale/amrex
AMREX_HYDRO_HOME=/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro

#TOP defines the directory in which we will find Source, Exec, etc.
TOP = ../..

#
# Variables for the user to set ...
#

PRECISION   = DOUBLE

DIM         = 2
COMP        = gnu

DEBUG       = FALSE
USE_MPI     = FALSE
USE_OMP     = FALSE
PROFILE     = FALSE

USE_CUDA = FALSE

USE_SENSEI_INSITU = FALSE

EBASE = amr

Blocs   := .

include $(TOP)/Exec/Make.IAMR

Am I missing any dependencies? Any help would be really appreciated.

@WeiqunZhang
Copy link
Member

What version of gcc are you using? Could you try to add an extra pair of braces to the line in AMReX_MLEBNodeFDLaplacian.H?

GpuArray<Real,AMREX_SPACEDIM> m_sigma{{AMREX_D_DECL(1_rt,1_rt,1_rt)}};

@49takashi
Copy link
Author

Thank you @WeiqunZhang for the reply. The version of GCC is 12.1.0:

(amrex) takashi279@hyperturing1:/dfs/user/takashi279/plasma/design/multiscale/IAMR/Exec/eb_run2d$ gcc --version
gcc (conda-forge gcc 12.1.0-16) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.

As you suggested, after I added an extra pair of braces to the line, it could successfully compile AMReX_MLEBNodeFDLaplacian.cpp. But, I got another error:

Compiling AMReX_EB2_IndexSpace_STL.cpp ...
g++ -MMD -MP  -Werror=return-type -g -O3 -std=c++14  -fopenmp -pthread    -DBL_USE_OMP -DAMREX_USE_OMP -DBL_SPACEDIM=2 -DAMREX_SPACEDIM=2 -DBL_FORT_USE_UNDERSCORE -DAMREX_FORT_USE_UNDERSCORE -DBL_Linux -DAMREX_Linux -DAMREX_USE_EB -DNDEBUG -DAMREX_NO_PROBINIT -Itmp_build_dir/s/2d.gnu.OMP.EXE -I. -I. -I../../Source -I../../Source/prob -I../../Source/Utilities -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Slopes -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Utils -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/MOL -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Godunov -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/BDS -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Projections -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/Redistribution -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/EBMOL -I/dfs/user/takashi279/plasma/design/multiscale/AMReX-Hydro/EBGodunov -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Base -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Base/Parser -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/AmrCore -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Amr -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/Boundary -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/LinearSolvers/MLMG -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Src/EB -I/dfs/user/takashi279/plasma/design/multiscale/amrex/Tools/C_scripts  -c /dfs/user/takashi279/plasma/design/multiscale/amrex/Src/EB/AMReX_EB2_IndexSpace_STL.cpp -o tmp_build_dir/o/2d.gnu.OMP.EXE/AMReX_EB2_IndexSpace_STL.o
/dfs/user/takashi279/plasma/design/multiscale/amrex/Tools/C_scripts/makebuildinfo_C.py \
          --amrex_home "/dfs/user/takashi279/plasma/design/multiscale/amrex" \
          --COMP "gnu" --COMP_VERSION "5.5.0" \
          --FCOMP "" --FCOMP_VERSION "" \
          --GIT "../.. /dfs/user/takashi279/plasma/design/multiscale/amrex"
  File "/dfs/user/takashi279/plasma/design/multiscale/amrex/Tools/C_scripts/makebuildinfo_C.py", line 441
    newline = line.replace(f"@@{keyword}@@",
                                          ^
SyntaxError: invalid syntax
../../Exec/Make.IAMR:82: recipe for target 'AMReX_buildInfo.cpp' failed
make: *** [AMReX_buildInfo.cpp] Error 1

Is it due to the inconsistency of versions of GCC or other packages?

@WeiqunZhang
Copy link
Member

We will make some changes to make sure amrex works with gcc 12.

The new error is in python. @zingale do you have any ideas?

@zingale
Copy link

zingale commented Jul 13, 2022

can you tell me what version of python you are using?

@zingale
Copy link

zingale commented Jul 13, 2022

I was able to build eb_run2d without issues (didn't need to make the change above) with GCC 12.1.0 and python 3.10.5

@zingale
Copy link

zingale commented Jul 13, 2022

it is crashing on the first f-string -- you will need to make sure that you are using python 3.6 or later.

@49takashi
Copy link
Author

Thank you @zingale for the advice. The version of python was 3.5. After I upgraded the version to 3.10.5, all the compilation was done (with extra pair of braces)! But, if I don't add the braces, the same error at the top happened on my environment...

@zingale
Copy link

zingale commented Jul 13, 2022

great.

Not sure about that file problem (turns out I'm using GCC 12.1.1, but I double the x.x.1 makes a diff)

@WeiqunZhang
Copy link
Member

I cannot reproduce it with GCC 12.1.0. Anyway, it wouldn't hurt to add an extra pair of braces in that place.

@WeiqunZhang
Copy link
Member

My understanding is double braces are no longer required since C++14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants