Setup insight on Ubuntu 14.04 or Linux Mint 17 - linux

I am starting to study Assembly & I am focusing on computer architecture.
(Due to me being curios and want to know more about the inner workings of computers and whats actually going on down in the assembly world :) )
I am following the book: Assembly Language Step by Step : Programming with Linux by Jeff Duntemann (3rd edition)
But after brief flip through of the book. It reveals it's heavily using the insight debugger which noways seems to be nonexistent for any newly released version of Linux.
Is there anyway to get the insight debugger to work (correctly) in the new linux systems and in that case how?

I recently had this problem too. After some research, I found the author's site has a post on this issue from a few years ago: http://www.contrapositivediary.com/?p=1396.
Most notably, there were comments that linked to this blog that worked for me:
http://baptiste-wicht.com/posts/2012/01/install-insight-debugger-linux-mint-ubuntu.html
In case there's any link rot, I did the following and can successfully debug stuff on Ubuntu 14.04.4 x86:
echo "deb http://ppa.launchpad.net/sevenmachines/dev/ubuntu natty main" | sudo tee -a /etc/apt/sources.list > /dev/null
echo "deb-src http://ppa.launchpad.net/sevenmachines/dev/ubuntu natty main" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt-get install insight

Well for the sake of jeff duntemann's book, I made a simple portable version of insight , All you have to do is to download a single binary ( AppImage ) and mark it executable , Then you are ready to rock. Remember this is only for 64 Bits for now. Also you have to use absolute paths for command line. This method does not require root and does not touch the host operating system.
$ wget -O Insight-x86_64.AppImage https://git.io/JGuaH
$ chmod +x ./Insight-x86_64.AppImage
$ ./Insight-x86_64.AppImage # Thats it.
See the project at https://github.com/antony-jr/insight
I repeat that this project was created by me, only the build scripts and not the source files.

Related

Where can I get libGLU.so.1 on Arch Linux?

I'm running arch linux and am making an attempt to run DaVinci Resolve. Initially startup said nothing, it just timed out and closed. Then I found a recommendation to run it with /opt/resolve/bin/resolve this got me an error saying
libGLU.so.1: cannot open shared object file: No such file or directory
This has sent me on a wild goose chase trying to install libGLU.so.1 on my system. I heard somewhere it is part of mesa so I sudo pacman -S mesa and I've tried to find a AUR package that might have it but no luck. Even trying variations of yay libGLU and yay libGLU-mesa, no luck so far.
Additionally find / -name 'libLGU*' returned nothing even when ran with sudo, meaning it isn't already on my system in the wrong directory.
This might unfortunately be an instance where I download the file and place it where it needs to go but that's probably not in the best interest of the long term longevity of my system.
I'm probably fairly novice when compared to most others on linux but I think I've gotten a lot of the basics down. Would love any insight you may have on this issue!
While an outdated forum post said that /usr/lib/libGLU.so.1 is owned by the mesa package, it is now currently owned by glu.
pacman -S glu ought to give you your needed library.
For future reference, you can reverse search filename->package using pkgfile, which works even if you don't have the respective files/packages locally.
https://wiki.archlinux.org/index.php/pkgfile
$ sudo pkgfile --update
$ pkgfile libGLU.so.1
extra/glu
Alternatively there's the built-in pacman -F, but it's generally slower than pkgfile.

"firmware-atheros" network debian package issue while building a minimal OS

Here am experimenting on including firmware-atheros network driver package of Debian flavor of OS. Here goes the command
$ sudo mkosi -d debian -r buster -f -b -t gpt_ext4 --checksum --password password --package=vim,curl,git,firmware-atheros,linux-image-amd64 -o image.raw
Error on screen: subprocess.CalledProcessError:.... returned non-zero exit status 100.
Let me know what would be the issue when am trying to include the firmware-atheros package? is it in-compatible? or anything else I should include for resolving this conflict?
The above issue if you ever encounter, while working on generating a minimal operating system by using this command mkosi. Please include --repositories=main,non-free option. Since by default it only considers main only.

Installing Kaldi using Cygwin, error on zlib

I am trying to install kaldi on a windows computer using cygwin.
When I run ./tools/check_dependencies.sh (as requested in the INSTALL file)
I get "zlib is not installed", so I go to the cygwin package list and try to install.
The thing is - there is no "zlib" per say see snapshot
there are all kinds of packages but their execution name is not "zlib" (except one which is irrelevant), it's always something-zlib-somthing.
And so I end up getting the same message even after I install them.
The code in check_dependencies.sh that does that is:
if ! echo "#include " | $CXX -E - >&/dev/null; then
echo "$0: zlib is not installed."
add_packages zlib-devel zlib1g-dev zlib-devel
fi
I understood there is no (relevant) way of installing zlib directly with cygwin - so that's a dead end.
Anyway I tried to make it work but no success - your help is very much appreciated.
Using Kaldi in cygwin is originally a bad idea. Its kind of supported but you will have many problems here and there. Simply install Linux either on a separate server or in a virtual machine.

Build MPICH2 from source

As a follow-up of this question, I started building MPICH2 from source. I found this tutorial: Installing MPICH2 on a Single Machine and so far what I did is this:
./configure --disable-f77 --disable-fc --disable-fortran
[seems to be OK]
make; sudo make install
[long output with one warning]
libtool: warning: relinking 'lib/libmpicxx.la'
root#pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found
What am I doing wrong? Notice that I had first installed MPICH2 with apt-get and in order to remove it, I did:
apt-get remove --purge mpich2
apt-get autoremove // which might removed something that I need now
Tomorrow, I am going to try this: Getting And Building MPICH (which with first attempt failed to work in the autogen.sh part).
EDIT_1:
I couldn't get it to work, will try a combination of the two tutorials and report back. I did a configure and then the make from the other tutorial, failed too.
EDIT_2
This may shade some light about where it got installed (by following the first tutorial):
root#pythagoras:/home/gsamaras/mpich-3.1.4# which mpiexec
/usr/local/bin/mpiexec
root#pythagoras:/home/gsamaras/mpich-3.1.4# which mpirun
/usr/local/bin/mpirun
You installed into /usr/local, which is an OK way to do things. The README instructions you followed suggests another way which will not require administrative privileges.
I like to install into /home/robl/soft/mpich-whatever , so I can have different compilers, versions, configurations, etc. such flexibility is probably overkill for you, but it's one strategy.
To your question:
root#pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found
First, the command is now mpichversion, not mpich2version -- it's possible you were following an old tutorial.
Second, your shell might not know about the newly installed binaries. hash -r (at least on bash and tcsh) will tell the shell "forget about what you think you know about my file system and look harder".
I found this mpich-3.0.4-README, who seems to provided the solution.
Long story short, it says (it assumes you want to build 3.0.4 version, I did it with 3.1.4 (available here)):
tar xzf mpich-3.0.4.tar.gz
cd mpich-3.0.4
// you might want to disable fortran compiler (see the README I linked above)
./configure --prefix=/home/<USERNAME>/mpich-install 2>&1 | tee c.txt
make 2>&1 | tee m.txt
make install 2>&1 | tee mi.txt
PATH=/home/<USERNAME>/mpich-install/bin:$PATH ; export PATH
which mpicc
// should return something reasonable (with your directory)
mpiexec -n 2 ./examples/cpi
Now, the option with the machinefile does not work, because ssh needs a password, but that's another question.

source code about commands

where can I found source files (in C language) about unix Commands (ls, sleep, cd etc).
I've downloaded the kernel linux-2.6.39-rc3, but there are no source about linux command.
thanks for your help :-)
Most of the generic Linux commands come from coreutils http://www.gnu.org/software/coreutils/ there might be some missing there, but everything you asked specifically about should be found in coreutils source.
the kernel source doesn't contain any userland programs in it.
If you are using debian based os then u can use
dpkg -S command
to find the package it is present in and then
apt-get source package
to download the source. You can find similar commands on other machines.
Pickup the GNU coreutils # http://ftp.gnu.org/pub/gnu/coreutils/ and this includes a lot of these commands.
use
sudo apt-get build-dep core-utils
apt-get source core-utils --compile
to get and compile everything in core-utils from scratch

Resources