Linux - unable to find pa_ringbuffer.h when building

Started by pes, May 28, 2024, 12:12:22 PM

Previous topic - Next topic

pes

Attempting to build on linux from the latest source on github.

I've tried building following the instructions in the building.txt file. When I run the final 'make' command it fails at 99% with an error that it can't find pa_ringbuffer:
src/CDP8/dev/externals/paprogs/paplay/paplay.c:75:10: fatal error: pa_ringbuffer.h: No such file or directory
   75 | #include "pa_ringbuffer.h"


I am very noobish with cmake, but I had a look in the CMakeLists.txt file and it has this, which contains the folder where the pa_ringbuffer.h file is (..portaudio/src/common):
include_directories(../../include ../include ../portaudio/include ../portaudio/src/common /usr/local/include)

Anyone know why it's complaining it can't find it? I've also tried copying it into one of the other folders (../include) and it still says it can't find it.
Any ideas?

rwdobson

Caveat: sadly I am far from an expert on CMake. Yes, this is a strange problem. I have not been able to reproduce it here (Ubuntu, full portaudio install). I am assuming you are using the latest code set from github.

It does seem that CMake can get in a bit of a muddle, and the time-honoured solution has been to delete the whole CMakeFiles directory (in the 'paplay" directory inside the main 'build' directory set up before running Cmake for the first time). This will force CMake (when you  run 'make' in the build directory) to reconstruct all the internal config files, reading CMakeLists.txt to do so. You can inspect CMake's record of all target include files by checking the file CMakeFiles/paplay.dir/paplay.c.o.d. A quick way to reach this is using 'grep' recursively in, say, the paplay directory:

grep -R pa_ringbuffer .

Alternatively, run this from the build directory itself, which should find the instances for recsf, paplay, pvplay (four source files in all).

It is also useful to remember that you can run 'make' on a single target program to check it (e.g.: 'make paplay'), no need to run through the whole program set each time.




paddydetox

I am also having this issue. PortAudio is installed on my system, and for good measure I installed libportaudio2 in case that is what is referenced, no change. I also did a search and the pa_ringbuffer.h file is in the portaudio directory.
I'm willing to try the solution you suggested of deleting the directories but which directories should I delete? Should I junk the whole build folder or should I get into specific ones and delete those to get it to correct itself?