unable to statically build mpich - mpi

I'm trying to cross compile MPICH and statically link libraries using the following commands:
export CC="/buildroot-2015.02/output/host/usr/bin/arm-linux-gcc"
export CFLAGS="-march=armv5te -I/buildroot-2015.02/output/host/usr/include/"
export LDFLAGS="--static -L//buildroot-2015.02/output/host/usr/lib/"
./configure --prefix=/mpich-3.1.3/build/ --host=arm-linux --disable-shared --with-pm=hydra --with-device=ch3:nemesis --disable-fortran
After building I tried file mpiexec and I got the following:
mpiexec: symbolic link to `mpiexec.hydra'
$ file mpiexec.hydra
mpiexec.hydra: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
I want know how to link MPICH statically.

Related

pcl/pcl_config.h: No such file or directory

My environment is below.
・Operating System and version:windows 10 64bit
・Compiler:C:\msys64\mingw64\bin\g++.exe
・PCL Version:1.9.1
pcl_config.h not found as below error occurred when compiled under above env..
Certainly this header file is not included.
Let me know how to solve it.
PS C:\pcl\pcl\examples\common> g++ -o minmax -I ../../io/include -I ../../common/include .\example_get_max_min_coordinates.cpp
In file included from ../../common/include/pcl/PCLHeader.h:10,
from ../../common/include/pcl/point_cloud.h:47,
from ../../io/include/pcl/io/pcd_io.h:42,
from .\example_get_max_min_coordinates.cpp:2:
../../common/include/pcl/pcl_macros.h:64:10: fatal error: pcl/pcl_config.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
Short answer
pcl_config.h is generated via pcl_config.h.in by the cmake tool. So it seems that compilation did not finish correctly.
Longer answer
Please make sure you have compiled the relevant modules of PCL (at least pcl-core) before proceeding
You might prefer a pre-built installation from releases or distributed by a package/source manager of your choice
PCL makes heavy use of other libraries and it is best to supply the dependencies (as mentioned below) via CMake or manually via the -I and -l options. If you provide the location of pcl_config.h, the compiler will complain about Eigen next.
The build instructions are available here. TL;DR: After satisfying the dependencies (cmake, c++ compiler, boost, eigen, flann, vtk and other depending on use-case), run the following commands
cd $PCL_SOURCE_DIR
mkdir -p build; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
Feel free to use any build generator (like Ninja) or change build type to Debug or RelWithDebInfo as per your needs.

Adding module to existing Qt5 installation from source

I have an existing Qt5.3.2 installation from tar.gz source files.
When attempting to compile VTK, which has optional Qt{4,5} interface, I was informed I don't have QtWebKitWidgets by ccmake.
I don't particularly want to reinstall Qt5 on top of the existing installation, for fear of breaking other things built against it.
Can I add to my current Qt5?
Would variants on
/path/to/configure -release -prefix $existingPrefix
make -module-qtwebkit
make install
or
/path/to/configure -release -prefix $newPrefix
make -module-qtwebkit
make install
cp -rf $newPrefix/CMake/QtWebKit (or similar path) $existingPrefix/CMake/
or as above, but with symlink, work?
Qt5.3 no longer includes QtWebKit, which should now be built separately.
The WebKit package can be downloaded from the Qt Downloads website, via the separate packages repository: link for 5.3.2
This can then be installed by appropriately setting environment variables such that the relevant (Qt5.3.2) qmake is first in the path, then from the expanded source directory, typing:
qmake
make -jN (with N make jobs)
(sudo, if appropriate) make install
The download is approximately 50MB.
Edit: It's also worth noting that if your Bison version is 3.x, then you might not be able to build the snapshot for QtWebKit. Instead download from the development repositories, to avoid an error looking something like: link to bug report
g++ -c [...] -o .obj/release-shared/generated/glslang_tab.o generated/glslang_tab.cpp
generated/glslang_tab.cpp: In function 'int yyparse(TParseContext*)':
generated/glslang_tab.cpp:1785:30: error: too few arguments to function 'int yylex(YYSTYPE*, void*)'
yychar = yylex (&yylval);
^
generated/glslang_tab.cpp:279:12: note: declared here
extern int yylex(YYSTYPE* yylval_param, void* yyscanner);

Compiling an OpenCL program using a CL/cl.h file

I have sample "Hello, World!" code from the net and I want to run it on the GPU on my university's server. When I type "gcc main.c," it responds with:
CL/cl.h: No such file or directory
What should I do? How can I have this header file?
Are you using Ubuntu or Debian distro? Then you could use this package to solve the problem with missing header file:
apt-get install opencl-headers
You must install opencl library to solve linking issues using that Debian and Ubuntu package:
apt-get install ocl-icd-libopencl1
You can also use these nonfree libraries: nvidia-libopencl1 (Debian) or nvidia-libopencl1-xx (Ubuntu).
Make sure you have the appropriate toolkit installed.
This depends on what you intend running your code on. If you have an NVidia card then you need to download and install the CUDA-toolkit which also contains the necessary binaries and libraries for opencl.
Are you running Linux? If you believe you already have OpenCL installed it could be that it is found at a different location than the standard /usr/include. Type the following and see what results you get:
find / -iname cl.h 2>/dev/null
On my laptop for example, the header is found at /usr/local/cuda-5.5/include. If its the case were your header file is at a different location you simply have to specify the path during complication
g++ -I/usr/local/cuda-5.5/include main.c -lOpenCL
Alternatively, you can create a symbolic link from the path to /usr/include:
ln -s /usr/local/cuda-5.5/include/CL /usr/include

Cmake: libpng not dynamically linking correctly on a different machine

On Ubuntu 13.04 VM, which was used to build the sc utility, the dependency looks like the below:
$ ldd sc | grep -i png
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xb75c2000)
On my Fedora VM, the sc utility is not linking libpng correctly. It has libpng15 but it is trying to link to libpng12:
$ ldd sc | grep -i png
libpng12.so.0 => not found
libpng15.so.15 => /lib/libpng15.so.15 (0xb6f40000)
I am using cmake to build my executables, and I am using the default FindPNG cmake file. My executable is statically linking to ImageMagick, which is configured to use libPNG.
find_package(ImageMagick COMPONENTS MagickWand MagickCore REQUIRED)
find_package(ZLIB)
find_package(Threads)
find_package(JPEG)
find_package(PNG)
find_package(LibLZMA)
find_package(OpenMP)
find_package(Cairo)
include_directories(${ImageMagick_INCLUDE_DIRS})
include_directories(${CAIRO_INCLUDE_DIRS})
target_link_libraries(sc
${LIBCAIRO}
${ImageMagick_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
${LIBLZMA_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${X11_LIBRARIES}
${OpenMP_LIB}
)
I've tried making my own FindPNG cmake to target libpng.so. I still get the same result...
Is there any way to make that so that my executable will link to whatever libpng is found on user's machine?
It looks like there is nothing that I can do with cmake, and the problem is coming from libraries that I am linking against (Cairo and ImageMagick).
The reason that there are two libpng dependencies on the deployed system is that I am deploying a prebuild ImageMagick (statically) which is built on a machine with libpng12. I assumed that the deploy system will have Cairo and libpng, and it does, but it does not have libpng12. It has libpng15 and Cairo, which is linking against it. Therefore, ldd shows that my executable is dependent on libpng12 and libpng15.
To resolve this, I statically link against libpng12 and any libraries that are linking it.

Qt Creator in Emacs keybind

Any way to realize emacs keybind on Qt Creator (QTC)?
Some possibilities:
emacskeys but I failed to build (maybe because version supported by emacskeys is QTC 2.2.1 as of today).
Utilizing FakeVim feature (I haven't tried b/c modifying vim keybind and adjusting to that of emacs seems complicate)
Associating emacsclient (not tried)
Build error with emacskeys:
user#host:/usr/share/qtcreator/qt-creator-2.5.0-src$ sudo /usr/local/Trolltech/Qt-4.8.2/bin/qmake && make
cd src/ && /usr/local/Trolltech/Qt-4.8.2/bin/qmake /usr/share/qtcreator/qt-creator-2.5.0-src/src/src.pro -o Makefile
Failure to open file: /usr/share/qtcreator/qt-creator-2.5.0-src/src/Makefile
Unable to generate makefile for: /usr/share/qtcreator/qt-creator-2.5.0-src/src/src.pro
make: *** [src/Makefile] Error 5
Environment) Ubuntu 10.04, Qt 4.8.2, Qt 2.5
Inspired by this comment, I've managed to configure emacs keybind, using QTC's feature.
"Environment" -> "Keyboard" tab
Download config file from here
Import it.
Note that I've only included simple text editor commands (e.g. C-a, C-e etc.).

Resources