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

21 comments:

Unknown said...

nice blog
android training in bangalore
ios training in bangalore
machine learning online training

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

Diya shree said...

Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.

best openstack training in chennai | openstack course fees in chennai | openstack certification in chennai | openstack training in chennai velachery

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

remo said...

THANKS FOR THE INFORMATION....
Digital Marketing Internship Program in BangaloreDigital Marketing Internship Program in Bangalore

draj said...


Excellent machine learning blog,thanks for sharing...
Seo Internship in Bangalore
Smo Internship in Bangalore
Digital Marketing Internship Program in Bangalore

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

Data Science in Bangalore - 360DigiTMG said...

Truly mind blowing blog went amazed with the subject they have developed the content. These kind of posts really helpful to gain the knowledge of unknown things which surely triggers to motivate and learn the new innovative contents. Hope you deliver the similar successive contents forthcoming as well.

data science in bangalore

Mallela said...

Thanks for posting the best information and the blog is very helpful.data science institutes in hyderabad

Mallela said...

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

trainingcourses 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