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 Xreg GraphGen using Docker #6

Open
m-baader opened this issue Oct 20, 2021 · 2 comments
Open

Compile Error in Xreg GraphGen using Docker #6

m-baader opened this issue Oct 20, 2021 · 2 comments

Comments

@m-baader
Copy link

Hi all,

I cannot compile GraphGen inside Docker, due to an error: 'shared_ptr' is not a member of 'std'.

Here is the transcript of everything I did:

$ docker run -it therealcaoyudong/qtorch
root@1a60ed7013b4:/# cd root/qtorch/
root@1a60ed7013b4:~/qtorch# make all


 Compiling All Executables - Note that nlopt-2.4.2 must be installed successfully to compile.....

make[1]: Entering directory '/root/qtorch'


 Compiling qtorch .....

make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling Test Executable .....
make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling QAOA MaxCut - Note that nlopt-2.4.2 must be installed successfully to compile .....

cp: cannot create regular file '/root/usr/local/bin': No such file or directory
Makefile:62: recipe for target 'cut' failed
make[1]: *** [cut] Error 1
make[1]: Leaving directory '/root/qtorch'
Makefile:28: recipe for target 'all' failed
make: *** [all] Error 2
root@1a60ed7013b4:~/qtorch# mkdir -p /root/usr/local/bin    # Create directory to fix above error
root@1a60ed7013b4:~/qtorch# make all


 Compiling All Executables - Note that nlopt-2.4.2 must be installed successfully to compile.....

make[1]: Entering directory '/root/qtorch'


 Compiling qtorch .....

make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling Test Executable .....
make[1]: Leaving directory '/root/qtorch'
make[1]: Entering directory '/root/qtorch'


 Compiling QAOA MaxCut - Note that nlopt-2.4.2 must be installed successfully to compile .....

make[1]: Leaving directory '/root/qtorch'
root@1a60ed7013b4:~/qtorch# cd Xreg\ GraphGen/
root@1a60ed7013b4:~/qtorch/Xreg GraphGen# make all
g++ -g -std=c++11 main.cpp -o main
In file included from main.cpp:2:0:
GraphNode.h:13:17: error: 'shared_ptr' is not a member of 'std'
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                 ^
GraphNode.h:13:17: error: 'shared_ptr' is not a member of 'std'
GraphNode.h:13:33: error: template argument 1 is invalid
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                                 ^
GraphNode.h:13:33: error: template argument 2 is invalid
GraphNode.h:13:42: error: expected unqualified-id before '>' token
     std::vector<std::shared_ptr<GraphNode>> mConnections;
                                          ^
main.cpp:10:23: error: 'shared_ptr' is not a member of 'std'
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                       ^
main.cpp:10:48: error: expected primary-expression before '>' token
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                ^
main.cpp:10:50: error: 'a' was not declared in this scope
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                  ^
main.cpp:10:53: error: 'shared_ptr' is not a member of 'std'
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                     ^
main.cpp:10:78: error: expected primary-expression before '>' token
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                              ^
main.cpp:10:80: error: 'b' was not declared in this scope
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                                ^
main.cpp:10:81: error: expression list treated as compound expression in initializer [-fpermissive]
 bool alreadyConnected(std::shared_ptr<GraphNode> a, std::shared_ptr<GraphNode> b)
                                                                                 ^
main.cpp:11:1: error: expected ',' or ';' before '{' token
 {
 ^
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
root@1a60ed7013b4:~/qtorch/Xreg GraphGen#

Is there a quick fix for this?

@schuylerfried
Copy link
Collaborator

Hello - unfortunately, I don't think that docker container is maintained. If you clone the git repo, go into the XregGraphGen folder, then run make all, it should compile to a binary called main, which you should be able to run with ./main <args>. I was able to do this just now

@m-baader
Copy link
Author

Hi, thanks for the quick reply. This worked!

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

2 participants