Kernels icon indicating copy to clipboard operation
Kernels copied to clipboard

prk_ranges.h:59:24: error: ‘ranges::views’ has not been declared

Open wangzy0327 opened this issue 2 years ago • 7 comments

What type of issue is this?

  • [build Error ] Bug in the code or other problem

I copyed the make.defs.gcc to make.defs,use g++-11 to make allcxx. I get the error. How to solve the problem?

g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-ranges.cc -DUSE_RANGES_TS -I../deps/range-v3/include -DUSE_RANGES -o stencil-ranges
In file included from stencil-ranges.cc:64:
prk_ranges.h: In function ‘auto prk::range(S, E)’:
prk_ranges.h:59:24: error: ‘ranges::views’ has not been declared
   59 |         return ranges::views::iota(static_cast<decltype(end)>(start), end);
      |                        ^~~~~
compilation terminated due to -fmax-errors=1.
Makefile:232: recipe for target 'stencil-ranges' failed
make[1]: *** [stencil-ranges] Error 1
make[1]: Leaving directory '/home/wzy/Kernels/Cxx11'
Makefile:241: recipe for target 'allcxx' failed
make: *** [allcxx] Error 2

Where does this bug appear?

Check all that apply:

  • [ ] Linux
  • [ ] GCC
  • [ ] CXX
  • [ ] Open-MPI

Operating system

Linux gxnzx1277 4.15.0-188-generic #199-Ubuntu SMP Wed Jun 15 20:42:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 18.04.6 LTS \n \l

Compiler

g++-11 (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PRK build information

make -C Cxx11
make[1]: Entering directory '/home/wzy/Kernels/Cxx11'
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p.cc -o p2p
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil.cc -o stencil
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose.cc -o transpose
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream.cc -o nstream
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" dgemm.cc -o dgemm
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" sparse.cc -o sparse
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p-vector.cc -o p2p-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p-hyperplane-openmp.cc -o p2p-hyperplane-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-vector.cc -o stencil-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-vector.cc -o transpose-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream-vector.cc -o nstream-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" sparse-vector.cc -o sparse-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" dgemm-vector.cc -o dgemm-vector
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-async.cc -o transpose-async
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-thread.cc -o transpose-thread
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-valarray.cc -o transpose-valarray
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream-valarray.cc -o nstream-valarray
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p-hyperplane-openmp.cc -fopenmp -o p2p-hyperplane-openmp
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-openmp.cc -fopenmp -o stencil-openmp
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-openmp.cc -fopenmp -o transpose-openmp
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream-openmp.cc -fopenmp -o nstream-openmp
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p-tasks-openmp.cc -fopenmp -o p2p-tasks-openmp
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-taskloop.cc -fopenmp -o stencil-taskloop
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-taskloop.cc -fopenmp -o transpose-taskloop
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream-taskloop.cc -fopenmp -o nstream-taskloop
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" p2p-innerloop-opencl.cc -I/usr/local/cuda-11.2/include -L/usr/local/cuda-11.2/targets/x86_64-linux/lib -lOpenCL -Wno-ignored-attributes -Wno-deprecated-declarations -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -o p2p-innerloop-opencl
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-opencl.cc -I/usr/local/cuda-11.2/include -L/usr/local/cuda-11.2/targets/x86_64-linux/lib -lOpenCL -Wno-ignored-attributes -Wno-deprecated-declarations -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -o stencil-opencl
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" transpose-opencl.cc -I/usr/local/cuda-11.2/include -L/usr/local/cuda-11.2/targets/x86_64-linux/lib -lOpenCL -Wno-ignored-attributes -Wno-deprecated-declarations -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -o transpose-opencl
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" nstream-opencl.cc -I/usr/local/cuda-11.2/include -L/usr/local/cuda-11.2/targets/x86_64-linux/lib -lOpenCL -Wno-ignored-attributes -Wno-deprecated-declarations -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -o nstream-opencl
g++-11 -std=gnu++20 -pthread -fmax-errors=1 -O3 -mtune=native -ffast-math -g3 -Wall  -DPRKVERSION="2020" stencil-ranges.cc -DUSE_RANGES_TS -I../deps/range-v3/include -DUSE_RANGES -o stencil-ranges

Output showing problem

prk_ranges.h: In function ‘auto prk::range(S, E)’:
prk_ranges.h:59:24: error: ‘ranges::views’ has not been declared
   59 |         return ranges::views::iota(static_cast<decltype(end)>(start), end);
      |                        ^~~~~
compilation terminated due to -fmax-errors=1.
Makefile:232: recipe for target 'stencil-ranges' failed
make[1]: *** [stencil-ranges] Error 1
make[1]: Leaving directory '/home/wzy/Kernels/Cxx11'
Makefile:241: recipe for target 'allcxx' failed
make: *** [allcxx] Error 

@jeffhammond

Please do not attach screenshots of your terminal.

wangzy0327 avatar Aug 22 '23 07:08 wangzy0327

what does your make.defs say about ranges?

for example, this might be useful, as shown in make.defs.gcc:

RANGEFLAG=-DUSE_GCC_RANGES

jeffhammond avatar Aug 22 '23 07:08 jeffhammond

what does your make.defs say about ranges?

for example, this might be useful, as shown in make.defs.gcc:

RANGEFLAG=-DUSE_GCC_RANGES

It default says

RANGEFLAG=-DUSE_RANGES_TS -I../deps/range-v3/include

wangzy0327 avatar Aug 22 '23 07:08 wangzy0327

@jeffhammond how to choose part contents to build in allcxx instead build allcxx?

wangzy0327 avatar Aug 22 '23 09:08 wangzy0327

  1. change RANGEFLAG appropriately. use the GCC implementation if it's available.
  2. look at Cxx11/Makefile to see what targets exist. you can go to that subdirectory and build individual programs if you want.

jeffhammond avatar Aug 22 '23 10:08 jeffhammond

@jeffhammond I tried to build the stencil-range.cc, but it occurs error: 'range' has not been declared. I have installed libboost-all-dev.How to solve the problem?

g++-11 -std=gnu++17 -pthread -O3 -mtune=native -ffast-math -Wall  -Wno-ignored-attributes -Wno-deprecated-declarations -DPRKVERSION="2020" stencil-ranges.cc -DUSE_BOOST_IRANGE -I/usr/include/boost/ -DUSE_RANGES -o stencil-ranges
In file included from stencil-ranges.cc:66:
stencil_ranges.hpp: In function ‘void star1(int, prk::vector<double>&, prk::vector<double>&)’:
stencil_ranges.hpp:2:16: error: ‘ranges’ has not been declared

wangzy0327 avatar Aug 23 '23 03:08 wangzy0327

@jeffhammond Hello, I'm trying to run the Cxx11 cuda and SYCL programs in x86_64 Ubuntu-18.04 machine.But I'm unfamiliar with the make.defs config. Can you help me give you more precise make.defs config about cuda and SYCL? Thank you very much!

wangzy0327 avatar Aug 29 '23 01:08 wangzy0327

I tried to build the stencil-range.cc, but it occurs error: 'range' has not been declared. I have installed libboost-all-dev.How to solve the problem?

g++-11 -std=gnu++17 -pthread -O3 -mtune=native -ffast-math -Wall  -Wno-ignored-attributes -Wno-deprecated-declarations -DPRKVERSION="2020" stencil-ranges.cc -DUSE_BOOST_IRANGE -I/usr/include/boost/ -DUSE_RANGES -o stencil-ranges
In file included from stencil-ranges.cc:66:
stencil_ranges.hpp: In function ‘void star1(int, prk::vector<double>&, prk::vector<double>&)’:
stencil_ranges.hpp:2:16: error: ‘ranges’ has not been declared

@wangzy0327 it sounds like a separate issue from the main thread, but I think ranges are from C++20, you are using -std=gnu++17 here as opposed to what you did earlier

AtlantaPepsi avatar Aug 31 '23 03:08 AtlantaPepsi