How to build openmpi rpm from srpm cuda aware - linux

I would like to build the OpenMPI 1.10.2 rpm from the srpm.
But I need to build it cuda aware.
According to the documentation (https://www.open-mpi.org/faq/?category=buildcuda) I need to add ./configure --with-cuda
Is there any way to do that while creating the rpm?
I tried:
rpmbuild -bb --with cuda openmpi-1.10.2.spec
rpmbuild -ba openmpi-1.10.2.spec --define '--with-cuda'
But no success.

Use the second one, but edit the spec file. Find the call to ./configure or the %configure macro being called, and add your --with-cuda to that line.
rpmbuild -ba openmpi-1.10.2.spec

Related

Why can't I get the same symbols when compiling kernel?

I'm compiling kernel (4.14.0-115.el7a.0.1.aarch64) of Centos 7.6.1810.
The source file is kernel-alt-4.14.0-115.el7a.0.1.src.rpm from centos repo.
What I did:
mkdir /root/kernel
cd /root/kernel
wget http://vault.centos.org/centos/7.6.1810/os/Source/SPackages/kernel-alt-4.14.0-115.el7a.0.1.src.rpm
rpm2cpio ./kernel-alt-4.14.0-115.el7a.0.1.src.rpm | cpio -div
tar -vxf linux-4.14.0-115.el7a.tar.xz
cd linux-4.14.0-115.el7a/
cp /boot/config-4.14.0-115.el7a.0.1.aarch64 ./.config
# comment CONFIG_MODULE_SIG_KEY and CONFIG_SYSTEM_TRUSTED_KEYS
make -j
I compared the generated file Module.symvers and symvers-4.14.0-115.el7a.0.1.aarch64.gz in /boot/. I found that there is some difference.
There are 13408 symbols in origin symvers and 13430 in recompiled symvers.
In recompiled symvers, there are missed symbols acpi_device_get_match_data fwnode_get_mac_address fwnode_get_next_available_child_node fwnode_get_phy_mode fwnode_irq_get queued_spin_lock_slowpath .
Why?
How can I compile kernel with the exact same symbols?
May be source picked from tar does not have all config option enabled. So before compiling kernel I would recommend using spec files to get the complete source code
Download kernel-alt-4.14.0-115.el7a.0.1.src.rpm
rpm -ivh kernel-alt-4.14.0-115.el7a.0.1.src.rpm
rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec
cd /root/rpmbuild/BUILD
compile the code and check symver

how to install debuginfo packages from vmlinux

I am building my own kernel with following options set.
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_INFO=y
So I assume that the generated vmlinux file will have all the required debuginfo.
I installed that kernel in a machine and put the vmlinux file under /boot/.
However, when I tried to do a perf annotate it does not show the source code along side the assembly code. It only shows the assembly code and c function names not the entire source code(I have tried toggling "s" during annotate).
Here are my perf commands.
#perf record -g -a -e cycles:k sleep 5
#perf report -f -g -s symbol
#perf annotate -f -s <kernel function name> > annotate_<kernel_function>.txt
What am I missing here ? Do I need to install debuginfo packages separately ?
Regards,
Atish
The binrpm-pkg target to build kernel rpm does not generate debuginfo because it disabled generation of debuginfo packages, you can try do this, open scripts/package/mkspec in your kernel source tree, and search for a line echo "%define debug_package %{nil}", comment or remove this line, and try to build again.
The reason is that this line explicitly tell rpmbuild that skip debuginfo packages.
See the link:
https://github.com/torvalds/linux/blob/9256d5a308c95a50c6e85d682492ae1f86a70f9b/scripts/package/mkspec#L45

How to compile c++ programs in the new c++ driver provided by Datastax in Linux

I am new to Cassandra. I installed c++ driver from Datastax. Can some one please provide me the steps like in which path I have to create the ā€˜.cā€™ file and how I can compile it. I can see some example programs in example folder. Can anyone plz tell me how to compile the example programs.
The cpp-driver uses cmake and depends on libuv. So the first steps would be to ensure you have cmake installed as well as libuv. Depending on your linux distribution it may be as simple as using package manager like apt or yum (i.e. sudo apt-get install cmake libuv-dev)
Building is just a matter of running the following steps in the cpp-driver directory:
cmake .
make
sudo make install
This will install libcassandra.so to somewhere in your lib path. You can then link by providing '-lcassandra' in your parameters to clang or gcc (i.e. clang myfile.c -o myfile -lcassandra)
There is very comprehensive documentation on building from source here.

Compiling ODE code in Linux

I have downloaded ode-0.11.1 and I am able to compile source code by modifying the Makefile provided with the demos, but I can't figure out how to manually compile and link the code I need as a standalone.
I tried probing at the Makefile and substituting the macros manually, as well as running it and checking the output.
Does anyone know how to do this?
OpenDE, or ODE, is configured with GNU autoconf/automake tools.
This means that you need to invoke ./configure before you can build the package.
To see all the options, use:
$ ./configure --help
An invokation to ./configure will often need a target where to install to.
A typical invokation would look like this:
$ ./configure --prefix=$HOME --with-trimesh=opcode
$ make install
This will install OpenDE in your home directory.
If you omit the --prefix argument, the default /usr/local will be used, and you will need root permissions to install.
The example invokation will also include support for triangle meshes using OPCODE.

rpmbuild generates RPM in which subdirectory

rpmbuild generates RPM under which directory?
I checked the RPMS directory:-
[root#tom adil]# ls /usr/src/redhat/
BUILD RPMS SOURCES SPECS SRPMS
[root#tom adil]# ls /usr/src/redhat/RPMS/
athlon i386 i486 i586 i686 noarch
[root#tom adil]#
How to decide rpmbuild outputs in which of the above sub-directories?
Is it controlled by spec file? What is the default option?
I thought uname -p but its not the case probable uname -i is used.
Linked to my last question Difference between "machine hardware" and "hardware platform"
The binary package is named according to the %_build_name_fmt macro. By default this macro contains %{ARCH}/ at the beginning, so that is where the binary package is placed.
Following on from your last comment, by default the RPM will go into the subdirectory that matches the platform you're building on. You can override this by passing the --target parameter to rpmbuild, but this only applies where valid; for example, you can use --target i386 on an x86_64 system to build a 32-bit RPM, but you can't build a 64-bit RPM on a 32-bit platform.
The RPM goes to the RPMS folder and the source RPM to the SRPMS. This is not controlled by the spec file - this is convention. What exactly are you trying to do?

Resources