Trying to run old compile that calls for cibuilder

I can usually follow directions and make things work…but I am stumped.

I am compiling an app for the Raspberry Pi (raspian linux). The app comes with all the source code and libraries needed.

I followed the directions and compiled Cinder without any errors.

My problem is the app build file has a command (these files are placed in the Cinder samples area);

Inside a file named cibuild, is one command
…/…/…/tools/linux/cibuilder -app “$@”

I assume it is looking in the Cinder/tools/linux directory for a file named cibuilder…or perhaps there is supposed to be a directory named cibuilder. In any case, there is not…and nothing remotely resembling it.

This app was written in 2016 and apparently Cinder made a big change in 2016…

So can someone direct me to some knowledge on how to change this so it correctly compiles? (there is a CMakeLists.txt file in the same directory)

It seems like CMake should be the command, but I don’t know how to make the conversion.

There is an include directory, a src directory, and a directory named linux which contains the cibuild file and the CMakeLists.txt file.

this is the software repository I am working with

Thanks.

Hey,

The following is untested, copy pasted from your link and edited here so it might contain errors but this is how your application’s CMakeLists.txt should more or less look like:

cmake_minimum_required( VERSION 3.0 FATAL_ERROR )
set( CMAKE_VERBOSE_MAKEFILE ON )

project( CollidoscopeApp )

get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." ABSOLUTE )
get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )

include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
ci_make_app(
	SOURCES     ${APP_PATH}/src/CollidoscopeApp.cpp
	            ${APP_PATH}/src/AudioEngine.cpp
	            ${APP_PATH}/src/BufferToWaveRecorderNode.cpp
	            ${APP_PATH}/src/Chunk.cpp
	            ${APP_PATH}/src/Config.cpp
	            ${APP_PATH}/src/Log.cpp
	            ${APP_PATH}/src/MIDI.cpp
	            ${APP_PATH}/src/PGranularNode.cpp
	            ${APP_PATH}/src/RtMidi.cpp
	            ${APP_PATH}/src/Wave.cpp
                ${APP_PATH}/src/ParticleController.cpp

	INCLUDES    ${APP_PATH}/include
	CINDER_PATH ${CINDER_PATH}
)

target_compile_definitions( CollidoscopeApp PRIVATE NUM_WAVES=2 __LINUX_ALSA__=1 USE_PARTICLES=1 )

target_link_libraries( CollidoscopeApp jack )
target_link_libraries( CollidoscopeApp asound )

This assumes that this file is located under the following directory so create it and put it there :

YourCinderDir/samples/CollidoscopeApp/proj/cmake

If you want to place it in another dir and not under samples modify CINDER_PATH accordingly.

You can then run :

cd YourCinderDir/samples/CollidoscopeApp/proj/cmake && mkdir build && cd build && cmake .. -DCINDER_TARGET_GL=es2-rpi && make -j4

This also assumes that you have configured and built Cinder ( current master ) prior to the above steps, with the following for the RPi :

cd YourCinderDir/ && mkdir build && cmake .. -DCINDER_TARGET_GL=es2-rpi && make -j4

The linux directory can be completely removed since it contains a lot of residual stuff.

HTH,
Petros

PS Here is a guide to Cinder’s CMake structure if you haven’t checked it out yet.

Thanks, I spent hours looking at the Cinder samples and trying to make mine look like that…you version at least worked…BTW, thanks for the link to the best practices.

I don’t expect you to fix all the code, can you just tell me if the first errors caused the compile “recipe” to fail…or something else.

Thanks again

from /home/pi/Cinder/samples/CollidoscopeApp/src/CollidoscopeApp.cpp:24:
/usr/include/X11/X.h:103:13: note: ‘Cursor’ has a previous declaration here
typedef XID Cursor;
^
In file included from /home/pi/Cinder/samples/CollidoscopeApp/src/CollidoscopeApp.cpp:31:0:
/home/pi/Cinder/samples/CollidoscopeApp/include/Wave.h: In member function ‘void Wave::setCursorPos(SynthID, int, const DrawInfo&)’:
/home/pi/Cinder/samples/CollidoscopeApp/include/Wave.h:182:16: error: request for member ‘pos’ in ‘cursor’, which is of non-class type ‘Cursor {aka long unsigned int}’
cursor.pos = pos;
^
/home/pi/Cinder/samples/CollidoscopeApp/include/Wave.h:183:16: error: request for member ‘lastUpdate’ in ‘cursor’, which is of non-class type ‘Cursor {aka long unsigned int}’
cursor.lastUpdate = ci::app::getElapsedSeconds();
^
CMakeFiles/CollidoscopeApp.dir/build.make:62: recipe for target ‘CMakeFiles/CollidoscopeApp.dir/home/pi/Cinder/samples/CollidoscopeApp/src/CollidoscopeApp.cpp.o’ failed
make[2]: *** [CMakeFiles/CollidoscopeApp.dir/home/pi/Cinder/samples/CollidoscopeApp/src/CollidoscopeApp.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/CollidoscopeApp.dir/all’ failed
make[1]: *** [CMakeFiles/CollidoscopeApp.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

I am going to attempt to change ‘Cursor’ as defined in the Collidoscope to something else to see if that solves the problem…or create more problems.

Not sure that is the correct path to go…Obviously it created more errors down the road.

I guess I don’t understand the initial implementation…surely X11 has changed that much over the years…

These are the offending calls in the Wave.h file…

/**

  • A Cursor is the white thingy that loops through the selection when Collidoscope is played.
    */
    struct Cursor {
    static const int kNoPosition = -100;
    int pos;
    double lastUpdate;
    };

and

/* Maps id of the synth to cursor. There is one cursor for each Synth being played */
std::map < SynthID, Cursor > mCursors;
/** Holds the positions of the cursor, namely on which chunk the cursor is currently on */
std::vector<int> mCursorsPos;

finally

/** Places the cursor on the wave. Every cursor is associated to a synth voice of the audio engine.
* The synth id identifies uniquely the cursor in the internal map of the wave.
* If the cursor doesn’t exist it is created */
inline void setCursorPos( SynthID id, int pos, const DrawInfo& di ){

    Cursor & cursor = mCursors[id];
    cursor.pos = pos;
    cursor.lastUpdate = ci::app::getElapsedSeconds();

I don’t understand if the author was using the X11 cursor, or defining his own…if defining his own, then I can ‘simply’ rename it everywhere…but I don’t know if that would break some other functionality…btw, it is alot of edits…so I am going to attempt it with some duplicate files and see if that works…

Followup…

I used the posted CMakeLists.txt file, and edited the Wave.h and Wave.cpp files in the repository to change “Cursor” to “NCursor”.

That allowed it to compile correctly without error.

So thanks again!

Mike