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

Cannot Compile #70

Open
zertyz opened this issue Nov 30, 2018 · 5 comments
Open

Cannot Compile #70

zertyz opened this issue Nov 30, 2018 · 5 comments

Comments

@zertyz
Copy link

zertyz commented Nov 30, 2018

I'm using an updated Archlinux on a Raspberry Pi 1 B+ and compilation attempt is:

[root@SmallPi Tests]# make QPU=1 GCD
Compiling GCD.cpp
In file included from ../Lib/QPULib.h:6,
from GCD.cpp:2:
../Lib/Source/Ptr.h: In copy constructor ‘Ptr::Ptr(Ptr&)’:
../Lib/Source/Ptr.h:63:5: error: there are no arguments to ‘assign’ that depend on a template parameter, so a declaration of ‘assign’ must be available [-fpermissive]
assign(this->expr, x.expr);
^~~~~~
../Lib/Source/Ptr.h:63:5: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../Lib/Source/Ptr.h: In copy constructor ‘Ptr::Ptr(const Ptr&)’:
../Lib/Source/Ptr.h:68:5: error: there are no arguments to ‘assign’ that depend on a template parameter, so a declaration of ‘assign’ must be available [-fpermissive]
assign(this->expr, x.expr);
^~~~~~
../Lib/Source/Ptr.h: In member function ‘Ptr& Ptr::operator=(Ptr&)’:
../Lib/Source/Ptr.h:73:5: error: there are no arguments to ‘assign’ that depend on a template parameter, so a declaration of ‘assign’ must be available [-fpermissive]
assign(this->expr, rhs.expr);
^~~~~~
make: *** [Makefile:121: GCD.o] Error 1

Versions:
[root@SmallPi Tests]# gcc --version
gcc (GCC) 8.2.0
Copyright (C) 2018 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.
[root@SmallPi Tests]# uname -a
Linux SmallPi 4.14.83-2-ARCH #1 SMP Sat Nov 24 23:09:29 UTC 2018 armv6l GNU/Linux

@zertyz
Copy link
Author

zertyz commented Nov 30, 2018

*** UPDATE ***

I was able to compile it using clang:
[root@SmallPi ~]# clang++ --version
clang version 7.0.0 (tags/RELEASE_700/final)
Target: armv6l-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin

@zertyz
Copy link
Author

zertyz commented Nov 30, 2018

*** UPDATE 2 ***

One of the tests needs fixing:

[root@SmallPi Tests]# make QPU=1 TriFloat
clang++ TriFloat.cpp -o TriFloat
TriFloat.cpp:1:10: fatal error: 'QPULib.h' file not found
#include "QPULib.h"
^~~~~~~~~~
1 error generated.
make: *** [: TriFloat] Error 1

@crmann25
Copy link

@mn416 I encountered the same issue as @zertyz and was able to resolve by adding "-fpermissive" to the Makefile's CXX_FLAGS (I added as the first flag in list fyi). This may be worth mentioning in the Getting Started Guide, in addition to zertyz workaround! So far the MultiTri and GCD examples work correctly. I am using Raspian Buster & PiZeroW.

@m516
Copy link

m516 commented Dec 28, 2019

I had the same problem as @crmann25 and @zertyz when I was compiling on a laptop running Ubuntu, and the solution above worked for me. Thank you @mn416 for the source code and @crmann25 for the fix!

@mn416
Copy link
Owner

mn416 commented Jan 21, 2020

Thanks @crmann25, @zertyz, and @m516 for reporting this. I've pushed a commit to include -fpermissive in the default compiler flags as a workaround for now. Sorry I've been so slow to respond (and for not doing a proper fix yet).

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

4 participants