opencv crosscompile:Unexpected CMake generator expression - c++

When doing opencv cross-compilation for embedded devices, in order to use muslc c++, etc., I used this sentence in cmakelists.txt:
set(SYSTEM_LIBRARY_FOR_OPENCV
muslc
muslcsys
stdc++
supc++)
ocv_target_link_libraries(${the_module} PRIVATE
"$<BUILD_INTERFACE:${SYSTEM_LIBRARY_FOR_OPENCV}>")
Compilation can be successful, but there is such a warning:
CMake Warning at third_party/utils/opencv-4.6.0/cmake/OpenCVUtils.cmake:1675 (message):
Unexpected CMake generator expression: $<LINK_ONLY:$<BUILD_INTERFACE:muslc
Call Stack (most recent call first):
third_party/utils/opencv-4.6.0/CMakeLists.txt:1221 (ocv_get_all_libs)
I have verified that if you write directly like this:
ocv_target_link_libraries(${the_module} PRIVATE
"${SYSTEM_LIBRARY_FOR_OPENCV}")
it will appear error:
cmake error: includes target which requires target that is not in the export set
After searching, I didn't find any news related to this warning. Have you ever encountered it? How to eliminate it?
thanks

Related

How to choose MPI vendor/distribution with CMake?

I have a program that I would like to compile with CMake + make but using two different MPI distributions, OpenMPI and MPICH.
In Ubuntu, I have both installed; these are all the compiler wrappers I have installed:
mpic++ mpicxx mpif77.mpich mpijavac
mpicc mpicxx.mpich mpif77.openmpi mpijavac.pl
mpiCC mpicxx.openmpi mpif90 mpirun
mpicc.mpich mpiexec mpif90.mpich mpirun.mpich
mpicc.openmpi mpiexec.hydra mpif90.openmpi mpirun.openmpi
mpiCC.openmpi mpiexec.mpich mpifort mpivars
mpichversion mpiexec.openmpi mpifort.mpich
mpic++.openmpi mpif77 mpifort.openmpi
(OpenMPI is the default, i.e. when no distribution extension is specified. I am not using modules.)
How can I force CMake to choose MPICH over OpenMPI?
I tried setting -DMPI_ROOT=/usr/lib/x86_64-linux-gnu/mpich but
I get this error:
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find MPI (missing: MPI_CXX_FOUND)
Reason given by package: MPI component 'C' was requested, but language C is not enabled. MPI component 'Fortran' was requested, but language Fortran is not enabled.
Call Stack (most recent call first):
/usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.18/Modules/FindMPI.cmake:1721 (find_package_handle_standard_args)
CMakeLists.txt:11 (find_package)
it still uses OpenMPI.
This is how my CMakeLists.txt looks like:
cmake_minimum_required(VERSION 3.12.0)
project(myproject VERSION 0.1 LANGUAGES CXX)
#enable_language(C) #uncommenting these doesn't help
#enable_language(Fortran)
enable_testing()
include(CTest)
find_package(MPI REQUIRED)
Setting -DMPI_ROOT= or -DMPI_HOME= didn't work for me. It still uses the default in my system (OpenMPI).
What worked was to set -DMPI_EXECUTABLE_SUFFIX=.mpich, option which I found near the end of the documentation: https://cmake.org/cmake/help/latest/module/FindMPI.html.
Based on cmake documents, you should be able to select one by setting value of MPI_GUESS_LIBRARY_NAME.
Update: According to same document:
Try to find an MPI implementation that does not ship such a wrapper by guessing settings. Currently, only Microsoft MPI and MPICH2 on Windows are supported.

Compiling boost 1.62/1.63 with zlib on windows

I know this probably looks like a duplicate, but it is actually a new issue I encountered. A ticket is opened on boost side, but no one is answering... (https://svn.boost.org/trac/boost/ticket/12505#comment:12)
My issue is simple: I am following the same steps as with any other boost version (by setting ZLIB_INCLUDE AND ZLIB_LIBPATH) but since 1.62 I get a strange error:
Name clash for '<pbin.v2\standalone\ac\msvc-14.0\debug\address-model-64\link-static\threading-multi>main.obj'
...
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - <dll-path>... <library-path>... <xdll-path>...
I also tried to do it by configuring a custom user-config.jam but end up with the same error message.
For those who are interested, if you apply this diff (which will come along boost 1.64) then everything works fine: https://github.com/boostorg/build/commit/373fb6f76962caca9da109d4fe1e820af996326d?diff=unified.

Error using CMake to build SFML for Fedora 23 [xcb-image not found]

[FIRST ERROR FIXED, ANOTHER ONE AT END OF POST]
Hello and thanks in advance, I am having an issue trying to build SFML for my Fedora 23 system so I may continue work on my game I was developing in Linux Mint (I like fedora better, and I want it to work for both Debian and openSUSE distributions). The problem occurs when I am building SFML in the CMake GUI, it gives me the error:
Could NOT find LIBXCB_IMAGE (missing: LIBXCB_IMAGE_LIBRARY)
CMake Error at cmake/Modules/FindXCB.cmake:93 (message):
xcb-image not found
Call Stack (most recent call first):
src/SFML/Window/CMakeLists.txt:202 (find_package)
Configuring incomplete, errors occurred!
I checked to see if xcb-image was there by using the "locate" keyword and it returned:
[hunter#localhost ~]$ locate xcb-image
/usr/lib/libxcb-image.so.0
/usr/lib/libxcb-image.so.0.0.0 /usr/lib64/libxcb-image.so.0
/usr/lib64/libxcb-image.so.0.0.0
I also tried reinstalling libxcb to see if that would fix it but no cigar.
And yes, I read the tutorial SFML gives and made sure everything was installed and I followed the correct steps as well. link
Any idea why it's giving me this error? Compiler is the normal Fedora 23 gcc-c++ install... I'll provide any more information if needed.
EDIT 1
Fixed by installing 'xcb-util-image-devel'
I was able to fix it; but now get a new error:
UDev not found.
UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include
currently found includes: UDEV_INCLUDE_DIR-NOTFOUND
UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib
currently found libs: UDEV_LIBRARIES-NOTFOUND
CMake Error at cmake/Modules/FindUDev.cmake:49 (MESSAGE):
Could not find UDev library
Call Stack (most recent call first):
src/SFML/Window/CMakeLists.txt:215 (find_package)
I used 'locate udev' and I found lots of stuff:
[hunter#localhost ~]$ locate udev
/etc/udev
/etc/udev/hwdb.bin
/etc/udev/hwdb.d
/etc/udev/rules.d
/etc/udev/udev.conf
/usr/bin/udevadm
/usr/lib/libudev.so.1
/usr/lib/libudev.so.1.6.4
/usr/lib/udev
/usr/lib/dracut/modules.d/95udev-rules
/usr/lib/dracut/modules.d/90dm/dm-pre-udev.sh
/usr/lib/dracut/modules.d/90mdraid/mdmon-pre-udev.sh
/usr/lib/dracut/modules.d/95udev-rules/59-persistent-storage.rules
/usr/lib/dracut/modules.d/95udev-rules/61-persistent-storage.rules
/usr/lib/dracut/modules.d/95udev-rules/load-modules.sh
/usr/lib/dracut/modules.d/95udev-rules/module-setup.sh
/usr/lib/dracut/modules.d/98dracut-systemd/dracut-pre-udev.service
/usr/lib/dracut/modules.d/98dracut-systemd/dracut-pre-udev.service.8
/usr/lib/dracut/modules.d/98dracut-systemd/dracut-pre-udev.service.8.asc
/usr/lib/dracut/modules.d/98dracut-systemd/dracut-pre-udev.sh
/usr/lib/python3.4/site-packages/pyudev
/usr/lib/python3.4/site-packages/pyudev-0.17-py3.4.egg-info
/usr/lib/python3.4/site-packages/blivet/udev.py
/usr/lib/python3.4/site-packages/blivet/__pycache__/udev.cpython-34.pyc
/usr/lib/python3.4/site-packages/blivet/__pycache__/udev.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__init__.py
/usr/lib/python3.4/site-packages/pyudev/__pycache__
/usr/lib/python3.4/site-packages/pyudev/_compat.py
/usr/lib/python3.4/site-packages/pyudev/_errorcheckers.py
/usr/lib/python3.4/site-packages/pyudev/_libc.py
/usr/lib/python3.4/site-packages/pyudev/_libudev.py
/usr/lib/python3.4/site-packages/pyudev/_qt_base.py
/usr/lib/python3.4/site-packages/pyudev/_util.py
/usr/lib/python3.4/site-packages/pyudev/core.py
/usr/lib/python3.4/site-packages/pyudev/device
/usr/lib/python3.4/site-packages/pyudev/glib.py
/usr/lib/python3.4/site-packages/pyudev/monitor.py
/usr/lib/python3.4/site-packages/pyudev/os.py
/usr/lib/python3.4/site-packages/pyudev/pyqt4.py
/usr/lib/python3.4/site-packages/pyudev/pyside.py
/usr/lib/python3.4/site-packages/pyudev/wx.py
/usr/lib/python3.4/site-packages/pyudev/__pycache__/__init__.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/__init__.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_compat.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_compat.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_errorcheckers.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_errorcheckers.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_libc.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_libc.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_libudev.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_libudev.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_qt_base.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_qt_base.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_util.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/_util.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/core.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/core.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/glib.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/glib.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/monitor.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/monitor.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/os.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/os.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/pyqt4.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/pyqt4.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/pyside.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/pyside.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/__pycache__/wx.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/__pycache__/wx.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/device/__init__.py
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__
/usr/lib/python3.4/site-packages/pyudev/device/_device.py
/usr/lib/python3.4/site-packages/pyudev/device/_errors.py
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/__init__.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/__init__.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/_device.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/_device.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/_errors.cpython-34.pyc
/usr/lib/python3.4/site-packages/pyudev/device/__pycache__/_errors.cpython-34.pyo
/usr/lib/python3.4/site-packages/pyudev-0.17-py3.4.egg-info/PKG-INFO
/usr/lib/python3.4/site-packages/pyudev-0.17-py3.4.egg-info/SOURCES.txt
/usr/lib/python3.4/site-packages/pyudev-0.17-py3.4.egg-info/dependency_links.txt
/usr/lib/python3.4/site-packages/pyudev-0.17-py3.4.egg-info/top_level.txt
/usr/lib/python3.4/site-packages/sos/plugins/udev.py
/usr/lib/python3.4/site-packages/sos/plugins/__pycache__/udev.cpython-34.pyc
/usr/lib/python3.4/site-packages/sos/plugins/__pycache__/udev.cpython-34.pyo
/usr/lib/systemd/systemd-udevd
/usr/lib/systemd/system/dracut-pre-udev.service
/usr/lib/systemd/system/initrd-udevadm-cleanup-db.service
/usr/lib/systemd/system/systemd-udev-settle.service
/usr/lib/systemd/system/systemd-udev-trigger.service
/usr/lib/systemd/system/systemd-udevd-control.socket
/usr/lib/systemd/system/systemd-udevd-kernel.socket
/usr/lib/systemd/system/systemd-udevd.service
/usr/lib/systemd/system/initrd.target.wants/dracut-pre-udev.service
/usr/lib/systemd/system/sockets.target.wants/systemd-udevd-control.socket
/usr/lib/systemd/system/sockets.target.wants/systemd-udevd-kernel.socket
/usr/lib/systemd/system/sysinit.target.wants/systemd-udev-trigger.service
/usr/lib/systemd/system/sysinit.target.wants/systemd-udevd.service
/usr/lib/udev/ata_id
/usr/lib/udev/bcache-register
/usr/lib/udev/cdrom_id
/usr/lib/udev/check-ptp-camera
/usr/lib/udev/collect
/usr/lib/udev/hwdb.d
/usr/lib/udev/iphone-set-info
/usr/lib/udev/ipod-set-info
/usr/lib/udev/libinput-device-group
/usr/lib/udev/libinput-model-quirks
/usr/lib/udev/mtd_probe
/usr/lib/udev/mtp-probe
/usr/lib/udev/pcmcia-check-broken-cis
/usr/lib/udev/pcmcia-socket-startup
/usr/lib/udev/rename_device
/usr/lib/udev/rules.d
/usr/lib/udev/scsi_id
/usr/lib/udev/udev-add-printer
/usr/lib/udev/udev-configure-printer
/usr/lib/udev/usb_modeswitch
/usr/lib/udev/v4l_id
/usr/lib/udev/hwdb.d/20-OUI.hwdb
/usr/lib/udev/hwdb.d/20-acpi-vendor.hwdb
/usr/lib/udev/hwdb.d/20-bluetooth-vendor-product.hwdb
/usr/lib/udev/hwdb.d/20-net-ifname.hwdb
/usr/lib/udev/hwdb.d/20-pci-classes.hwdb
/usr/lib/udev/hwdb.d/20-pci-vendor-model.hwdb
/usr/lib/udev/hwdb.d/20-sane-backends.hwdb
/usr/lib/udev/hwdb.d/20-sdio-classes.hwdb
/usr/lib/udev/hwdb.d/20-sdio-vendor-model.hwdb
/usr/lib/udev/hwdb.d/20-usb-classes.hwdb
/usr/lib/udev/hwdb.d/20-usb-media-players.hwdb
/usr/lib/udev/hwdb.d/20-usb-vendor-model.hwdb
/usr/lib/udev/hwdb.d/60-evdev.hwdb
/usr/lib/udev/hwdb.d/60-keyboard.hwdb
/usr/lib/udev/hwdb.d/69-libmtp.hwdb
/usr/lib/udev/hwdb.d/70-mouse.hwdb
/usr/lib/udev/hwdb.d/70-pointingstick.hwdb
/usr/lib/udev/hwdb.d/90-libinput-model-quirks.hwdb
/usr/lib/udev/rules.d/10-dm.rules
/usr/lib/udev/rules.d/11-dm-lvm.rules
/usr/lib/udev/rules.d/11-dm-mpath.rules
/usr/lib/udev/rules.d/13-dm-disk.rules
/usr/lib/udev/rules.d/39-usbmuxd.rules
/usr/lib/udev/rules.d/40-iio-sensor-proxy.rules
/usr/lib/udev/rules.d/40-libgphoto2.rules
/usr/lib/udev/rules.d/40-usb-media-players.rules
/usr/lib/udev/rules.d/40-usb_modeswitch.rules
/usr/lib/udev/rules.d/50-udev-default.rules
/usr/lib/udev/rules.d/56-hp_conf_usb.rules
/usr/lib/udev/rules.d/56-hpmud.rules
/usr/lib/udev/rules.d/60-block.rules
/usr/lib/udev/rules.d/60-cdrom_id.rules
/usr/lib/udev/rules.d/60-drm.rules
/usr/lib/udev/rules.d/60-evdev.rules
/usr/lib/udev/rules.d/60-fprint-autosuspend.rules
/usr/lib/udev/rules.d/60-net.rules
/usr/lib/udev/rules.d/60-pcmcia.rules
/usr/lib/udev/rules.d/60-persistent-alsa.rules
/usr/lib/udev/rules.d/60-persistent-input.rules
/usr/lib/udev/rules.d/60-persistent-storage-tape.rules
/usr/lib/udev/rules.d/60-persistent-storage.rules
/usr/lib/udev/rules.d/60-persistent-v4l.rules
/usr/lib/udev/rules.d/60-raw.rules
/usr/lib/udev/rules.d/60-serial.rules
/usr/lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules
/usr/lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules
/usr/lib/udev/rules.d/62-multipath.rules
/usr/lib/udev/rules.d/63-md-raid-arrays.rules
/usr/lib/udev/rules.d/64-btrfs.rules
/usr/lib/udev/rules.d/64-md-raid-assembly.rules
/usr/lib/udev/rules.d/65-libwacom.rules
/usr/lib/udev/rules.d/65-md-incremental.rules
/usr/lib/udev/rules.d/65-sane-backends.rules
/usr/lib/udev/rules.d/69-bcache.rules
/usr/lib/udev/rules.d/69-cd-sensors.rules
/usr/lib/udev/rules.d/69-dm-lvm-metad.rules
/usr/lib/udev/rules.d/69-libmtp.rules
/usr/lib/udev/rules.d/69-xorg-vmmouse.rules
/usr/lib/udev/rules.d/70-mouse.rules
/usr/lib/udev/rules.d/70-power-switch.rules
/usr/lib/udev/rules.d/70-printers.rules
/usr/lib/udev/rules.d/70-spice-vdagentd.rules
/usr/lib/udev/rules.d/70-touchpad-quirks.rules
/usr/lib/udev/rules.d/70-uaccess.rules
/usr/lib/udev/rules.d/70-wacom.rules
/usr/lib/udev/rules.d/71-seat.rules
/usr/lib/udev/rules.d/73-seat-late.rules
/usr/lib/udev/rules.d/75-net-description.rules
/usr/lib/udev/rules.d/75-probe_mtd.rules
/usr/lib/udev/rules.d/77-mm-cinterion-port-types.rules
/usr/lib/udev/rules.d/77-mm-ericsson-mbm.rules
/usr/lib/udev/rules.d/77-mm-huawei-net-port-types.rules
/usr/lib/udev/rules.d/77-mm-longcheer-port-types.rules
/usr/lib/udev/rules.d/77-mm-mtk-port-types.rules
/usr/lib/udev/rules.d/77-mm-nokia-port-types.rules
/usr/lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
/usr/lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
/usr/lib/udev/rules.d/77-mm-simtech-port-types.rules
/usr/lib/udev/rules.d/77-mm-telit-port-types.rules
/usr/lib/udev/rules.d/77-mm-usb-device-blacklist.rules
/usr/lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
/usr/lib/udev/rules.d/77-mm-x22x-port-types.rules
/usr/lib/udev/rules.d/77-mm-zte-port-types.rules
/usr/lib/udev/rules.d/78-sound-card.rules
/usr/lib/udev/rules.d/80-drivers.rules
/usr/lib/udev/rules.d/80-kvm.rules
/usr/lib/udev/rules.d/80-libinput-device-groups.rules
/usr/lib/udev/rules.d/80-mm-candidate.rules
/usr/lib/udev/rules.d/80-net-setup-link.rules
/usr/lib/udev/rules.d/80-udisks2.rules
/usr/lib/udev/rules.d/85-nm-unmanaged.rules
/usr/lib/udev/rules.d/85-regulatory.rules
/usr/lib/udev/rules.d/90-alsa-restore.rules
/usr/lib/udev/rules.d/90-fwupd-devices.rules
/usr/lib/udev/rules.d/90-libgpod.rules
/usr/lib/udev/rules.d/90-libinput-model-quirks.rules
/usr/lib/udev/rules.d/90-pulseaudio.rules
/usr/lib/udev/rules.d/90-vconsole.rules
/usr/lib/udev/rules.d/91-drm-modeset.rules
/usr/lib/udev/rules.d/95-cd-devices.rules
/usr/lib/udev/rules.d/95-dm-notify.rules
/usr/lib/udev/rules.d/95-upower-csr.rules
/usr/lib/udev/rules.d/95-upower-hid.rules
/usr/lib/udev/rules.d/95-upower-wup.rules
/usr/lib/udev/rules.d/98-kexec.rules
/usr/lib/udev/rules.d/99-qemu-guest-agent.rules
/usr/lib/udev/rules.d/99-systemd.rules
/usr/lib64/libgudev-1.0.so.0
/usr/lib64/libgudev-1.0.so.0.2.0
/usr/lib64/libudev.so.1
/usr/lib64/libudev.so.1.6.4
/usr/lib64/pulse-7.0/modules/module-udev-detect.so
/usr/sbin/udevadm
/usr/share/bash-completion/completions/_udevadm
/usr/share/bash-completion/completions/udevadm
/usr/share/doc/libgudev
/usr/share/doc/python3-pyudev
/usr/share/doc/libgudev/NEWS
/usr/share/doc/python3-pyudev/CHANGES.rst
/usr/share/doc/python3-pyudev/README.rst
/usr/share/licenses/libgudev
/usr/share/licenses/python3-pyudev
/usr/share/licenses/libgudev/COPYING
/usr/share/licenses/python3-pyudev/COPYING
/usr/share/man/man5/udev.conf.5.gz
/usr/share/man/man7/udev.7.gz
/usr/share/man/man8/dracut-pre-udev.service.8.gz
/usr/share/man/man8/systemd-udevd-control.socket.8.gz
/usr/share/man/man8/systemd-udevd-kernel.socket.8.gz
/usr/share/man/man8/systemd-udevd.8.gz
/usr/share/man/man8/systemd-udevd.service.8.gz
/usr/share/man/man8/udevadm.8.gz
/usr/share/pkgconfig/udev.pc
/usr/share/vim/vim74/ftplugin/udevconf.vim
/usr/share/vim/vim74/ftplugin/udevperm.vim
/usr/share/vim/vim74/ftplugin/udevrules.vim
/usr/share/vim/vim74/syntax/udevconf.vim
/usr/share/vim/vim74/syntax/udevperm.vim
/usr/share/vim/vim74/syntax/udevrules.vim
/usr/share/zsh/site-functions/_udevadm
/var/cache/PackageKit/metadata/updates/packages/python3-pyudev-0.19.0-1.fc23.noarch.rpm
Same principle here : you should try to find the "-devel" package that contains the files that CMake is looking for (i.e the .so without a number appended at the end, and the header files)
Here the package you are looking for may be systemd-devel (udev library is now part of systemd)

Unable to generate makefile for basic PETSc program

I have a very basic program using PETSC
#include "PETSC/petsc.h"
#include "PETSC/petscsys.h"
#include "PETSC/petscmat.h"
int main(int argc, char *argv[]) {
PetscMPIInt rank,size;
PetscInitialize(&argc,&argv,0,0);
MPI_Comm_size(PETSC_COMM_WORLD,&size);
MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
PetscPrintf(PETSC_COMM_WORLD,"Number of processors = %d, rank = %d\n",size,rank);
PetscSynchronizedPrintf(PETSC_COMM_WORLD,"synchronized rank = %d\n",rank);
MPI_Barrier(PETSC_COMM_WORLD);
PetscFinalize();
return 0;
}
However, I got undefined reference errors to PETSC_COMM_WORLD, PetscInitialize and other junk, when I tried to compile using mpic++
I am now trying to use build and cmake. This is my attempt at a CMakeLists
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(checkMPI)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
set(PETSC_ARCH linux-gnu)
set(PETSC_DIR l${PROJECT_SOURCE_DIR}/third-party/petsc)
FIND_PACKAGE(PETSc REQUIRED)
INCLUDE_DIRECTORIES(${PETSC_INCLUDES})
ADD_DEFINITIONS(${PETSC_DEFINITIONS})
ADD_EXECUTABLE(checkMPI checkMPI.cpp)
TARGET_LINK_LIBRARIES(checkMPI ${PETSC_LIBRARIES})
In addition, I have a directory cmake-modules containing the cmake-modules for PETSc
However, when I try to generate the makefile by typing ccmake .. and then c, I get the output
CMake Error at cmake-modules/FindPETSc.cmake:127 (message):
The pair PETSC_DIR=l/directory/HPC/third-party/petsc
PETSC_ARCH=linux-gnu do not specify a valid PETSc installation
Call Stack (most recent call first):
CMakeLists.txt:10 (FIND_PACKAGE)
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108
(message):
PETSc could not be found. Be sure to set PETSC_DIR and PETSC_ARCH.
(missing: PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315
Anyone can help?
Based on FindPETSC.cmake it seems that the default options for PETSC_ARCH are:
linux-gnu-c-debug
linux-gnu-c-opt
x86_64-unknown-linux-gnu
i386-unknown-linux-gnu
or the one you have used in case of the manual build.
CMake tries to find file ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h or
${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h.

String regex replace need 6 args but..MinGW , CMake , w7

I'm trying to build in w7 an aplication that I use on CentOS 6.5 without problems, but i need to compile for Windows 32 and 64 bits.
This program is using RTi libs, but Win libs are made for VS2010, I'm tryng to build with MinGW Gcc 4.x.x , CMake 2.8.12 and Maven 3.02. I corrected some data types incompatibilities but i think that may there are some problems with slash and forward slash between MinGW and Windows 7.
Base program was compiled succesfully, now its time for binaries.
When i execute cmake -G "MinGW Makefiles" expression, I get this errors.
CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:116 (RemoveCXXComments)
C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:12 (HasInterfaces)
C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:59 (GetDDSGeneratedFiles)
CMakeLists.txt:6 (GenerateIDLLibrary)
CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:65 (RemoveCXXComments)
C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:74 (FindIncludes)
CMakeLists.txt:6 (GenerateIDLLibrary)
Includes for 'C:/MinGW/msys/1.0/home/blcoalla/trunk/Example/TestProfiles/TestPayload.idl' are
CMake Error at C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:43 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
C:/Workspace/trunk/IB/src/make/IB.Utils.cmake:65 (RemoveCXXComments)
C:/Workspace/trunk/IB/src/make/IB.DDS.cmake:111 (FindIncludes)
CMakeLists.txt:6 (GenerateIDLLibrary)
Here is an extract from utils.cmake:
Macro to get the content of a file
-----------------------------------------------------------------
macro (GetFileContent OutFile)
#message("Called GetFileContent '${ARGN}'")
SET(cat_prog cat)
IF(WIN32)
IF(NOT UNIX)
SET(cat_prog type)
ELSE(NOT UNIX)
message (FATAL_ERROR "cannot determine the system to call to proper 'cat/type' method")
ENDIF(NOT UNIX)
ENDIF(WIN32)
set (Out)
set (tmp)
foreach(gfcfile ${ARGN})
if (NOT EXISTS ${gfcfile})
message(FATAL_ERROR "Cannot find file '${gfcfile}'")
endif(NOT EXISTS ${gfcfile})
EXECUTE_PROCESS(COMMAND ${cat_prog} ${gfcfile}
OUTPUT_VARIABLE tmp)
set (Out ${Out} ${tmp})
endforeach(gfcfile ${ARGN})
set(${OutFile} ${Out})
#message("Leaving GetFileContent")
endmacro(GetFileContent)
#-----------------------------------------------------------------
# Macro to get includes from an IDL file
#-----------------------------------------------------------------
macro (RemoveCXXComments Output Input)
#message("RemoveCXXComments Input: '${Input}'")
# Remove single line comments
string(REGEX REPLACE "(//[^\n]*\n)" "" ${Output} ${Input})
#message("RemoveCXXComments without single line: '${${Output}}'")
# Remove several line comments in file
string(REGEX REPLACE "(/\\*([^*]|[\r\n]|(\\*+([^*/]|[\r\n])))*\\*+/)" "" FileContent ${FileContent})
#message("RemoveCXXComments without multi line: '${${Output}}'")
endmacro (RemoveCXXComments)
#-----------------------------------------------------------------
from CMakeLists.txt6:
GenerateIDLLibrary(TestPayload TestPayload.idl)
from IB.DDS.cmake:59:
# Get expected generated files
GetDDSGeneratedFiles(DDSCXXGeneratedFiles DDSHGeneratedFiles ${IdlFile})
# message("CXX Files expected to be generated: '${DDSCXXGeneratedFiles}'")
#message("H Files expected to be generated: '${DDSHGeneratedFiles}'")
The error message is a hint that one of your variables is empty. You can output the variables and check which one is empty and should not be empty. I'd guess something fails for Windows and a variable is not set. If a variable is empty or not set, CMake cannot see that you gave an argument at all.
If you want to force your regex, you can make quotation marks around the arguments. Then CMake knows that you gave the right number of arguments and it does not complaint about "" as a argument. But that does not fix your real problem, but only calm your current issue. I do not advise you to do so, until you really know that it is ok.
Either Output or Input or FileContent is undefined. The error must be somewhere else, you might use
if( DEFINED ${Output} )
message( "Output defined")
to check for their consistency.
-> As a hint, if you wrote this code, you might substitute
${variable}
with
"${variable}
to avoid using undefined variables (if a "" string is preferable, you still need to address why you're using an undefined variable)