{"id":579,"date":"2010-07-03T23:50:26","date_gmt":"2010-07-04T03:50:26","guid":{"rendered":"http:\/\/www.briancbecker.com\/blog\/?p=579"},"modified":"2020-04-12T19:45:34","modified_gmt":"2020-04-12T23:45:34","slug":"oh-silly-linux","status":"publish","type":"post","link":"http:\/\/www.briancbecker.com\/blog\/2010\/oh-silly-linux\/","title":{"rendered":"Oh Silly Linux"},"content":{"rendered":"<p>Why are you so crazy, Linux? A friend asked me to look at why his installation of Matlab + code for the <a href=\"http:\/\/www.image-net.org\/challenges\/LSVRC\/2010\/\">ImageNet 2010 competition<\/a> on his VMWare Linux box wasn&#8217;t working. I logged on and typed in matlab, but got &#8220;matlab: command not found&#8221;, which was strange because he said he had installed it. Doing a &#8220;locate matlab&#8221; told me matlab was in \/usr\/bin\/MATHWORKS_R2008B\/bin so I executed<\/p>\n<blockquote>\n<pre>PATH=\/usr\/bin\/MATHWORKS_R2008B\/bin:$PATH<\/pre>\n<pre>export PATH<\/pre>\n<pre>matlab<\/pre>\n<\/blockquote>\n<p>That worked as I got a nice Matlab splashscreen, but then it just crashed printing out a cryptic &#8220;Opening log file: \/home\/usr\/java.lgo.11195&#8221; message. That log file had the error &#8220;Could not reserve enough space for object heap&#8221;, which sounded suspiciously like not enough memory. Sure enough, only 384 MB of RAM were allocated to the VMWare virtual machine. Change that and reboot.<\/p>\n<p>And of course by then, my local export PATH command was invalid so I added the following line to \/etc\/profile:<\/p>\n<blockquote>\n<pre>PATH=\/usr\/bin\/MATHWORKS_R2008B\/bin:\/usr\/bin\/MATHWORKS_R2008B\/bin\/utils\/mex;\r\n^^^ <em>DON'T DO THIS!!!<\/em><\/pre>\n<\/blockquote>\n<p>Reboot and I can&#8217;t even log in. Ctrl + Alt + F1 to get to command console and massive amounts of errors later I found out that bleck, I overwrote all the other PATH variables too. Now I have to \/usr\/bin\/sudo \/usr\/bin\/nano \/etc\/profile and change the line to include the old path as well.<\/p>\n<blockquote>\n<pre>PATH=$PATH:\/usr\/bin\/MATHWORKS_R2008B\/bin:\/usr\/bin\/MATHWORKS_R2008B\/bin\/utils\/mex<\/pre>\n<pre>export PATH<\/pre>\n<\/blockquote>\n<p>Whew, now matlab starts up and we can execute mex. Except now matlab keeps whining about &#8220;cannot write to preference file &#8220;matlab.prf&#8221; in &#8220;\/home\/user\/.matlab\/R2008b\/. A quick google search says we need to execute<\/p>\n<blockquote>\n<pre>sudo chown user \/home\/user\/.matlab\/R2008b\/matlab.prf<\/pre>\n<pre>sudo chmod a+w \/home\/user\/.matlab -R\r\n<\/pre>\n<\/blockquote>\n<p>That first one might be redundant, but there are several files matlab needs to edit and the first command only solves the first problem.<\/p>\n<p>Running the make file resulted in &#8220;\/usr\/bin\/ld: cannot find-lstdc++&#8221; which is interesting. Not entirely sure what was going on, I decided to do a sanity check and wrote a nice hello_world.cpp program and tried compiling it with g++ only to discover g++ wasn&#8217;t installed. Install g++, do another sudo ldconfig for good measure, and bam it all compiles nicely. However, running make from the feature directory whined about u_int32_t in item.hpp, so a quick &#8220;typedef unsigned int u_int32_t;&#8221; in item.hpp later, g++ is complaining about not being able to link to -lvl. Turns out their Makefile needed to be pointed to .\/3rd-party\/vlfeat\/bin\/glx and then things are happy.<\/p>\n<p>Whew! Finally, we can run their example script: extract_bow.sh. Alas still no luck, all sorts of complaining going on. The first is &#8220;.\/vldsift: error while loading shared libraries: libvl.so: cannot open shared object file: No such file or directory&#8221; Bleck! Adding the directory that libvl.so is in to \/etc\/ld.so.conf seemed to work and the demo program ran.<\/p>\n<p>Sigh&#8230;Linux, why are you so crazy? Or maybe the better question is: you guys who programmed Linux, why are you so crazy?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why are you so crazy, Linux? A friend asked me to look at why his installation of Matlab + code&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":9,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":1315,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions\/1315"}],"wp:attachment":[{"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.briancbecker.com\/blog\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}