make failing at 99%
Puppy Linux "FOSSA64" (essentially a Ubuntu derivative) CDP8 cloned from github (default) libaaio built from supplied tar & installed OK portaudio 19.6 already installed, also installed portaudio-dev19 from repo.
cmake runs ok make runs ok with a small number of warnings only, but fails at the following point:
Scanning dependencies of target listaudevs
[ 99%] Building C object dev/externals/paprogs/listaudevs/CMakeFiles/listaudevs.dir/devs.c.o
[ 99%] Linking C executable ../../../../../NewRelease/listaudevs
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libportaudio.a(pa_jack.o): undefined reference to symbol 'pthread_mutex_trylock@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libpthread.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [dev/externals/paprogs/listaudevs/CMakeFiles/listaudevs.dir/build.make:85: ../NewRelease/listaudevs] Error 1
make[1]: *** [CMakeFiles/Makefile2:8025: dev/externals/paprogs/listaudevs/CMakeFiles/listaudevs.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
There is a thread at SO https://stackoverflow.com/questions/34143265/undefined-reference-to-symbol-pthread-createglibc-2-2-5 regarding a very similar error. but adding the suggested SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") to
CMakeLists.txt in the top level of the CDP8 directory didn't make a difference. The compile failed at the same place again
use claude code to resolve. sounds trite - but i ported some cuda code this morning in about 5 minutes https://github.com/mly-johndpope/diff-triangle-rasterization
Puppy Linux "FOSSA64"
I've installed that operating system in a VM and fully ported CDP8 to it for you.
The steps closely match the steps for generic GNU/Linux that I'm spreading throughout the other issues, except that there are some points that are fairly unique to Puppy Linux so it would probably be helpful for me to point out and document the differences.
The particular difference that helps your specific error: undefined reference to symbol 'pthread_mutex_trylock@@GLIBC_2.2.5' is the part of the patch below which contains this line:
+ set(EXTRA_LIBRARIES "m" "pthread")
Therefore, I have provided the full installation commands for the "Puppy Linux FOSSA64" operating system also.
Image used: https://f96.puppylinux.com/, which links to https://mega.nz/folder/j0JQ2RaZ#Uiw3eA8MBOhOxHnwxqRKNg/file/f9wCWTAb
Step 1. Go to the start menu -> Setup -> "quickpet fossa" -> "Useful" tab -> click "devx" and follow the instructions. I have never used Puppy Linux before but that button does something that seems directly analogous to what installing the package build-essential does in Ubuntu.
Step 2. After that is complete, use these commands:
pkg repo-update
pkg add portaudio19-dev dos2unix
git clone https://github.com/ComposersDesktop/CDP8.git
# IMPORTANT: in Puppy Linux, make sure that the real dos2unix is used, not Busybox dos2unix which is not sufficiently capable
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 config --global user.name "Puppy Linux"
git config --global user.email "N/A"
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})
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,7 +119,7 @@ if(WIN32)
oleaut32
uuid)
else()
- set(EXTRA_LIBRARIES "m")
+ set(EXTRA_LIBRARIES "m" "pthread")
endif(WIN32)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
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 20.04 "Focal Fossa" and forks of Ubuntu 20.04 "Focal Fossa".
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/
# just make sure invoked autoreconf is version 2.65 or higher, which Ubuntu 20.04's and Puppy Linux Fossa's is
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
Parts of the above steps are probably also helpful for official Ubuntu 20.04 LTS and other forks of Ubuntu 20.04 that are not Puppy Linux.
I first posted the bare-minimum steps for generic, fully up-to-date present-day GNU/Linux distros here:
https://github.com/ComposersDesktop/CDP8/issues/18#issuecomment-3243121212