https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82629
Bug ID: 82629 Summary: OpenMP 4.5 Target Region mangling problem Product: gcc Version: 7.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thorstenkurth at me dot com Target Milestone: --- Dear Sir/Madam, I run into linking issues with gcc (GCC) 7.1.1 20170718 and OpenMP 4.5 target offloading. I am compiling a mixed fortran/C++ code where target regions can be in both source files. The final linking stage fails with the following error message: mpic++ -g -O3 -std=c++11 -fopenmp -foffload=nvptx-none -DCG_USE_OLD_CONVERGENCE_CRITERIA -DBL_OMP_FABS -DNDEBUG -DBL_USE_MPI -DBL_USE_OMP -DBL_GCC_VERSION='7.1.1' -DBL_GCC_MAJOR_VERSION=7 -DBL_GCC_MINOR_VERSION=1 -DBL_SPACEDIM=3 -DBL_FORT_USE_UNDERSCORE -DBL_Linux -DMG_USE_FBOXLIB -DBL_USE_F_BASELIB -DBL_USE_FORTRAN_MPI -DUSE_F90_SOLVERS -I. -I../../Src/C_BoundaryLib -I../../Src/LinearSolvers/C_CellMG -I../../Src/LinearSolvers/C_CellMG4 -I../../Src/C_BaseLib -I../../Src/C_BoundaryLib -I../../Src/C_BaseLib -I../../Src/LinearSolvers/C_CellMG -I../../Src/LinearSolvers/C_CellMG4 -I../../Src/LinearSolvers/C_to_F_MG -I../../Src/LinearSolvers/C_to_F_MG -I../../Src/LinearSolvers/F_MG -I../../Src/LinearSolvers/F_MG -I../../Src/F_BaseLib -I../../Src/F_BaseLib -L. -o main3d.gnu.MPI.OMP.ex o/3d.gnu.MPI.OMP.EXE/main.o o/3d.gnu.MPI.OMP.EXE/writePlotFile.o o/3d.gnu.MPI.OMP.EXE/FabSet.o o/3d.gnu.MPI.OMP.EXE/BndryRegister.o o/3d.gnu.MPI.OMP.EXE/Mask.o o/3d.gnu.MPI.OMP.EXE/MultiMask.o o/3d.gnu.MPI.OMP.EXE/BndryData.o o/3d.gnu.MPI.OMP.EXE/InterpBndryData.o o/3d.gnu.MPI.OMP.EXE/MacBndry.o o/3d.gnu.MPI.OMP.EXE/ABecLaplacian.o o/3d.gnu.MPI.OMP.EXE/CGSolver.o o/3d.gnu.MPI.OMP.EXE/LinOp.o o/3d.gnu.MPI.OMP.EXE/Laplacian.o o/3d.gnu.MPI.OMP.EXE/MultiGrid.o o/3d.gnu.MPI.OMP.EXE/ABec2.o o/3d.gnu.MPI.OMP.EXE/ABec4.o o/3d.gnu.MPI.OMP.EXE/BoxLib.o o/3d.gnu.MPI.OMP.EXE/ParmParse.o o/3d.gnu.MPI.OMP.EXE/Utility.o o/3d.gnu.MPI.OMP.EXE/UseCount.o o/3d.gnu.MPI.OMP.EXE/DistributionMapping.o o/3d.gnu.MPI.OMP.EXE/ParallelDescriptor.o o/3d.gnu.MPI.OMP.EXE/VisMF.o o/3d.gnu.MPI.OMP.EXE/Arena.o o/3d.gnu.MPI.OMP.EXE/BArena.o o/3d.gnu.MPI.OMP.EXE/CArena.o o/3d.gnu.MPI.OMP.EXE/OMPArena.o o/3d.gnu.MPI.OMP.EXE/NFiles.o o/3d.gnu.MPI.OMP.EXE/FabConv.o o/3d.gnu.MPI.OMP.EXE/FPC.o o/3d.gnu.MPI.OMP.EXE/Box.o o/3d.gnu.MPI.OMP.EXE/IntVect.o o/3d.gnu.MPI.OMP.EXE/IndexType.o o/3d.gnu.MPI.OMP.EXE/Orientation.o o/3d.gnu.MPI.OMP.EXE/Periodicity.o o/3d.gnu.MPI.OMP.EXE/RealBox.o o/3d.gnu.MPI.OMP.EXE/BoxList.o o/3d.gnu.MPI.OMP.EXE/BoxArray.o o/3d.gnu.MPI.OMP.EXE/BoxDomain.o o/3d.gnu.MPI.OMP.EXE/FArrayBox.o o/3d.gnu.MPI.OMP.EXE/IArrayBox.o o/3d.gnu.MPI.OMP.EXE/BaseFab.o o/3d.gnu.MPI.OMP.EXE/MultiFab.o o/3d.gnu.MPI.OMP.EXE/iMultiFab.o o/3d.gnu.MPI.OMP.EXE/FabArray.o o/3d.gnu.MPI.OMP.EXE/CoordSys.o o/3d.gnu.MPI.OMP.EXE/Geometry.o o/3d.gnu.MPI.OMP.EXE/MultiFabUtil.o o/3d.gnu.MPI.OMP.EXE/BCRec.o o/3d.gnu.MPI.OMP.EXE/PhysBCFunct.o o/3d.gnu.MPI.OMP.EXE/PlotFileUtil.o o/3d.gnu.MPI.OMP.EXE/BLProfiler.o o/3d.gnu.MPI.OMP.EXE/BLBackTrace.o o/3d.gnu.MPI.OMP.EXE/MemPool.o o/3d.gnu.MPI.OMP.EXE/MGT_Solver.o o/3d.gnu.MPI.OMP.EXE/FMultiGrid.o o/3d.gnu.MPI.OMP.EXE/MultiFab_C_F.o o/3d.gnu.MPI.OMP.EXE/backtrace_c.o o/3d.gnu.MPI.OMP.EXE/fabio_c.o o/3d.gnu.MPI.OMP.EXE/timer_c.o o/3d.gnu.MPI.OMP.EXE/BLutil_F.o o/3d.gnu.MPI.OMP.EXE/BLParmParse_F.o o/3d.gnu.MPI.OMP.EXE/BLBoxLib_F.o o/3d.gnu.MPI.OMP.EXE/BLProfiler_F.o o/3d.gnu.MPI.OMP.EXE/INTERPBNDRYDATA_3D.o o/3d.gnu.MPI.OMP.EXE/LO_UTIL.o o/3d.gnu.MPI.OMP.EXE/ABec_3D.o o/3d.gnu.MPI.OMP.EXE/ABec_UTIL.o o/3d.gnu.MPI.OMP.EXE/LO_3D.o o/3d.gnu.MPI.OMP.EXE/LP_3D.o o/3d.gnu.MPI.OMP.EXE/MG_3D.o o/3d.gnu.MPI.OMP.EXE/ABec2_3D.o o/3d.gnu.MPI.OMP.EXE/ABec4_3D.o o/3d.gnu.MPI.OMP.EXE/COORDSYS_3D.o o/3d.gnu.MPI.OMP.EXE/FILCC_3D.o o/3d.gnu.MPI.OMP.EXE/BaseFab_nd.o o/3d.gnu.MPI.OMP.EXE/threadbox.o o/3d.gnu.MPI.OMP.EXE/MultiFabUtil_3d.o o/3d.gnu.MPI.OMP.EXE/mempool_f.o o/3d.gnu.MPI.OMP.EXE/compute_defect.o o/3d.gnu.MPI.OMP.EXE/coarsen_coeffs.o o/3d.gnu.MPI.OMP.EXE/mg_prolongation.o o/3d.gnu.MPI.OMP.EXE/ml_prolongation.o o/3d.gnu.MPI.OMP.EXE/cc_mg_cpp.o o/3d.gnu.MPI.OMP.EXE/cc_applyop.o o/3d.gnu.MPI.OMP.EXE/cc_ml_resid.o o/3d.gnu.MPI.OMP.EXE/cc_smoothers.o o/3d.gnu.MPI.OMP.EXE/cc_stencil.o o/3d.gnu.MPI.OMP.EXE/cc_stencil_apply.o o/3d.gnu.MPI.OMP.EXE/cc_stencil_fill.o o/3d.gnu.MPI.OMP.EXE/cc_interface_stencil.o o/3d.gnu.MPI.OMP.EXE/cc_mg_tower_smoother.o o/3d.gnu.MPI.OMP.EXE/itsol.o o/3d.gnu.MPI.OMP.EXE/mg.o o/3d.gnu.MPI.OMP.EXE/mg_tower.o o/3d.gnu.MPI.OMP.EXE/ml_cc.o o/3d.gnu.MPI.OMP.EXE/ml_nd.o o/3d.gnu.MPI.OMP.EXE/ml_norm.o o/3d.gnu.MPI.OMP.EXE/tridiag.o o/3d.gnu.MPI.OMP.EXE/nodal_mg_cpp.o o/3d.gnu.MPI.OMP.EXE/nodal_mask.o o/3d.gnu.MPI.OMP.EXE/nodal_divu.o o/3d.gnu.MPI.OMP.EXE/nodal_interface_stencil.o o/3d.gnu.MPI.OMP.EXE/nodal_newu.o o/3d.gnu.MPI.OMP.EXE/nodal_stencil.o o/3d.gnu.MPI.OMP.EXE/nodal_stencil_fill.o o/3d.gnu.MPI.OMP.EXE/nodal_smoothers.o o/3d.gnu.MPI.OMP.EXE/nodal_stencil_apply.o o/3d.gnu.MPI.OMP.EXE/nodal_sum.o o/3d.gnu.MPI.OMP.EXE/nodal_mg_tower_smoother.o o/3d.gnu.MPI.OMP.EXE/stencil_types.o o/3d.gnu.MPI.OMP.EXE/nodal_sync_resid.o o/3d.gnu.MPI.OMP.EXE/stencil_util.o o/3d.gnu.MPI.OMP.EXE/bc.o o/3d.gnu.MPI.OMP.EXE/bc_functions.o o/3d.gnu.MPI.OMP.EXE/bl_constants.o o/3d.gnu.MPI.OMP.EXE/bl_error.o o/3d.gnu.MPI.OMP.EXE/bl_IO.o o/3d.gnu.MPI.OMP.EXE/bl_stream.o o/3d.gnu.MPI.OMP.EXE/bl_string.o o/3d.gnu.MPI.OMP.EXE/bl_timer.o o/3d.gnu.MPI.OMP.EXE/bl_types.o o/3d.gnu.MPI.OMP.EXE/bl_mem_stat.o o/3d.gnu.MPI.OMP.EXE/bl_space.o o/3d.gnu.MPI.OMP.EXE/bl_prof_stubs.o o/3d.gnu.MPI.OMP.EXE/bndry_reg.o o/3d.gnu.MPI.OMP.EXE/box_f.o o/3d.gnu.MPI.OMP.EXE/boxarray_f.o o/3d.gnu.MPI.OMP.EXE/define_bc_tower.o o/3d.gnu.MPI.OMP.EXE/fab.o o/3d.gnu.MPI.OMP.EXE/fabio.o o/3d.gnu.MPI.OMP.EXE/knapsack.o o/3d.gnu.MPI.OMP.EXE/layout.o o/3d.gnu.MPI.OMP.EXE/list_box.o o/3d.gnu.MPI.OMP.EXE/ml_boxarray.o o/3d.gnu.MPI.OMP.EXE/ml_layout.o o/3d.gnu.MPI.OMP.EXE/ml_multifab.o o/3d.gnu.MPI.OMP.EXE/cc_restriction.o o/3d.gnu.MPI.OMP.EXE/nodal_restriction.o o/3d.gnu.MPI.OMP.EXE/ml_cc_restriction.o o/3d.gnu.MPI.OMP.EXE/ml_nd_restriction.o o/3d.gnu.MPI.OMP.EXE/nodal_neumann_bcs.o o/3d.gnu.MPI.OMP.EXE/nodal_stencil_bc.o o/3d.gnu.MPI.OMP.EXE/multifab_f.o o/3d.gnu.MPI.OMP.EXE/sort_box.o o/3d.gnu.MPI.OMP.EXE/sort_d.o o/3d.gnu.MPI.OMP.EXE/sort_i.o o/3d.gnu.MPI.OMP.EXE/vector_i.o o/3d.gnu.MPI.OMP.EXE/omp.o o/3d.gnu.MPI.OMP.EXE/parallel.o o/3d.gnu.MPI.OMP.EXE/multifab_c.o o/3d.gnu.MPI.OMP.EXE/backtrace_f.o o/3d.gnu.MPI.OMP.EXE/RHS_3D.o o/3d.gnu.MPI.OMP.EXE/COEF_3D.o o/3d.gnu.MPI.OMP.EXE/bl_fort_module.o -lmpi_ibm /autofs/nccs-svm1_sw/summitdev/gcc/7.1.1-20170802/bin/../lib/gcc/powerpc64le-unknown-linux-gnu/7.1.1/../../../../lib64/libgfortran.a lto1: fatal error: o/3d.gnu.MPI.OMP.EXE/FabSet.o: section _ZN7BaseFabIdE4multEdRK3Boxii$_omp_fn$1 is missing Looking carefully into that object file I find: -bash-4.2$ nm o/3d.gnu.MPI.OMP.EXE/FabSet.o | grep omp | grep Base | grep mult 00000000000002d0 t _ZN7BaseFabIdE4multEdRK3Boxii._omp_fn.0 0000000000000000 t _ZN7BaseFabIdE4multEdRK3Boxii._omp_fn.1 0000000000000000 d _ZZN7BaseFabIdE4multEdRK3BoxiiE19.omp_data_kinds.145 0000000000000002 d _ZZN7BaseFabIdE4multEdRK3BoxiiE19.omp_data_kinds.153 0000000000000018 d _ZZN7BaseFabIdE4multEdRK3BoxiiE19.omp_data_sizes.152 The second entry is the function it is actually looking for, except that the suffix $_omp_fn$1 is ._omp_fn.1 instead. Is that an issue? In any case, the code does not link. Can you tell me if that different naming is actually a problem or if that is just a difference in printing between c++ linker and nm? Best Regards Thorsten Kurth