How do I compile a solver written in Python to a standalone executable with static libraries?
3 posters
Page 1 of 1
How do I compile a solver written in Python to a standalone executable with static libraries?
I have a solver written in Python. I tried to use freeze.py to compile it into a binary. But I found no way to ask freeze.py to link glibc statically (Python depends heavily on glibc). Freeze generated a huge bunch of C files and a Makefile but I couldn't hack the Makefile successfully to do static linking. If someone could share their experience in this matter, it would be very helpful.
Thanks, D (posting on behalf of a new user)
Thanks, D (posting on behalf of a new user)
df- Posts : 17
Join date : 2014-04-30
Re: How do I compile a solver written in Python to a standalone executable with static libraries?
To elaborate on the above post.
I am using freeze.py to create standalone executables out of python programs. The freeze utility generates C code out of python code + python runtime and outputs a Makefile project. The makefile I get is here.
To put the binary on starexec, I need to statically link glibc. I tried adding the following flags to the linking command
-static-libstdc++ -static-libgcc -static -o
and it generates the following error:
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `tan' with pointer equality in `/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.a(s_tan.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: error: ld returned 1 exit status
I then tried to add the suggested flags -fPIE and -pie to compilation and linking commands. But it results in the same error.
Any suggestions to get rid of this error or to use a completely different toolchain to compile python into standalone executables?
I am using freeze.py to create standalone executables out of python programs. The freeze utility generates C code out of python code + python runtime and outputs a Makefile project. The makefile I get is here.
To put the binary on starexec, I need to statically link glibc. I tried adding the following flags to the linking command
-static-libstdc++ -static-libgcc -static -o
and it generates the following error:
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `tan' with pointer equality in `/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.a(s_tan.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: error: ld returned 1 exit status
I then tried to add the suggested flags -fPIE and -pie to compilation and linking commands. But it results in the same error.
Any suggestions to get rid of this error or to use a completely different toolchain to compile python into standalone executables?
garvitjuniwal- Posts : 3
Join date : 2014-06-20
Re: How do I compile a solver written in Python to a standalone executable with static libraries?
> To put the binary on starexec, I need to statically link glibc.
Really?
I assume this is because your binary was built on a system with a different glibc version.
Then another option is: you build your application in a virtual machine that matches starexec.
CentOS 6.3 is a good fit.
- J.
Really?
I assume this is because your binary was built on a system with a different glibc version.
Then another option is: you build your application in a virtual machine that matches starexec.
CentOS 6.3 is a good fit.
- J.
j.waldmann- Posts : 84
Join date : 2014-04-26
Similar topics
» solver ids
» solver configuration
» remove solver/benchmark/job
» Solver Comparison Plot
» Select all configurations of a solver
» solver configuration
» remove solver/benchmark/job
» Solver Comparison Plot
» Select all configurations of a solver
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum