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

How to compile planet? #1

Closed
edwardxu0 opened this issue May 16, 2018 · 10 comments
Closed

How to compile planet? #1

edwardxu0 opened this issue May 16, 2018 · 10 comments

Comments

@edwardxu0
Copy link

I am having trouble compiling planet on Linux.

Could you provide a makefile?

If not, which lp slove library are you using?
Could you point me the link?

@bunelr
Copy link

bunelr commented May 16, 2018

What problems do you encounter?

The following worked for me (copy pasted from the instructions in my repository

cd planet/src
# sudo apt install valgrind qt5-qmake libglpk-dev # if necessary 
qmake
make
# if you encounter linker issues, move -lsuitesparseconfig to the end of the flag list

(the last comment is because I was sometimes seeing some linker error. Moving the flag "-lsuitesparseconfig" to the end of the list in the src/Tool.pro file solved it (after rerunning the makefile generation)

@edwardxu0
Copy link
Author

edwardxu0 commented May 16, 2018

Thank you so much for the quick response, Rudy.


On Ubuntu 18.04
When it says,
/usr/bin/x86_64-linux-gnu-ld: cannot find -lltdl'.
install the missing library, libltdl-dev.

On Ubuntu 16.04,
Move -lsuitesparseconfig to the end of the flag list when you have some linker issues.

@bunelr
Copy link

bunelr commented May 16, 2018

Have you tried installing the library that seems to be missing? (libltdl-dev)

@progirep
Copy link
Owner

Hi @edwardxu0 and @bunelr.

Sorry for forgetting to add the command to actually build the tool to the README file. It has not been added. The "libltdl-dev" package was indeed an additional dependency that is now also listed as such in the README file. That package is needed by the GNU linear programming toolkit, and it's a bit weird that it is not listed as a dependency of it in the package manager (perhaps because it is only needed for static builds).

@tianshubao1
Copy link

I got the error

collect2: error: ld returned 1 exit status
Makefile:167: recipe for target 'planet' failed
make: *** [planet] Error 1

when I typed make in terminal

@progirep
Copy link
Owner

progirep commented Aug 9, 2018

Hi @tianshubao1 - Could you copy&paste a bit more of the error messages that you get? The "ld returned 1 exit status" line informs you that a linker error happened earlier. Seeing the actual linker error would be helpful.

Also, could you add which type of system you are using (type of Linux, Mac, etc.)? For compilation/linking errors, this information is typically helpful.

@tianshubao1
Copy link

tianshubao1 commented Aug 9, 2018

Thanks for the prompt reply. I am using ubuntu 16.04, Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz.

I typed make in src directory.

g++ -m64 -Wl,-O1 -o planet Options.o Solver.o System.o main.o verifierContext.o supersetdatabase.o -static -lglpk -lgmp -lumfpack -lsuitesparseconfig -lcholmod -lamd -lcolamd -lccolamd -lcamd -lz -lltdl -ldl
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libltdl.a(dlopen.o): In function vm_open': (.text+0x5e): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0xfe): undefined reference to SuiteSparse_malloc' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x110): undefined reference to SuiteSparse_malloc' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x21a): undefined reference to SuiteSparse_malloc' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x279): undefined reference to SuiteSparse_free' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x283): undefined reference to SuiteSparse_free' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x28d): undefined reference to SuiteSparse_free' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x297): undefined reference to SuiteSparse_free' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order':
(.text+0x29f): undefined reference to SuiteSparse_free' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o):(.text+0x2fb): more undefined references to SuiteSparse_free' follow
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x389): undefined reference to SuiteSparse_malloc'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x3a1): undefined reference to SuiteSparse_malloc'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x46b): undefined reference to SuiteSparse_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x475): undefined reference to SuiteSparse_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x47f): undefined reference to SuiteSparse_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x487): undefined reference to SuiteSparse_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libamd.a(amd_i_order.o): In function amd_order': (.text+0x48f): undefined reference to SuiteSparse_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o): In function print_report': (.text+0x3): undefined reference to SuiteSparse_config'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o): In function print_report': (.text+0x4a): undefined reference to SuiteSparse_config'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o): In function print_report': (.text+0xab): undefined reference to SuiteSparse_config'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o): In function print_report': (.text+0xd3): undefined reference to SuiteSparse_config'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o): In function print_report': (.text+0xed): undefined reference to SuiteSparse_config'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcolamd.a(colamd.o):(.text+0x10c): more undefined references to `SuiteSparse_config' follow
collect2: error: ld returned 1 exit status
Makefile:167: recipe for target 'planet' failed
make: *** [planet] Error 1

@progirep
Copy link
Owner

progirep commented Aug 9, 2018

I unfortunately do not have access to a Ubuntu 16.04 machine (any more).

Could you try running the following command (in the "src" folder)?

g++ -m64 -Wl,-O1 -o planet Options.o Solver.o System.o main.o verifierContext.o supersetdatabase.o -static -lglpk -lgmp -lumfpack -lcholmod -lamd -lcolamd -lccolamd -lcamd -lsuitesparseconfig -lz -lltdl -ldl

It's the same as the one that did not work, except that the order of the libraries is now different.

@tianshubao1
Copy link

It seems it works now. I got an extra file in the folder after tying the command you gave me.

Then I type make again. It said nothing to make.

@progirep
Copy link
Owner

The extra file should be the executable (if "make" says that there is nothing to make).

I do not know why Ubuntu 16.04 vs. Ubuntu 18.04 makes a difference here. Either the way linking works has slightly changed, or it is because of a change in the GLPK libraries.

I'm closing this issue for now. Please let me/us know if you have further questions.

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