How to compile qemu (for i386 only) on linux - qemu

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

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 expect and tcl on linux RHEL server 6.5

I am new to linux and i have few expect scripts to execute. I read few blogs on how to install expect and tcl. The command i am trying is
sudo yum install expect
sudo yum install tcl
I am getting
No package expect available
No package tcl available
It seems RHEL should have tcl and expect prebuilt but this is not the case in my version of linux.
How should i proceed from here ?
Help will be highly appreciated..Thanks :)
Install the development tools:
yum groupinstall "Development tools"
then
./configure
make
make install
should be good to go.
Have you tried this? In this way you will be able to compile from source.
1) Download the expect package from the below link
http://sourceforge.net/projects/expect/
2) Install the required dependecy packages "Tcl/Tk" language toolkit
# yum install tcl
3) Install the "expect" package using the below commands
# tar -zxvf expectx.xx.tar.gz
# ./configure
# make
# make install
I tried the following links and it worked for me. http://www.linuxfromscratch.org/blfs/view/svn/general/tcl.html http://www.linuxfromscratch.org/blfs/view/svn/general/expect.html
Try ActiveTcl from ActiveState:
http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz
You can add EPEL Repo
On 32-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
On 64-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
and then you can use yum to install.
Also you can compile from source or get from ActiveState like in previous answers.

how to build grub2 bootloader from it's source and test it with qemu emulator

I want to know how to build grub 2 bootloader from it's source in ubuntu and test it with qemu emulator.
I would also like to change the default background image of grub2 bootloader in the new build?
Is this possible? If yes, how ?
Of course you can.
As shown on the GRUB website, the grub source code is available via git from git.savannah.gnu.org.
Then it is theoretically just a question of
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
However, depending on your platform, grub's default target platform may or may not be what you want. So you will need to decide which firmware platform you want to use in QEMU, which depending on your architecture can be something like
(pc) BIOS
coreboot
(U)EFI
ieee1275 (open firmware)
u-boot
Your mentioning of Ubuntu matches at least 3 possible options from the above, but I'm going to be boring and assume you mean x86_64/amd64. Since you will be running GRUB under QEMU, it does not really matter which of the two likely platforms ("pc" or "efi") your physical computer is running. So let's live a little and go for the (U)EFI variant.
You will need some prerequisites installed before configuring and building, so
$ sudo apt-get install build-essential autoconf automake
$ sudo apt-get build-dep grub-efi-amd64
So a practical build may look a bit like this:
$ # Next command is optionnal (languages):
$ ./linguas.sh
$ ./autogen.sh
$ # Next parameters are optionnal:
$ ./configure --prefix=$HOME/local --platform=efi
$ make
$ # Next command is optionnal:
$ make check
$ make install
The easiest way to get a functioning GRUB image is probably with the grub-mkstandalone command:
$ $HOME/local/bin/grub-mkstandalone -O x86_64-efi -o mygrub.efi
Note: To install grub on /dev/sda disk (instead of QEMU), use:
$ sudo grub-install /dev/sda
Note: If you don't see GRUB menu when booting, check this question. It involves pressing Shift when booting or editing /etc/default/grub to comment GRUB_HIDDEN_TIMEOUT.
Then you need some kind of UEFI image to run under your QEMU. The default choice for x86 is called OVMF and is part of Tianocore EDK2 - the de facto open source implementation of UEFI. Due to legal technicalities with regards to redistribution of the FAT filesystem driver, many Linux distributions (including Ubuntu) do not include a pre-built one. But have no fear, it is pretty straightforward to build one yourself.
However, I am not going to take this answer further off-topic than I already have, so all I am going to say is have a read through the OVMF README and look through one or two only slightly outdated blog posts about it.

Octave imread support for image IO was disabled

I am trying to read an image using octave 3.8. I installed octave by downloading code and making it on my system.
I used imread("oct.png")
And got this error
error: imread: invalid image file: imfinfo: support for Image IO was
disabled when Octave was built
Please help.
PS I built using the following commands:
wget ftp://ftp.gnu.org/gnu/octave/octave-3.8.0.tar.bz2
tar -xvf octave-3.8.0.tar.bz2
cd octave-3.8.0/
./configure
sudo apt-get install f2c gfortran libblas-dev liblapack-dev libpcre3-dev libreadline-dev
./configure
make
sudo make install
Thanks in advance!
First: PLease use the stable 3.8.2 tarball, not 3.8.0.
Second: I'm sure the second time you ran ./configure it told you, that the graphicsmagick libs weren't found. Have a look at config.log what's missing.
I can't see which distribution you are using. For Debian GNU/Linux (http://wiki.octave.org/Octave_for_Debian_systems) you'll have to install
libgraphicsmagick++-dev

Mac Homebrew own Package, link error: No such keg

I am currently using the Macbook pro with OS 10.9.
And I was trying to install octave to my mac when I found that I have to install gnuplot before I could use the plot in the octave. So I try to install gnuplot using the homebrew. However,the brew got stuck when trying to install the gd, because China's network fails to link to the site https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz
So I use goagent to download the package via chrome and try to manually install the package and try to link it using brew by the instruction from https://github.com/mxcl/homebrew/wiki/FAQ
And after make install, when I try to use:
brew link libgd
the brew prompt error message:
Error: No such keg: /usr/local/Cellar/libgd
And I followed exactly the process in the FAQ diy.
$ tar -xvf l-ibgd-2.1.0.tar.gz
[snip]
$ cd libgd-2.1.0
$ brew diy
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/libgd/2.1.0
$ ./configure --prefix=/usr/local/Cellar/libgd/2.1.0
[snip]
$ make && make install
[snip]
$ brew link libgd
Error: No such keg: /usr/local/Cellar/libgd
The configuration and installation are without any error. Any suggestions? Thx a lot!
There are several things wrong here, and I'm not sure whether they are Homebrew bugs or incomplete transcription on your part.
First, the package is called gd, not libgd, so there would be /usr/local/Cellar/gd, not /usr/local/Cellar/libgd.
Second, brew diy appears to suggest a cmake invocation, but gd uses autotools, so that is wrong.
Ultimately, this should work if you string it all together correctly, but actually, if you have problems with reaching a mirror over http, I would just put the tarball somewhere else and edit the formula file (brew edit gd) to point to that new location. Much easier, and you can even save your modification in a local Git branch.