Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 284257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:26:34+00:00 2026-05-12T05:26:34+00:00

I’m building a special-purpose embedded Python interpreter and want to avoid having dependencies on

  • 0

I’m building a special-purpose embedded Python interpreter and want to avoid having dependencies on dynamic libraries so I want to compile the interpreter with static libraries instead (e.g. libc.a not libc.so).

I would also like to statically link all dynamic libraries that are part of the Python standard library. I know this can be done using Freeze.py, but is there an alternative so that it can be done in one step?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:26:35+00:00Added an answer on May 12, 2026 at 5:26 am

    I found this (mainly concerning static compilation of Python modules):

    • http://bytes.com/groups/python/23235-build-static-python-executable-linux

    Which describes a file used for configuration located here:

    <Python_Source>/Modules/Setup
    

    If this file isn’t present, it can be created by copying:

    <Python_Source>/Modules/Setup.dist
    

    The Setup file has tons of documentation in it and the README included with the source offers lots of good compilation information as well.

    I haven’t tried compiling yet, but I think with these resources, I should be successful when I try. I will post my results as a comment here.

    Update

    To get a pure-static python executable, you must also configure as follows:

    ./configure LDFLAGS="-static -static-libgcc" CPPFLAGS="-static"
    

    Once you build with these flags enabled, you will likely get lots of warnings about “renaming because library isn’t present”. This means that you have not configured Modules/Setup correctly and need to:

    a) add a single line (near the top) like this:

    *static*
    

    (that’s asterisk/star the word “static” and asterisk with no spaces)

    b) uncomment all modules that you want to be available statically (such as math, array, etc…)

    You may also need to add specific linker flags (as mentioned in the link I posted above). My experience so far has been that the libraries are working without modification.

    It may also be helpful to run make with as follows:

    make 2>&1 | grep 'renaming'
    

    This will show all modules that are failing to compile due to being statically linked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 171k
  • Answers 171k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer process can access alpha and bravo directly (without being passed).… May 12, 2026 at 2:18 pm
  • Editorial Team
    Editorial Team added an answer I use JSON.NET (http://www.codeplex.com/Json) and I think it's a good… May 12, 2026 at 2:18 pm
  • Editorial Team
    Editorial Team added an answer My advice is not to be extreme. From my experience,… May 12, 2026 at 2:18 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.