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 #29

Closed
c-bug opened this issue Jan 24, 2019 · 12 comments
Closed

compile error #29

c-bug opened this issue Jan 24, 2019 · 12 comments

Comments

@c-bug
Copy link

c-bug commented Jan 24, 2019

running make, I get these errors.

g++ -std=c++17 -O2 -DREV=\"`git rev-parse --short HEAD``git diff-files --quiet || echo -mod`\" -Wall Pm1Plan.cpp GmpUtil.cpp Worktodo.cpp common.cpp gpuowl.cpp Gpu.cpp clwrap.cpp Task.cpp checkpoint.cpp timeutil.cpp Args.cpp Primes.cpp state.cpp Signal.cpp FFTConfig.cpp -o openowl -lOpenCL -lgmp -pthread -L/opt/rocm/opencl/lib/x86_64 -L/opt/amdgpu-pro/lib/x86_64-linux-gnu -L/c/Windows/System32 -L.
Gpu.cpp: In function ‘void logTimeKernels(std::initializer_list<Kernel*>)’:
Gpu.cpp:153:14: error: expected unqualified-id before ‘[’ token
   for (auto& [stats, name]: infos) {
              ^
Gpu.cpp:153:14: error: expected ‘;’ before ‘[’ token
Gpu.cpp:153:15: error: ‘stats’ was not declared in this scope
   for (auto& [stats, name]: infos) {
               ^~~~~
Gpu.cpp:153:22: error: ‘name’ was not declared in this scope
   for (auto& [stats, name]: infos) {
                      ^~~~
Gpu.cpp: In lambda function:
Gpu.cpp:153:27: error: expected ‘{’ before ‘:’ token
   for (auto& [stats, name]: infos) {
                           ^
Gpu.cpp: In function ‘void logTimeKernels(std::initializer_list<Kernel*>)’:
Gpu.cpp:153:27: error: expected ‘;’ before ‘:’ token
Gpu.cpp:153:27: error: expected primary-expression before ‘:’ token
Gpu.cpp:153:27: error: expected ‘)’ before ‘:’ token
Gpu.cpp:153:27: error: expected primary-expression before ‘:’ token
Gpu.cpp: In member function ‘std::__cxx11::string Gpu::factorPM1(u32, const Args&, u32, u32)’:
Gpu.cpp:610:8: error: expected unqualified-id before ‘[’ token
   auto [block, nPrimes, allSelected] = makePm1Plan(D, B1, B2);
        ^
Gpu.cpp:611:17: error: ‘allSelected’ was not declared in this scope
   u32 nBlocks = allSelected.size();
                 ^~~~~~~~~~~
Gpu.cpp:612:70: error: ‘block’ was not declared in this scope
   log("%u P-1 stage2: %u blocks starting at block %u\n", E, nBlocks, block);
                                                                      ^~~~~
Gpu.cpp:681:39: error: unable to deduce ‘auto&&’ from ‘allSelected’
   for (const vector<bool>& selected : allSelected) {
                                       ^~~~~~~~~~~
Gpu.cpp:708:61: error: ‘nPrimes’ was not declared in this scope
         float percent = (nPrimesDone + nBlocksDone) / float(nPrimes + nBlocks) * 100;
                                                             ^~~~~~~
Task.cpp: In member function ‘bool Task::execute(const Args&)’:
Task.cpp:62:10: error: expected unqualified-id before ‘[’ token
     auto [isPrime, res64] = gpu->isPrimePRP(exponent, args);
          ^
Task.cpp:63:33: error: ‘isPrime’ was not declared in this scope
     return writeResultPRP(args, isPrime, res64, fftSize);
                                 ^~~~~~~
Task.cpp:63:42: error: ‘res64’ was not declared in this scope
     return writeResultPRP(args, isPrime, res64, fftSize);
                                          ^~~~~
Makefile:9: recipe for target 'openowl' failed
make: *** [openowl] Error 1
@valeriob01
Copy link
Contributor

What system is it? I have compiled without problems!

@c-bug
Copy link
Author

c-bug commented Jan 24, 2019

Oh sorry,
debian stretch.

@valeriob01
Copy link
Contributor

I have compiled successfully on debian testing, have you installed all the dependencies ?

@c-bug
Copy link
Author

c-bug commented Jan 24, 2019

Which dependencies? Based on the readme I need a compiler and the OpenCL library?
mfakto compiled without problems, if that helps.

@valeriob01
Copy link
Contributor

You need the libgmp-dev package.

@c-bug
Copy link
Author

c-bug commented Jan 24, 2019

Oh, I got that, apt tells me
libgmp-dev is already the newest version (2:6.1.2+dfsg-1).

@valeriob01
Copy link
Contributor

Ok, then your drivers or library are too old?
Driver version?
OpenCL version?

@preda
Copy link
Owner

preda commented Jan 24, 2019

What version is your compiler:
g++ --version
thanks

@c-bug
Copy link
Author

c-bug commented Jan 25, 2019

Linux 4.19.0-0.bpo.1-amd64
OpenCL 2.1 AMD-APP (2639.3)

g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 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.

@preda
Copy link
Owner

preda commented Jan 25, 2019

OK. Structured bindings, which are part of C++17, are available in gcc starting from gcc 7 according to
https://gcc.gnu.org/projects/cxx-status.html

Could you update your g++, to 7.x or 8.x ?

@valeriob01
Copy link
Contributor

I have made a search and it shows that g++7 and g++8 are only available in Debian Buster (testing).

@preda
Copy link
Owner

preda commented Feb 6, 2019

I'm going to close this. The situation was caused by the c++ compiler not properly supported c++17.

@preda preda closed this as completed Feb 6, 2019
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