Archivo

Archivo para la categoría ‘Programación’

Cross-compiling & debugging for RaspberryPi using CMake and gdbserver/gdb

Sábado, 16 de marzo de 2013 Sin comentarios

CMake LogoRaspi_Colour_R

The Raspberry Pi (RPi in advance) board has become in the last year one of the favourite toys for geeks & programmers. Although it has a reasonable powerful processor, if we have in mind to develop a large project in this little board, the development process should be performed in a (more suitable) workstation and then perform cross compilations to generate binaries for the RPi architecture (ARM). There already exists some available tutorials explaining how to do the cross-compilation and debugging using the Eclipse IDE. However, as most of the readers of this blog know, I don’t like to be tied to the usage of a specific IDE, and I have been using CMake for configuring my software projects for quite a while (and letting anyone using their favourite programming environment to develop). Therefore, in this post I will explain how to do the cross-compilation process with CMake and how to debug the applications in the remote target from our host workstation. Here we go! Leer más…

GD Star Rating
loading...
Share

Qt AUTOMOC with CMake

Viernes, 14 de diciembre de 2012 Sin comentarios

Configuring big Qt projects with CMake could be sometimes annoying because of the necessity to apply the moc command over those specific header files containing the Qt Q_OBJECT macro. Long time ago the CMake macro qt4_wrap_cpp was introduced to help in the preprocessing of those files and it helps a lot. However, in big projects where we have header files containing Q_OBJECT macro and other ones where the macro is not included we have to specify the first ones in a list of files that will be preprocessed with the qt4_wrap_cpp macro. An Cmake configuration example of what I’m talking about could be:

SET(COMMON_SRC    file1.cpp file2.cpp file3.cpp)
SET(COMMON_HDR    file1.h   file3.h)
SET(COMMON_UIS    file1.ui  file3.ui)

QT4_WRAP_CPP(COMMON_MOC  ${COMMON_HDR})
QT4_WRAP_UI(COMMON_UIS  ${COMMON_UIS})

ADD_LIBRARY(project_common   ${COMMON_SRC} ${COMMON_MOC} ${COMMON_UIS})

But things could be easier. This afternoon I was watching some of the videos of the Qt Developers day in Berlin 2012 (http://www.cyberhades.com/2012/12/13/videos-del-qt-developers-day-berlin-2012/). Between them, I watched the presentation of Stephen Kelly talking about how to configure Qt projects with CMake in Qt4 and Qt5 (Some interesting new features will come soon for the new release of Qt ^^). In his presentation Stephen mentioned a new feature introduced in CMake 2.8.8 that let us avoid to apply the qt4_wrap_cpp macro over those headers containing Q_OBJECT macro. It’s so simple as setting the CMAKE_AUTOMOC variable to ON. Here you have the new version of the previous code using CMAKE_AUTOMOC feature.

SET(CMAKE_AUTOMOC ON)
...
SET(COMMON_SRC    file1.cpp file2.cpp file3.cpp)
SET(COMMON_UIS    file1.ui  file3.ui)

QT4_WRAP_UI(COMMON_UIS  ${COMMON_UIS})

ADD_LIBRARY(project_common   ${COMMON_SRC} ${COMMON_UIS})
GD Star Rating
loading...
Share

CMake tutorial

Sábado, 1 de diciembre de 2012 Sin comentarios

Two weeks ago, I made a speech in my work about the usage of CMake for configuring C/C++ projects in order to be independent from platforms (Windows, Linux, Mac, QNX, etc) and IDEs/Editors. In this speech I treated general concepts and commands of CMake and also specific cases such us the usage of Qt and cross-compiling. I prepared the slides in my free time I decided to use a Creative Commons licence to share them with some pieces of code too. Be free to share this work in non commercial mode and with acknowledgement to the author.

cmake-tutorial

cmake-tutorial-sources


Licencia de Creative Commons

CMake tutorial by Luis Díaz Más is licensed under a Creative Commons Reconocimiento-NoComercial 3.0 Unported License.

GD Star Rating
loading...
Share
Categories: Programación, Scripting Tags: ,

Skipping blocking libav functions with interruption callbacks

Viernes, 24 de agosto de 2012 1 comentario

Introduction

In this post, we are going to see how to write interruption callbacks for the blocking functions of the libav library. This feature seems to be available in older versions of the library, but we are going to detail the necessary steps for the branch 0.8.x.

Note that the solutions could be different for older branches of the library such as 0.6.x

Leer más…

GD Star Rating
loading...
Share
Categories: Programación Tags: , ,

Image processing with CUDA (Comparison with CPU, MMX, SSE & OpenCV)

Miércoles, 15 de agosto de 2012 Sin comentarios

CUDA Logo

En esta entrada se presenta un ejemplo de como realizar procesamiento de imágenes con CUDA, y se compara el rendimiento de una aplicación sencilla para invertir los colores de una imagen, implementada con las siguientes tecnologías y/o librerías:

  • Instrucciones aritméticas con CPU.
  • Librería OpenCV.
  • Instrucciones aritméticas usando tecnología SIMD (MMX y SSE).
  • CUDA C runtime.
  • NPP (Nvidia Performance Primitives). [librería proporcionada con el toolkit de CUDA]

Leer más…

GD Star Rating
loading...
Share
Categories: Programación Tags: , , , , , , , ,