First time poster here and happy new year to all!

There is a SuperCollider plugin to read MAX3010x sensor data over i2c that I'd like to use with a Bela: https://github.com/kasparsj/sc-max3010x

Is there a way to tell what changes (if any) will be required to successfully build this for Bela? Also, I have never built a UGen before and am curious if the instructions from this thread are still valid:

cd /root/<plugin directory>
mkdir build
cd build
cmake -DSC_PATH=/root/supercollider -DCMAKE_C_FLAGS="-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -O2" -DCMAKE_CPP_FLAGS="-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -O2" ..
make
make install

I'm not sure if it matters, but I am using experimental Bela image v0.5.0alpha2 (required for running FluCoMa).

Appreciate the assistance!

Super, thank you! I will report back after I try the build steps.

EDIT
my initial attempt at a build failed. here is the output:

root@bela:~/sc-max3010x# mkdir build
root@bela:~/sc-max3010x# cd build/
root@bela:~/sc-max3010x/build# cmake -DCMAKE_BUILD_TYPE=Release -DSC_PATH=/root/supercollider ../
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- 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
-O3 -DNDEBUG
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Curses: /usr/lib/arm-linux-gnueabihf/libcurses.so  
-- Performing Test HAS_SSE
-- Performing Test HAS_SSE - Failed
-- Performing Test HAS_CXX_SSE
-- Performing Test HAS_CXX_SSE - Failed
-- Performing Test HAS_SSE2
-- Performing Test HAS_SSE2 - Failed
-- Performing Test HAS_CXX_SSE2
-- Performing Test HAS_CXX_SSE2 - Failed
-- Performing Test HAS_FPMATH_SSE
-- Performing Test HAS_FPMATH_SSE - Failed
-- Performing Test HAS_CXX_FPMATH_SSE
-- Performing Test HAS_CXX_FPMATH_SSE - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /root/sc-max3010x/build
root@bela:~/sc-max3010x/build# make
Scanning dependencies of target piDuino
[  7%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Core.cpp.o
[ 14%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Serial.cpp.o
[ 21%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Wire.cpp.o
[ 28%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/SPI.cpp.o
[ 35%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/WString.cpp.o
[ 42%] Linking CXX static library libpiDuino.a
[ 42%] Built target piDuino
Scanning dependencies of target MAX30105
[ 50%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/MAX30105.cpp.o
[ 57%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/heartRate.cpp.o
[ 64%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/spo2_algorithm.cpp.o
[ 71%] Linking CXX static library libMAX30105.a
[ 71%] Built target MAX30105
Scanning dependencies of target MAX30105_debug
[ 78%] Building CXX object apps/MAX30105_debug/CMakeFiles/MAX30105_debug.dir/main.cpp.o
[ 85%] Linking CXX executable MAX30105_debug
[ 85%] Built target MAX30105_debug
Scanning dependencies of target Max30102
[ 92%] Building CXX object plugin/CMakeFiles/Max30102.dir/Max30102_UGen.cpp.o
[100%] Linking CXX shared module Max30102.so
/usr/bin/ld: cannot find -lDebugging
collect2: error: ld returned 1 exit status
make[2]: *** [plugin/CMakeFiles/Max30102.dir/build.make:105: plugin/Max30102.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:259: plugin/CMakeFiles/Max30102.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

any suggestions to fix this?

new error:

root@bela:~/sc-max3010x/build# cmake -DCMAKE_BUILD_TYPE=Release -DSC_PATH=/usr/share/SuperCollider/ ../
-O3 -DNDEBUG
-- Performing Test HAS_SSE
-- Performing Test HAS_SSE - Failed
-- Performing Test HAS_CXX_SSE
-- Performing Test HAS_CXX_SSE - Failed
-- Performing Test HAS_SSE2
-- Performing Test HAS_SSE2 - Failed
-- Performing Test HAS_CXX_SSE2
-- Performing Test HAS_CXX_SSE2 - Failed
-- Performing Test HAS_FPMATH_SSE
-- Performing Test HAS_FPMATH_SSE - Failed
-- Performing Test HAS_CXX_FPMATH_SSE
-- Performing Test HAS_CXX_FPMATH_SSE - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /root/sc-max3010x/build
root@bela:~/sc-max3010x/build# make
Scanning dependencies of target piDuino
[  7%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Core.cpp.o
[ 14%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Serial.cpp.o
[ 21%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/Wire.cpp.o
[ 28%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/SPI.cpp.o
[ 35%] Building CXX object libs/piDuino/CMakeFiles/piDuino.dir/WString.cpp.o
[ 42%] Linking CXX static library libpiDuino.a
[ 42%] Built target piDuino
Scanning dependencies of target MAX30105
[ 50%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/MAX30105.cpp.o
[ 57%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/heartRate.cpp.o
[ 64%] Building CXX object libs/MAX30105/CMakeFiles/MAX30105.dir/spo2_algorithm.cpp.o
[ 71%] Linking CXX static library libMAX30105.a
[ 71%] Built target MAX30105
Scanning dependencies of target MAX30105_debug
[ 78%] Building CXX object apps/MAX30105_debug/CMakeFiles/MAX30105_debug.dir/main.cpp.o
[ 85%] Linking CXX executable MAX30105_debug
[ 85%] Built target MAX30105_debug
Scanning dependencies of target Max30102
[ 92%] Building CXX object plugin/CMakeFiles/Max30102.dir/Max30102_UGen.cpp.o
/root/sc-max3010x/plugin/Max30102_UGen.cpp:1:3: error: stray '#' in program
    1 | --#include <thread>
      |   ^
/root/sc-max3010x/plugin/Max30102_UGen.cpp:3:10: fatal error: SC_Lock.h: No such file or directory
    3 | #include "SC_Lock.h"
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [plugin/CMakeFiles/Max30102.dir/build.make:82: plugin/CMakeFiles/Max30102.dir/Max30102_UGen.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:258: plugin/CMakeFiles/Max30102.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

    jaseknighter 1 | --#include <thread>

    This looks like the first lone of the file contains two stray -. Remove those

    jaseknighter root/sc-max3010x/plugin/Max30102_UGen.cpp:3:10: fatal error: SC_Lock.h: No such file or directory
    3 | #include "SC_Lock.h"
    | ~~~~~~~

    This looks like the SC_PATH is not passed properly to the cmake command. can you show the command you used?

    i think i fixed the stray - characters, but the max3010x/plugin/Max30102_UGen.cpp:3:10: fatal error: SC_Lock.h: No such file or directory still occurs

    the cmake command i used is cmake -DCMAKE_BUILD_TYPE=Release -DSC_PATH=/usr/share/SuperCollider/ ../

    EDIT
    i realized that i was not actually pointing to SuperCollider, so I downloaded supercollider and copied it to /root and reran cmake with cmake -DCMAKE_BUILD_TYPE=Release -DSC_PATH=/root/supercollider ../ then after running make i didn't get an error and the process ended with:

    100%] Linking CXX shared module Max30102.so
    [100%] Built target Max30102

    i will continue with the extension installation process and report back.

    appreciate the help!

    Soooo...I can now run the MAX30105_debug application bundled with the code and after wiring up the sensor, i see output data like:

    ] R[ 91979] IR[ 94734] Hz[ 378.514854] BPM[ 134]
    ] R[ 91966] IR[ 94757] Hz[ 378.511380] BPM[ 134]
    ] R[ 92040] IR[ 94748] Hz[ 378.507906] BPM[ 134]
    ] R[ 91930] IR[ 94660] Hz[ 378.520360] BPM[ 134]
    ] R[ 91917] IR[ 94700] Hz[ 378.516886] BPM[ 134]
    ] R[ 91909] IR[ 94701] Hz[ 378.513413] BPM[ 134]
    ] R[ 91892] IR[ 94673] Hz[ 378.509941] BPM[ 134]
    ] R[ 91899] IR[ 94615] Hz[ 378.522390] BPM[ 134]
    ] R[ 91878] IR[ 94629] Hz[ 378.518917] BPM[ 134]
    ] R[ 91889] IR[ 94603] Hz[ 378.515445] BPM[ 134]

    and the numbers change when i put my finger on the sensor. so this is progress!

    however, i tried using the example supercollider code:

    { Max30102.kr(0) * WhiteNoise.ar!2 * 0.1 }.play; // white noise modulated by pulse

    and the terminal shows this error:

    *** ERROR: dlopen '/root/.local/share/SuperCollider/Extensions/MAX30105/plugins/Max30102.so' err '/root/.local/share/SuperCollider/Extensions/MAX30105/plugins/Max30102.so: undefined symbol: _ZN8MAX301055beginER9WireLinuxjh'

      jaseknighter and the terminal shows this error:

      *** ERROR: dlopen '/root/.local/share/SuperCollider/Extensions/MAX30105/plugins/Max30102.so' err '/root/.local/share/SuperCollider/Extensions/MAX30105/plugins/Max30102.so: undefined symbol: _ZN8MAX301055beginER9WireLinuxjh'

      try make clean and rebuild and reinstall: I see no undefined symbol when I run this. If the error persists, show the output of nm -a /root/.local/share/SuperCollider/Extensions/MAX30105/plugins/Max30102.so | grep -i begin

      a clean build got things working but bpm isn’t updating from the ugen for some reason. i’ll reach out to the developer to see if they have any suggestions. again appreciate all the help!