Install libraries on nitrous.io - nitrousio

I need to install geos, but can't use sudo to run sudo apt-get install libgeos-dev. I can download the source tar file, but don't I need to adjust the --prefix option when I run ./configure?
What do I need to adjust the prefix to?

You will need to set the prefix, for sure, since you don't have access to the system. You can use $HOME as prefix, or /home/action if you prefer... you can do anything inside user's home directory :)

Related

Install Cuda without root

I know that I can install Cuda with the following:
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run
chmod +x cuda_7.0.28_linux.run
./cuda_7.0.28_linux.run -extract=`pwd`/nvidia_installers
cd nvidia_installers
sudo ./NVIDIA-Linux-x86_64-346.46.run
sudo modprobe nvidia
sudo ./cuda-linux64-rel-7.0.28-19326674.run
Just wondering if I can install Cuda without root?
Thanks,
Update The installation UI for 10.1 changed. The following works:
Deselect driver installation (pressing ENTERon it)
Change options -> root install path to a non-sudo directory.
Press A on the line marked with a + to access advanced options. Deselect create symbolic link, and change the toolkit install path.
Now installation should work without root permissions
Thank you very much for the hints in the question! I just want to complete it with an approach that worked for me, also inspired in this gist and that hopefully helps in situations where a valid driver is installed, and installing a more recent CUDA on Linux without root permissions is still needed.
TL;DR: Here are the steps to install CUDA9+CUDNN7 on Debian, and installing a pre-compiled version of TensorFlow1.4 on Python2.7 to test that everything works. Everything without root privileges and via terminal. Should also work for other CUDA, CUDNN, TensorFlow and Python versions on other Linux systems too.
INSTALLATION
Go to NVIDIA's official release web for CUDA (as for Nov. 2017, CUDA9 is out): https://developer.nvidia.com/cuda-downloads.
Under your Linux distro, select the runfile (local)option. Note that the sudo indication present in the installation instructions is deceiving, since it is possible to run this installer without root permissions. On a server, one easy way is to copy the <LINK> of the Download button and, in any location of your home directory, run wget <LINK>. It will download the <INSTALLER> file.
Run chmod +x <INSTALLER> to make it executable, and execute it ./<INSTALLER>.
accept the EULA, say no to driver installation, and enter a <CUDA> location under your home directory to install the toolkit and a <CUDASAMPLES> for the samples.
Not asked here but recommended: Download a compatible CUDNN file from the official web (you need to sign in). In my case, I downloaded the cudnn-9.0-linux-x64-v7.tgz, compatible with CUDA9 into the <CUDNN> folder. Uncompress it: tar -xzvf ....
Optional: compile the samples. cd <CUDASAMPLES> && make. There are some very nice examples there and a very good starting point to write some CUDA scripts of yourself.
(If you did 5.): Copy the required files from <CUDNN> into <CUDA>, and grant reading permission to user (not sure if needed):
cp -P <CUDNN>/cuda/include/cudnn.h <CUDA>/include/
cp -P <CUDNN>/cuda/lib64/libcudnn* <CUDA>/lib64
chmod a+r <CUDA>/include/cudnn.h <CUDA>/lib64/libcudnn*
Add the library to your environment. This is typically done adding this following two lines to your ~/.bashrc file (in this example, the <CUDA> directory was ~/cuda9/:
export PATH=<CUDA>/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<CUDA>/lib64/
FOR QUICK TESTING OR TENSORFLOW USERS
The quickest way to get a TensorFlow compatible with CUDA9 and CUDNN7 (and a very quick way to test this) is to download a precompiled wheel file and install it with pip install <WHEEL>. Most of the versions you need, can be found in mind's repo (thanks a lot guys). A minimal test that confirms that CUDNN is also working involves the use of tf.nn.conv2d:
import tensorflow as tf
x = tf.nn.conv2d(tf.ones([1,1,10,1]), tf.ones([1,5,1,1]), strides=[1, 1, 1, 1], padding='SAME')
with tf.Session() as sess:
sess.run(x) # this should output a tensor of shape (1,1,10,1) with [3,4,5,5,5,5,5,5,4,3]
In my case, the wheel I installed required Intel's MKL library, as explained here. Again, from terminal and without root users, this are the steps I followed to install the library and make TensorFlow find it (reference):
git clone https://github.com/01org/mkl-dnn.git
cd mkl-dnn/scripts && ./prepare_mkl.sh && cd ..
mkdir -p build && cd build
cmake -D CMAKE_INSTALL_PREFIX:PATH=<TARGET_DIR_IN_HOME> ..
make # this takes a while
make doc # do this optionally if you have doxygen
make test # also takes a while
make install # installs into <TARGET_DIR_IN_HOME>
add the following to your ~/.bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<TARGET_DIR_IN_HOME>/lib
Hope this helps!
Andres
You can install using conda with the following command.
conda install -c anaconda cudatoolkit
But you need to have prior accesss to the device(GPU).
EDIT : If you are finding error in anaconda repository then change the repository to conda-forge which is frequently updated.
conda install -c conda-forge cudatoolkit
You can install CUDA and compile programs, but you won't be able to run them for a lack of device access.

How to install Cudnn from command line

Cudnn: https://developer.nvidia.com/cudnn
I login and go jump through all the hoops that NVIDIA wants you to do; however, when it comes time to download the file I can't seem to figure out how to do it via wget and the command line.
I was hoping someone has done this. I've copy and pasted the link that they want to click and used this in wget copy-and-pasted-url. But I just get back an html file.
The following trick works with Firefox:
Download the file with your regular machine
Go to the downloads list in firefox, right click on the file and click "Copy original download URL"
Go to your pure-terminal machine, and type:
wget PASTE-YOUR-LINK-FROM-FIREFOX
As #deltheil mentionned, by doing this the link contains a temporary download token, letting you download the file from another machine then the one it was requested from
EDIT
The downloaded filename is libcudnn***.deb?<some download token>. You will need to rename it by stripping the ? and everything after it:
mv libcudnn***.deb?xxx libcudnn***.deb
CUDNN_TAR_FILE="cudnn-8.0-linux-x64-v6.0.tgz"
wget http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/${CUDNN_TAR_FILE}
tar -xzvf ${CUDNN_TAR_FILE}
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64/
sudo chmod a+r /usr/local/cuda-8.0/lib64/libcudnn*
The download link that you get right after the accept terms section is authenticated (the GET request gives you a HTTP 302 Moved Temporarily).
If you really want to grab the link from the command line: open your browser, use the developers tools and look at the Location field after the redirection: you can use this link directly with wget as it contains a short-lived authorization token.
You may try the following:
curl -O http://developer.download.nvidia.com/compute/redist/cudnn/v2/cudnn-6.5-linux-x64-v2.tgz
This will download CUDNN 6.5
The location for the latest one is in the NVIDIA latest Docker file, currently at:
https://github.com/NVIDIA/nvidia-docker/tree/master/centos-7/cuda/7.5/runtime/cudnn5
I tried all of these answers and none worked unfortunately.
Though a simple workaround is: apt-get update && apt-get install -y --no-install-recommends <cuDNN Package>
For example, in my case it is:
apt-get update && apt-get install -y --no-install-recommends libcudnn8
And it works!

LESS CSS Programming

I am using an "OPEN SUSE-LINUX". There is no compiler available for less css in linux. For ex. "simple-less compiler" is not working in linux as it has .exe file.
So there is some difficulty which i came across.
So anyone can give me a basic info of how to use LESS CSS without using compiler. There is website for these kind of information but it have lots of ambiguity. Also need html file along with LESS CSS.
So clearly needed a html file which is linked with any less css minified version.
You can use Node module: https://npmjs.org/package/less
npm install -g less
lessc styles.less styles.css
If you use PHP as server-side language you can use the PHP compiler http://leafo.net/lessphp/
You'll have to compile the less code. I don't know if suse has package for gem/rubygems, but you can install gem and then use gem to install less.
How to install rubygems is more a OS question, programming. So StackOverflow may not be the right forum, but to point you in the right direction:
First hit on google for "less css suse" find an Ubundu solution. First line is dist-specific and the last line may require different paths on suse:
http://www.edmondscommerce.co.uk/less-css/less-css-installation-on-ubuntu-10-10/
sudo apt-get install rubygems1.8 ruby1.8-dev (ubuntu/debian)
sudo gem install rubygems-update
sudo gem update rubygems
sudo gem install less
sudo ln -s /var/lib/gems/1.8/bin/lessc /usr/bin/

How to compile qemu (for i386 only) on linux

I downloaded the tar.gz from qemu.org. Now how can I compile the source code only for i386 architecture?
I mean, my qemu need not be able to emulate a Power PC, Motorola 68000 or others.
I tried the steps
./configure
make
make install
But there was a failure
No rule to build target 'all'
Apart from this, the above steps compile the qemu for all architectures too.
Hope to get some help.
On Linux Machine Download Qemu Source Code and extract in directory then cd to DIR and do following:
./configure --disable-kvm [--prefix=PFX] [--target-list="i386-softmmu x86_64-softmmu"]
make
make install
first tar it (extract it)
then go to the directory on shell
then
type this commands
./configure --target-list=i386-softmmu
when build successful
press make and enter
when this done
then write
sudo make install
that's it
For general linux,
#tar xvzf qemu-1.4.0.tar.bz2
#cd qemu-1.4.0
#./configure --target-list=i386-softmmu
#make
#make install
For puppy linux wary 530,
#tar xvzf qemu-1.4.0.tar.bz2
#cd qemu-1.4.0
#./configure --target-list=i386-softmmu
#make
#new2dir make install
#cd ..
#dir2pet qemu-1.4.0-i486
./configure --target-list=x86_64-linux-user --disable-smartcard-nss
This command work for me, while building Qemu 1.6 on centOS

set up MySQL with MAMP for Ruby

I'm trying to use Ruby with the MySQL that comes with MAMP, but there is a problem with the headers not being installed (or something like that).
Someone referred me to the tutorial copied below but I can't get it to work. When I put in the first line ./configure... it says no such directory.
1) One question in particular is, it says, "copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive." I don't know if by installing MAMP I have already done this step or not. If not, then I don't know what to do.
2) I also don't know what it means when it says "untar" the source file and "cd"...If MAMP is installed, has it been untarred already?
3) Also, do would I just open the terminal and start this code, or do I have to go into Mysql?
I wonder if anyone can tell me how to adapt it. Here are 2 other pieces of information about my installation that might be helpful.
a). MySQL is set up on port 8889 on my computer.
b) Also when I enter "which mysql" in the command line, it responds with "/usr/local/mysql/bin/mysql."
Please help if you can. Thanks.
Download the latest MAMP dmg file.
Download the 1.8.2 (or whichever the latest one you could find) components file from this page.
Unzip, mount the dmg, then copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive.
Untar the MySQL source file, and `cd` to the source file directory.
Compile the library:
$ ./configure --with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock --without-server --prefix=/Applications/MAMP/Library
$ make -j2
Copy the compiled libraries into MAMP:
$ cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql
Copy the MYSQL headers into MAMP:
$ mkdir /Applications/MAMP/Library/include
$ cp -R include /Applications/MAMP/Library/include/mysql
Install the Ruby MySQL Gem, on Snow Leopard:
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
On Leopard:
$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
Enjoy!
EDIT # 2009-11-23: If you’re still experiencing problems (perhaps with RVM), try adding “/Applications/MAMP/Library/bin/” to your $PATH in “~/.bash_profile”.
You should probably follow the tutorial in this link. It is updated for MAMP 1.9.5 with mysql2. A couple of changes have been made to the new MAMP version.
http://blog.mirotin.net/?p=35
Furthermore the tar file you need can be found at this link. Download the MAMP_components_1.9.5.dmg file.
http://sourceforge.net/projects/mamp/files/mamp/1.9.5/
Finally got through this with this blog post: http://newfangled.me/installing-mamp-and-rails-on-a-mac/
Here's the archived version of that incase it goes offline http://web.archive.org/web/20130728130916/http://newfangled.me/installing-mamp-and-rails-on-a-mac
The other answer's reference 404s for me. http://blog.mirotin.net/?p=35
I'd been struggling with this for a while myself.