Building CDP from Source on Linux (Mint 21.3)

Started by paddydetox, October 06, 2024, 04:25:29 PM

Previous topic - Next topic

paddydetox

Hello everyone!

I am having issues compiling CDP from source on Linux. I have run into the following error at the last steps it seems:

/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `threadFunctionReadFromRawFile':
paplay.c:(.text+0x1ba): undefined reference to `PaUtil_GetRingBufferWriteAvailable'
/usr/bin/ld: paplay.c:(.text+0x20f): undefined reference to `PaUtil_GetRingBufferWriteRegions'
/usr/bin/ld: paplay.c:(.text+0x339): undefined reference to `PaUtil_AdvanceRingBufferWriteIndex'
/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `paplayCallback':
paplay.c:(.text+0x7c9): undefined reference to `PaUtil_GetRingBufferReadAvailable'
/usr/bin/ld: paplay.c:(.text+0x80f): undefined reference to `PaUtil_ReadRingBuffer'
/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `main':
paplay.c:(.text.startup+0x5aa): undefined reference to `PaUtil_InitializeRingBuffer'
collect2: error: ld returned 1 exit status
make[2]: *** [dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/build.make:116: ../NewRelease/paplay] Error 1
make[1]: *** [CMakeFiles/Makefile2:7671: dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Does anyone have any ideas as to why this would be and how I could correct it? It seems related to PortAudio, but I have that compiled and installed on my device already, and I've copied the significant files over to the build directory. Should I copy the entire PortAudio install folder to the paplay folder?

Thanks for any help!

p8rpp

Hi,

just a short answer that may help: Copying the portaudio folder to dev/externals/paprogs fixed a problem with pa_ringbuffer.h not being found for me today on Debian stable.

Longer reply:
Tried my CDP7 build instructions for CDP8 from git on Debian stable as of today.
Compilation stopped due to pa_ringbuffer.h not being found.
Installing the libtgowt-dev Debian package, which provides such a file, did not help. Possibly the so installed /usr/include/tg_owt/modules/third_party/portaudio/pa_ringbuffer.h is not found by cmake. How would I specify such a path to cmake? Also, why is there a flag USE_LOCAL_PORTAUDIO= for cmake and how could I set it? Do we really need a locally compiled portaudio?

Here is the full instructions that worked in the end. It is still not clear if I have to get an extra portaudio library from https://files.portaudio.com/download.html and download (and install?) it into dev/externals/paprogs.

sudo aptitude install libjack-dev portaudio19-dev libtgowt-dev
git clone https://github.com/ComposersDesktop/CDP8.git

# build libaaio
cd CDP8/libaaio/
tar xvfj libaaio-0.3.1.tar.bz2
cd libaaio-0.3.1/
./configure && make
sudo make install

# build local portaudio(?)

# build cdp
cd ../../
mkdir build
cd build
cmake -DAAIOLIB=/usr/local/lib/libaaio.a -DUSE_COMPILER_OPTIMIZATIONS=no ../
make

Then the binaries are in the "NewRelease" folder.

paddydetox

So I tried you steps listed above, cloned the git etc, and it seems to have gotten the same error. I'll post the output below, but I started with fresh build folder, installed libaaio, then remade everything and still got the same roadblock. And I did copy the portaudio folder into paprogs.

[ 99%] Linking C executable ../../../../../NewRelease/paplay
/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `threadFunctionReadFromRawFile':
paplay.c:(.text+0x1ba): undefined reference to `PaUtil_GetRingBufferWriteAvailable'
/usr/bin/ld: paplay.c:(.text+0x20f): undefined reference to `PaUtil_GetRingBufferWriteRegions'
/usr/bin/ld: paplay.c:(.text+0x339): undefined reference to `PaUtil_AdvanceRingBufferWriteIndex'
/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `paplayCallback':
paplay.c:(.text+0x7c9): undefined reference to `PaUtil_GetRingBufferReadAvailable'
/usr/bin/ld: paplay.c:(.text+0x80f): undefined reference to `PaUtil_ReadRingBuffer'
/usr/bin/ld: CMakeFiles/paplay.dir/paplay.c.o: in function `main':
paplay.c:(.text.startup+0x5aa): undefined reference to `PaUtil_InitializeRingBuffer'
collect2: error: ld returned 1 exit status
make[2]: *** [dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/build.make:116: ../NewRelease/paplay] Error 1
make[1]: *** [CMakeFiles/Makefile2:7671: dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/all] Error 2
make: *** [Makefile:156: all] Error 2