Compiling erlang with systemtap but require dtrace - linux

I'm compiling erlang otp from source like following:
./configure --with-dynamic-trace=systemtap
But it reports error:
checking for dtrace... no
configure: error: No dtrace utility found.
I think systemtap is for linux usage and it is different from dtrace, am I right?
After installed dtrace Now the error is:
dtrace: failed to compile script emulator/beam/erlang_dtrace.d: Preprocessor not found
configure: error: Could not precompile erlang_dtrace.d: dtrace -h failed
configure: error: /root/otp/erts/configure failed for erts

Which distro are you using? I'd forget using DTRACE, it will be a bit harder to make it to work than Systemtap (at least it was for me). I'm using Systemtap and it works perfectly.
If you are not using Fedora/RH you should patch your kernel with UTRACE or use a kernel >= 3.5 with UPBOBES enabled.
To verify if your kernel has UTRACE/UPROBE enabled run this:
grep UTRACE /boot/config-$(uname -r)
or
grep PROBES /boot/config-$(uname -r)
For example, in my machine (Ubuntu 12.04 with Mainline kernel 3.5):
$ grep UTRACE /boot/config-$(uname -r)
$
$ grep UPROBES /boot/config-$(uname -r)
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_UPROBES=y
You should also have systemtap installed. The version shipped with Ubuntu (my case) is quite old, so I compiled it from source (traditional configure/make/make install). You can get it here:
http://sourceware.org/systemtap/ftp/releases/
I'm using version 1.8.
Then try to recompile it again. It should work.
Regards

After installing systemtap(sudo apt-get install systemtap), exiting or logging out from the current shell session then logging in may help.
Also, you may try using kerl.

Related

How to use Linux perf tool on WSL2? How to have perf for the correct kernel?

I am trying to use the perf tool of Linux on my WSL2 using Windows10 machine. I have done every step of the accepted answer here:Is there any method to run perf under WSL?
When I ran "make" comment, I got a warning:
Warning: Kernel ABI header at 'tools/include/uapi/linux/stat.h'
differs from latest version at 'include/uapi/linux/stat.h'
But the perf executable was still created.
However when I try to use perf like this:
sudo perf record -g myexe myargs
I received this error:
WARNING: perf not found for kernel 5.10.16.3-microsoft
You may need to install the following packages for this specific
kernel:
linux-tools-5.10.16.3-microsoft-standard-WSL2
linux-cloud-tools-5.10.16.3-microsoft-standard-WSL2
Then I tried to run this:
sudo apt install linux-tools-5.10.16.3-microsoft-standard-WSL2
However that did not work either, I got this:
Reading package lists... Done Building dependency tree Reading state
information... Done E: Unable to locate package
linux-tools-5.10.16.3-microsoft-standard-WSL2 E: Couldn't find any
package by glob 'linux-tools-5.10.16.3-microsoft-standard-WSL2'
What should I do now?

Remove all previous version MPI and reinstall correctly it

First of all: I'm on linux mint 17.3 x64
What I've done so far:
Guide to install Open MPI 1.8
Guide to install MPI
Attemp to remove MPI executing: sudo apt-get install libcr-dev mpich2 mpich2-doc (Actually the should be not installed)
What I can see from terminal:
output of: echo $PATH
/path/to/mpj//bin:/home/timmy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/timmy/.openmpi/bin
(I immagine that I've to remove /path/to/mpj/ (not exists) and /home/timmy/.openmpi/bin (I want to remove previous version of ompi))
output of: echo $LD_LIBRARY_PATH
(nothing)
Really, doesn't appear anything!
output of mpirun
--------------------------------------------------------------------------
mpirun could not find anything to do.
It is possible that you forgot to specify how many processes to run
via the "-np" argument.
--------------------------------------------------------------------------
Why I want to remove Open MPI and reinstall it
I've a project to do using both MPI and OpenMP and with the actual installation of MPI I cannot compile using the following command: mpicc -openmp "test_omp.c" -o "test_omp". It gives me the following error: Not defined function omp_get_thread_num(); and moreover, it ignore my #pragma commands.
Your problem is that you are giving the compiler the wrong option to enable the OpenMP support. -openmp is only understood by the (commercial) Intel compiler, which is probably the tool-set installed on the site you've referred to in your other question. Most Linux distributions come with GCC and one is to assume that mpicc will use GCC (check with mpicc -showme).
The option to enable OpenMP support in GCC is -fopenmp (notice the f).

Cannot compile an OS for ARM on OSX

Github page for the OS is here: https://github.com/rellermeyer/course_os
From the wiki in the Github page, it indicates me to install glib and texinfo. It also indicates me how to build the toolchain.
On my first attempt at building, it told me I needed wget and I installed using HomeBrew. When issuing the command $ brew list, I get:
$ brew list
cloog018 glib make postgresql wget
coreutils gmp4 mpfr2 python
gcc48 isl011 openssl readline
gdbm libffi ossp-uuid sqlite
gettext libmpc08 pkg-config texinfo
Which shows me I have everything I need. However, on the second attempt it gives me an error:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Systems/course_os/toolchain/arm-none-eabi
checking build system type... Invalid configuration `Systems/course_os/toolchain/arm-none-eabi': machine `Systems/course_os/toolchain/arm-none' not recognized
configure: error: /bin/sh ../../src/gcc-4.8.1/config.sub Systems/course_os/toolchain/arm-none-eabi failed
I don't understand the warning and what it is it's missing. Additionally, when I try to do the same steps with Ubuntu, it runs perfectly and I'm able to go on to building the kernel and run Hello World. What does Ubuntu have that OSX doesn't that makes the OS run? Could it be an issue with gcc?
Note: I'm running OSX Yosemite 10.10 and Ubuntu 14.04.
I found an answer to my problem. There was an issue with one of my target folders being two words. I changed it from Operating System to OS and it ran perfectly. Thanks!

configure does not recognize androideabi

I am trying to compile a library using android-ndk-r5 standalone toolchain and autotools. When doing a ./configure, it fails with:
$ ./configure --host=arm-linux-androideabi
...snip...
checking host system type... Invalid configuration `arm-linux-androideabi': system `androideabi' not recognized
configure: error: /bin/sh ./config.sub arm-linux-androideabi failed
Explicitly setting CC and CXX does not work either (configure says to use --host).
The NDK docs and various materials online seems to indicate that using the standalone toolchain in this manner should be possible. What is wrong here? and how can I resolve it? (besides simply ditching autoconf and going back to Android.mk)
You might need a newer config.sub and config.guess, 2010-05-20 or later.
You can get the newer config.sub and config.guess from here
I took the newest from both, but that lead to errors, so I took the mentioned ones of Peter Eisentraut's date.
You can also grab config.sub and config.guess from the Ubuntu autotools-dev package:
sudo apt-get install autotools-dev
cp /usr/share/misc/config.{sub,guess} .

Using GHC, cabal with GMP installed in user-space

I have been trying to install Haskell Platform and cabal-install installed on Linux in user-space on a system that doesn't have the GNU Multi-Precision package (GMP) installed.
I managed to get GHC-6.12.1 installed and GHCi working by setting up LB_LIBRARY_PATH to point at the lib directory where I installed GMP, but then ran into problems in the next step, getting cabal-install to work. It kept trying to (statically) link to GMP.
This fails because the GMP is not installed in the system and ld hasn't a clue where to find the libraries, and there is no environment variable (that I am aware of) that can tell ld where to find the user-installed GMP, and (apparently) no way of telling configuring Cabal to supply the relevant -L flag.
After much fruitless searching and hacking attempts I hit on the absurdly simple idea of installing my own ld shell script that invokes the system ld with the appropriate -L flag.
This is shell scripting 101, of course:
#!/bin/sh
/usr/bin/ld -L$HOME/gnu/lib "$#"
With this script installed in a directory on my PATH ahead of /usr/bin all the problems seem to have gone away.
Basically, your ghc is not working yet. Yes, it can compile things, but it cannot link programs because it needs to link them to gmp.
What we can do is to edit some core package, e.g. the rts package, so that ghc will always use the right -L flag:
ghc-pkg describe rts > rts.pkg
vi rts.pkg # add the gmp dir to the `library-dirs` field
sudo ghc-pkg update rts.pkg

Resources