Tuesday, August 16, 2011

Making self-contained Unix programs with CDE



In the old days you could statically link your program and run it on another Unix station without worrying about dependencies. Unfortunately static linking no longer works, so you need to make sure that your target platform has the right libraries.

For instance, in order to get Matlab compiled code running on a server, you have to copy over libraries and set environment variables as specified in Matlab's guide, followed by some investigative work to take care of dependencies and version conflicts not covered by Mathworks documentation.

Another example is when if you want to create a self-contained Scipy/Python environment that you could just copy over and use without needing to run configure and make.

For both cases Philip Guo's CDE tool comes helpful. It analyzes your program to find dependencies and makes a package with all the dependencies included. Then it runs the program through a kind of lightweight virtualization, intercepting program calls to trick it into thinking it's running in the original environment.

For instance, here's how you could make a self-contained environment for Python and Scipy:


cd /temp
git clone git://github.com/pgbovine/CDE.git
cd CDE
make
cd ..
CDE/cde python -c "from scipy import *; print zeros(15)"
tar -cf package.tar cde-package


This makes a 26 MB file that includes that all files that were read during execution of that command.
Now you can move it to another machine that doesn't have scipy, prepare the environment and try it out as follows

tar -xf package.tar
cd cde-package/cde-root/temp
../../cde-exec python -c "from scipy import *; print ones(15)"


This will work even if machine doesn't have Python installed, or has the wrong version of shared libraries installed, because cde-exec is reproducing the environment of the original machine. It works for anything that doesn't need files other than the ones accessed during package creation.

For instance, you could start an interactive Python session and run some SciPy examples like this


cde cde-package/cde-root
../cde-exec python
>>> from scipy import *
>>> ....


You could give your containerized program access to host system by creating symlink to the outside in cde-root

24 comments:

Unknown said...

sap bi interview questions
hive interview questions
seo interview questions
as400 interview questions
wordpress interview questions
accounting interview questions
basic accounting and financial interview questions

Anonymous said...

nice blogs about financial accounting at The Basic Financial training in bangalore

katetech said...

Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
internship companies in kphb
apply for internship in kphb

Anonymous said...

Machine Learning Interview Questions and Answers
Artificial Intelligence Interview Questions and Answers

Praylin S said...

It's great to come across a blog once in a while that's not the same outdated material. Really glad that I came across your post. Keep us updated.
Unix Training in Chennai
Unix Shell Scripting Training in Chennai
Embedded System Course Chennai
Embedded Training in Chennai
LINUX Training in Chennai
LINUX Course in Chennai
Unix Training in Porur
Unix Training in OMR

basha said...

Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative.
oracle fusion financials classroom training
Workday HCM Online Training
Oracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
Oracle Fusion HCM Classroom Training

Anonymous said...


Hello, o you know that the best way to boost your brain is
visiting or contacting us


https://weiiitrading.com/our-products/moonrock-carts/buy-empty-moonrock-clear-vape-cartridges-blue-carts-dr-zodiak-atomizers-with-flavor-box-packaging/

https://weiiitrading.com/our-products/heavy-hitters-carts/buy-wholesale-new-heavy-hitter-vape-cartridges-1-0ml-ceramic-coil-empty-tank-carts-510-thread-thick-oil-atomizer/

https://weiiitrading.com/our-products/juul-carts/buy-hot-empty-ceramic-pod-disassembled-cartridges-0-7ml-1-0ml-vape-pod-carts-for-vape-juul-vape-pen-start-kit-top-quality/

https://weiiitrading.com/our-products/mario-carts/buy-peaches-and-dream/

https://weiiitrading.com/our-products/heavy-hitters-carts/buy-bubba-kush-cartridge-2-2g/

https://weiiitrading.com/our-products/mario-carts/buy-thin-mint-cookies/



Pila Brass Knuckles Online for sale online,

where to buy Buy Pila Brass Knuckles Online

buy valley online cartridge

buy space candy online

buy cannabis syrup online

buy botox online

cannabis bread

uk chese

47 dank vapewhite fire og

buy moonrock



Email Us

Contact: +1 619-537-6734

Anonymous said...


Hello, o you know that the best way to boost your brain is
visiting or contacting us


https://weiiitrading.com/our-products/moonrock-carts/buy-empty-moonrock-clear-vape-cartridges-blue-carts-dr-zodiak-atomizers-with-flavor-box-packaging/

https://weiiitrading.com/our-products/heavy-hitters-carts/buy-wholesale-new-heavy-hitter-vape-cartridges-1-0ml-ceramic-coil-empty-tank-carts-510-thread-thick-oil-atomizer/

https://weiiitrading.com/our-products/juul-carts/buy-hot-empty-ceramic-pod-disassembled-cartridges-0-7ml-1-0ml-vape-pod-carts-for-vape-juul-vape-pen-start-kit-top-quality/

https://weiiitrading.com/our-products/mario-carts/buy-peaches-and-dream/

https://weiiitrading.com/our-products/heavy-hitters-carts/buy-bubba-kush-cartridge-2-2g/

https://weiiitrading.com/our-products/mario-carts/buy-thin-mint-cookies/



Pila Brass Knuckles Online for sale online,

where to buy Buy Pila Brass Knuckles Online

buy valley online cartridge

buy space candy online

buy cannabis syrup online

buy botox online

cannabis bread

uk chese

47 dank vapewhite fire og

buy moonrock



Email Us

Contact: +1 619-537-6734

75 Farm Cannabis Specialists MARLEY NATURAL said...

we have a wide range of medical signatures
just take a sec and visit us with or without prescription, and you shall be served accordingly
Buy Promethazine codeine online
Order Biotropin Online
Order Adderrall Online Without Prescription
Buy sibutramine online
buy Nembutal sodium online


buy dexedrine online
buy vyvanse online
buy methadone online
buy Nembutal sodium online
buy opana online
buy cheap ambien online
buy max performer sex pills
buy anavar online

buy amytal sodium online
buy cheap ambien
buy ephedrine crystals
fentanyl actiq
fentanyl patches


buy amytal sodium online
changa
mdma pills
buy changa dmt online
buy morning glory seeds
buy ibogaine
Ayahuasca
buy mescaline
buy Penis envy
Penis envy mushrooms
Golden teacher mushrooms
mescaline drug for sale
buy liberty cap mushrooms
liquid lsd
buy lsd liquid
what is dmt
what is lsd
buy albino penis envy
what is penis envy
buy kratom near me
buy kratom powder
buy kratom
buy liquid lsd online
buy dmt online
buy pills online
changa dmt
penis envy mushrooms
lsd for sale
dmt trip
ayahuasca tea
kentucky ayahuasca tea
iboga
ecstacy
molly




Email Us

Wickr: walkerpeac

Techno Globe said...


Really great info you provided here.
Thank You
Machine Learning Training in jaipur
Artificial Intelligence Training in Jaipur

Data Science Course in Bangalore said...

Actually I read it yesterday I looked at most of your posts but I had some ideas about it . This article is probably where I got the most useful information for my research and today I wanted to read it again because it is so well written.
Data Science Course in Bangalore

Srigokul said...

Nice Blog. Thanks for Sharing this useful information...

Data science training in chennai
Data science course in chennai

Mallela said...

Thanks for posting the best information and the blog is very helpful.artificial intelligence course in hyderabad

traininginstitute said...

I see some amazingly important and kept up to a length of your strength searching for in your on the site

digital marketing courses in hyderabad with placement

Deekshitha said...

Informative blog
ai training in hyderabad

Deekshitha said...

Informative blog

best digital marketing institute in hyderabad

traininginstitute said...

I want to say thanks to you. I have bookmark your site for future updates.
business analytics course

Deekshitha said...

Informative blog
best digital marketing institute in hyderabad

Data Science Course in Bhilai - 360DigiTMG said...

Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

data science course in faridabad

Deekshitha said...

Informative blog
data analytics courses in hyderabad

Mallela said...

Thanks for posting the best information and the blog is very important.data science course in Lucknow

traininginstitute said...

Your work is very good and I appreciate you and hopping for some more informative posts
data scientist training in malaysia

Jack Dowson said...

Bitcoin's notoriety is quickly developing. From a little more than 100 everyday exchanges during its most memorable year of activity, there are presently as of now around 300,000 day to day Bitcoin exchanges. What's significantly more breathtaking is that its market cost: from under a dollar for each bitcoin in 2010, a solitary bitcoin now costs north of 7,000 USD, and this sum keeps on becoming constantly. This shows exactly how enormous the interest for bitcoins is currently, and this request simply continues to develop.

In spite of negativity about the unpredictability of digital forms of money, bitcoins have kept on taking off over the rest. It is assessed that more than 17,670,750 bitcoins exist today. Notwithstanding, this number increments 10 minutes as a normal of 144 blocks are mined everyday and each block contains 12.5 Bitcoins. This brings the all out normal of 1,800 new bitcoins each day. Of late, excavators have moved forward the hash power. Accordingly, the completion time of finding new blocks has been diminished from 10 minutes to 9.5 which implies the typical number of new Bitcoins could be more than 1,800>> bitcoin developer

Uposing said...

My sister informed me about your post. when I saw it So I loved it. Let me also share with you that another great advantage of phrase checker is that it eliminates even those small mistakes which may be difficult to detect. It comprehensively checks for spelling mistakes and grammatical errors. This tool also fixes commonly confused words.