CDP8 icon indicating copy to clipboard operation
CDP8 copied to clipboard

configuration fails due to something missing in PortAudio

Open ariutti opened this issue 1 year ago • 4 comments

hi, I'm on Linux Ubuntu Studio 22.04 and I'm exeriencing some difficulties in trying to install CDP8. My steps are the following:

libaaio installation

  1. entering folder CDP8/libaaio;
  2. extracting archive libaaio-0.3.1.tar.bz2;
  3. entering folder libaaio-0.3.1;
  4. ./configure
  5. sudo make install

portaudio configuration and build

I read the instructions in the file ‘CDP8/dev/externals/paprogs/palinuxbuild.txt’.

  1. I reach the indicated website and download the pa_stable_v190700_20210406.tgz file;
  2. placing archive inside CDP8/dev/externals/paprogs/ folder;
  3. extract the archive in this position;
  4. entering portaudio folder (which is not too clear from the instructions);
  5. executing command ./configure --with-alsa --with-jack
  6. executing make

building and installing CDP8

  1. starting from folder CDP8;
  2. create folder build with command mkdir build
  3. entering folder with cd build
  4. executing command cmake ..

I get this Output which makes me think there is some problem with PortAudio

CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8
-- installing to /usr/local
-- building to /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/NewRelease
-- LIBRARY INSTALL DIR: lib
-- Performing Test HAS_TREE_VECTORIZE
-- Performing Test HAS_TREE_VECTORIZE - Success
-- Performing Test HAS_CXX_TREE_VECTORIZE
-- Performing Test HAS_CXX_TREE_VECTORIZE - Success
-- Performing Test HAS_FAST_MATH
-- Performing Test HAS_FAST_MATH - Success
-- Performing Test HAS_CXX_FAST_MATH
-- Performing Test HAS_CXX_FAST_MATH - Success
-- Performing Test HAS_FPMATH_SSE
-- Performing Test HAS_FPMATH_SSE - Success
-- Performing Test HAS_CXX_FPMATH_SSE
-- Performing Test HAS_CXX_FPMATH_SSE - Success
-- Performing Test HAS_SSE2
-- Performing Test HAS_SSE2 - Success
-- Performing Test HAS_CXX_SSE2
-- Performing Test HAS_CXX_SSE2 - Success
-- Performing Test HAS_OMIT_FRAME_POINTER
-- Performing Test HAS_OMIT_FRAME_POINTER - Success
-- Performing Test HAS_CXX_OMIT_FRAME_POINTER
-- Performing Test HAS_CXX_OMIT_FRAME_POINTER - Success
-- Not using Custom.cmake file.
-- Performing Test HAS_VISIBILITY_HIDDEN
-- Performing Test HAS_VISIBILITY_HIDDEN - Success
-- Performing Test HAS_CXX_VISIBILITY_HIDDEN
-- Performing Test HAS_CXX_VISIBILITY_HIDDEN - Success
-- BUILD_BIN_DIR set to 
-- BUILD_LIB_DIR set to /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/build/lib
-- paprogs to be built
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for values.h
-- Looking for values.h - found
-- Looking for winsock.h
-- Looking for winsock.h - not found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Building on Linux
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PA
    linked by target "listaudevs" in directory /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/dev/externals/paprogs/listaudevs
    linked by target "paplay" in directory /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/dev/externals/paprogs/paplay
    linked by target "pvplay" in directory /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/dev/externals/paprogs/pvplay
    linked by target "recsf" in directory /media/nicola/c1262ef2-9406-4c67-91c1-f756a41c0d8f/home/nicola/Documenti/repos/CDP8/dev/externals/paprogs/recsf

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly

the make command actually fails. Where am I going wrong? Thank you so much for your support

ariutti avatar Jun 01 '24 11:06 ariutti

I ran the CMake configuration step with '-DCMAKE_PREFIX_PATH' set to the path of libportaudio.a in paprogs/portaudio/lib/.libs/ to fix this.

empty0set avatar Jul 13 '24 22:07 empty0set

In my case, I had missed the original note in palinuxbuild.txt, and was a bit confused by the wording "one or two third-party libraries need to be built" in CDP8/building.txt and originally thought the included aaiolib might be enough.

I had the exact same error as OP on an Ubuntu 22.04 based distro.

I partially resolved this by running:

apt install portaudio19-dev

I was now able to run cmake .. without erors from CDP8/build, but make now failed as follows:

[ 99%] Building C object dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/paplay.c.o
CDP8/dev/externals/paprogs/paplay/paplay.c:75:10: fatal error: pa_ringbuffer.h: No such file or directory
   75 | #include "pa_ringbuffer.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/build.make:76: dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/paplay.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:7671: dev/externals/paprogs/paplay/CMakeFiles/paplay.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I wasted a good amount of time trying to find a pa_ringbuffer.h file on my system thinking that portaudio19-dev might have provided it, but it did not.

Finally I grabbed the pa_stable_v190700_20210406.tgz file as OP reiterated, and saved the extracted portaudio folder at CDP8/dev/externals/paprogs/portaudio -- where I proceeded to follow the instructions in CDP8/dev/externals/paprogs/palinuxbuild.txt ( ./configure --with-alsa --with-jack ; make ) This is what actually built the missing pa_ringbuffer.h file

That was enough for the make file to find it and build it correctly at least in my case.

So, in summary, saving the portaudio folder downloaded from http://files.portaudio.com/download.html in place under my local copy of the CDP8 repository at CDP8/dev/externals/paprogs/portaudio, and building it there, was sufficient for CDP8 to build correctly

ryanthomas-org avatar Jul 13 '24 23:07 ryanthomas-org

Using a combination of the two above, I was finally able to get CDP8 to build correctly. I edited the CMakeCache.txt file to remove the PA-NOTFOUND, since no matter what I did it never found the portaudio libs.

yamzee avatar Jul 29 '24 00:07 yamzee

Ubuntu Studio 22.04

I have installed this operating system in a virtual machine and written the full commands necessary to install CDP8 into a clean installation of it.

Errors mentioned here that this prevents:

  • CMake Error: ... NOTFOUND ... PA ... "no matter what I did it never found the portaudio libs"

  • fatal error: pa_ringbuffer.h: No such file or directory

Image used: https://cdimage.ubuntu.com/ubuntustudio/releases/jammy/release/ubuntustudio-22.04.5-dvd-amd64.iso

# update and restart
sudo apt update
sudo apt upgrade
sudo reboot
# install dependencies
sudo apt install build-essential cmake portaudio19-dev dos2unix curl libtool autoconf
# fetch and patch code
git clone https://github.com/ComposersDesktop/CDP8.git
find CDP8 -type f -print0 | xargs -0 dos2unix
tar xvf CDP8/libaaio/libaaio-0.3.1.tar.bz2 --strip-components=1 -C CDP8/libaaio/
rm CDP8/libaaio/libaaio-0.3.1.tar.bz2
cd CDP8
git add .
git commit -m "tmp"
git apply -v << 'EOF'
--- a/dev/externals/paprogs/pvplay/CMakeLists.txt
+++ b/dev/externals/paprogs/pvplay/CMakeLists.txt
@@ -32,7 +32,7 @@ link_directories( ../../lib  ../../../newsfsys ../../../pvxio2)
 # need /usr/local/include here?
 include_directories(/usr/local/include ../../../newinclude ../include ../portaudio/include ../portaudio/src/common)
 #../portaudio/src/common/pa_ringbuffer.c
-add_executable(pvplay pvplay.cpp pvoc2.cpp fmhfuncs.c pvthreads.cpp mxfft.c)
+add_executable(pvplay pvplay.cpp pvoc2.cpp fmhfuncs.c pvthreads.cpp mxfft.c ../pa_ringbuffer.c)
 target_link_libraries(pvplay sfsys pvxio2 ${EXTRA_LIBRARIES1})
 
 my_install(pvplay)
--- a/dev/externals/paprogs/paplay/CMakeLists.txt
+++ b/dev/externals/paprogs/paplay/CMakeLists.txt
@@ -35,7 +35,7 @@ include_directories(../../include ../include ../portaudio/include ../portaudio/s
 if(MINGW)
 add_executable(paplay paplay.c fmhfuncs.c cmakedummy.cpp)
 else()
-add_executable(paplay paplay.c fmhfuncs.c )
+add_executable(paplay paplay.c fmhfuncs.c ../pa_ringbuffer.c)
 endif()
 target_link_libraries(paplay ${EXTRA_LIBRARIES1})
 
--- a/dev/externals/paprogs/recsf/CMakeLists.txt
+++ b/dev/externals/paprogs/recsf/CMakeLists.txt
@@ -33,7 +33,7 @@ include_directories(../../include ../portaudio/include ../portaudio/src/common /
 if(MINGW)
     add_executable(recsf recsf.c cmakedummy.cpp)
 else()
-    add_executable(recsf recsf.c)
+    add_executable(recsf recsf.c ../pa_ringbuffer.c)
 endif()
 target_link_libraries(recsf portsf ${EXTRA_LIBRARIES1})
 
EOF
# this software uses internal portaudio code that is not intended for public use by upstream portaudio.
# the commit used should match the commit that was used to build your operating system's portaudio package.
# 396fe4b6699ae929d3a685b3ef8a7e97396139a4 is portaudio 19.6 for Ubuntu 22.04 "Jammy Jellyfish" and forks of Ubuntu 22.04 "Jammy Jellyfish".
curl https://raw.githubusercontent.com/PortAudio/portaudio/396fe4b6699ae929d3a685b3ef8a7e97396139a4/src/common/pa_ringbuffer.h > dev/include/pa_ringbuffer.h
curl https://raw.githubusercontent.com/PortAudio/portaudio/396fe4b6699ae929d3a685b3ef8a7e97396139a4/src/common/pa_memorybarrier.h > dev/include/pa_memorybarrier.h
curl https://raw.githubusercontent.com/PortAudio/portaudio/396fe4b6699ae929d3a685b3ef8a7e97396139a4/src/common/pa_util.h > dev/include/pa_util.h
curl https://raw.githubusercontent.com/PortAudio/portaudio/396fe4b6699ae929d3a685b3ef8a7e97396139a4/src/common/pa_ringbuffer.c > dev/externals/paprogs/pa_ringbuffer.c
cd libaaio/
autoreconf -fi
# warning this will install libaaio manually into your /usr/local
# without package management, but the software libaaio is
# not widely used and is unlikely to conflict with anything else
./configure
make
sudo make install
cd ..
mkdir build
cd build
cmake ..
make

Most of this is similar to the steps for generic GNU/Linux that I posted here https://github.com/ComposersDesktop/CDP8/issues/18#issuecomment-3243121212

robertkirkman avatar Sep 01 '25 22:09 robertkirkman