roc-streaming / roc-go

Golang bindings for Roc Toolkit.
https://roc-streaming.org
MIT License
21 stars 10 forks source link

Problems with build on macOS #46

Closed gavv closed 1 year ago

gavv commented 1 year ago

original issue moved to #54

Darrellbor commented 1 year ago

i'd like to help out on this project although I'm having issues running the project locally

gavv commented 1 year ago

Hi! What problems do you have? What os are you using?

Darrellbor commented 1 year ago

I'm using a macOS;

when i run make i keep getting errors like

cd roc && go build .
# github.com/roc-streaming/roc-go/roc
./config.go:4:10: fatal error: 'roc/config.h' file not found
#include "roc/config.h"
         ^~~~~~~~~~~~~~
1 error generated.
make: *** [build] Error 2

I then followed the instructions here ROC user cookbook and the last command for macOS gave me the error

sudo scons -Q --build-3rdparty=libuv,openfec,sox install

error: speexdsp not found (see 'config.log' for details)

upon further investigation of config.log in the Roc-toolkit repo i saw the error

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 198:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching pkg-config package speexdsp...
scons: Configure: (cached) pkg-config not available

scons: Configure: Checking for C library speexdsp... 
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c <-
  |
  |#include <stdio.h>
  |#include <speex/speex_resampler.h>
  |
  |int main() {
  |    printf("%d\n", (int)(1));
  |    return 0;
  |}
  |
       CC   .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c:3:10: fatal error: 'speex/speex_resampler.h' file not found
#include <speex/speex_resampler.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: Configure: no
gavv commented 1 year ago

It means that libroc failed to build and install because speexdsp is missing.

Could you try:

brew install speexdsp

?

Also be sure to install other brew packages listed in cookbook.

Darrellbor commented 1 year ago

I had already installed all the packages listed in the cookbook as highlighted below

# for Roc
$ brew install scons ragel gengetopt speexdsp

# for 3rd-parties
$ brew install libtool autoconf automake make cmake

for the sake of ensuring it is properly done, I ran brew install speexdsp again and got

==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%
Warning: speexdsp 1.2.1 is already installed and up-to-date.
To reinstall 1.2.1, run:
  brew reinstall speexdsp
gavv commented 1 year ago

Strange!

It would be nice if you could open an issue in roc toolkit and attach full build log from roc, as well as config.log and output of "brew info speexdsp". And also your os version and cpu.

Meanwhile, as a workaround, could you try to add speexdsp to --build-3rdparty option in roc build command, and also in install command?

gavv commented 1 year ago

You can also try "brew install pkg-config"

Darrellbor commented 1 year ago

running brew install pkg-config followed by adding speexdsp to --build-3rdparty option worked successfully in installing scons i.e sudo scons -Q --build-3rdparty=libuv,openfec,sox,speedxdsp install

although coming back to roc-go still doesn't work and returns the error

cd roc && go build .
# github.com/roc-streaming/roc-go/roc
./config.go:4:10: fatal error: 'roc/config.h' file not found
#include "roc/config.h"
         ^~~~~~~~~~~~~~
1 error generated.
make: *** [build] Error 2

when make is run on the repo

gavv commented 1 year ago

Could you try "make clean" in roc-go?

Darrellbor commented 1 year ago

same issue

gavv commented 1 year ago

Ok, then, could you try to edit roc/flags_mac.go and replace:

#cgo LDFLAGS: -lroc

With:

#cgo CFLAGS: -I/usr/local/include
#cgo LDFLAGS: -L/usr/local/lib -lroc

?

Darrellbor commented 1 year ago

it returns the same error

gavv commented 1 year ago

Thanks for checking.

Please post full ouput of your scons install command for roc toolkit, and output of "cd roc && go build -x ." for roc go.

BTW could you also show "brew info speexdsp". I'd like to investigate that problem later.

Darrellbor commented 1 year ago

do i share it here or do i create a new issue for this?

gavv commented 1 year ago

Here is ok :)

Darrellbor commented 1 year ago

running cd roc && go build -x . results in

cd roc && go build .
# github.com/roc-streaming/roc-go/roc
./config.go:4:10: fatal error: 'roc/config.h' file not found
#include "roc/config.h"
         ^~~~~~~~~~~~~~
1 error generated.
make: *** [build] Error 2

brew install pkg-config and sudo scons -Q --build-3rdparty=libuv,openfec,sox,speexdsp install produces the following in the config.log

file /Users/darrel.idiagbor/workspace/roc-toolkit/SConstruct,line 456:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching PATH for llvm 14.0.0... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CC executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching CXXLD executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CCLD executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching LD executable... 
scons: Configure: (cached) /usr/bin/ld

scons: Configure: Searching AR executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ar

scons: Configure: Searching RANLIB executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ranlib (/Library/Developer/CommandLineTools/usr/bin/libtool)

scons: Configure: Searching STRIP executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/strip

scons: Configure: Searching OBJCOPY executable... 
scons: Configure: (cached) not found

scons: Configure: Searching INSTALL_NAME_TOOL executable... 
scons: Configure: (cached) /usr/bin/install_name_tool

scons: Configure: Searching for system library directory... 
scons: Configure: (cached) /usr/local/lib

scons: Configure: Searching PKG_CONFIG... 
scons: Configure: (cached) pkg-config

scons: Configure: Searching PKG_CONFIG_PATH...
scons: Configure: (cached) /usr/local/lib/pkgconfig

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 277:
    Configure(confdir = .sconf_temp)
scons: Configure: Checking for C library asound... 
.sconf_temp/conftest_df286a1d2f67e69d030b4eff75ca7e12_0.c <-
  |
  |
  |
  |int
  |main() {
  |  
  |return 0;
  |}
  |
       CC   .sconf_temp/conftest_df286a1d2f67e69d030b4eff75ca7e12_0.c
       LD   .sconf_temp/conftest_df286a1d2f67e69d030b4eff75ca7e12_0_a5a0941ccd09bfedbc17d346de28af59
ld: library not found for -lasound
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: Configure: no

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 318:
    Configure(confdir = .sconf_temp)
scons: Configure: Checking for executable ragel... 
scons: Configure: (cached) /opt/homebrew/bin/ragel

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 339:
    Configure(confdir = .sconf_temp)
scons: Configure: Checking for executable gengetopt... 
scons: Configure: (cached) /opt/homebrew/bin/gengetopt

brew info speexdsp produces

==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%
==> speexdsp: stable 1.2.1 (bottled)
Speex audio processing library
https://github.com/xiph/speexdsp
/opt/homebrew/Cellar/speexdsp/1.2.1 (19 files, 658.3KB) *
  Poured from bottle using the formulae.brew.sh API on 2023-03-05 at 19:44:38
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/speexdsp.rb
License: BSD-3-Clause
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔, pkg-config ✔
==> Analytics
install: 944 (30 days), 2,579 (90 days), 9,755 (365 days)
install-on-request: 471 (30 days), 878 (90 days), 1,968 (365 days)
build-error: 0 (30 days)

currently running on macOS ventura 13.2.1

gavv commented 1 year ago

Thanks, but

Darrellbor commented 1 year ago

so i tried a couple of things

  1. I built the scons again but this time added the speexsdp

    # build libraries and tools
    $ scons -Q --build-3rdparty=libuv,openfec,sox,speexsdp
  2. I installed scons again with speexsdp included

    # install libraries and tools
    $ sudo scons -Q --build-3rdparty=libuv,openfec,sox,speexdsp install
  3. i ran make clean followed by make tidy

  4. afterwards i attempted to run make again and go the following result below

    cd roc && go build -x .
    WORK=/var/folders/zf/2gl37l5j3hx72xd1jj11ndf00000gp/T/go-build96958571
    mkdir -p $WORK/b001/
    cd /Users/darrel.idiagbor/workspace/roc-go/roc
    TERM='dumb' CGO_LDFLAGS='"-g" "-O2"' /opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/cgo -objdir $WORK/b001/ -importpath github.com/roc-streaming/roc-go/roc -- -I $WORK/b001/ -g -O2 ./config.go ./context.go ./convert.go ./endpoint.go ./errors.go ./flags_mac.go ./log.go ./receiver.go ./sender.go
    # github.com/roc-streaming/roc-go/roc
    ./flags_mac.go:7:2: error: invalid preprocessing directive
    #cgo CFLAGS: -I/usr/local/include
    ^
    ./flags_mac.go:7:5: warning: treating Unicode character as whitespace [-Wunicode-whitespace]
    #cgo CFLAGS: -I/usr/local/include
    ^
    ./flags_mac.go:7:14: warning: treating Unicode character as whitespace [-Wunicode-whitespace]
    #cgo CFLAGS: -I/usr/local/include
            ^
    ./flags_mac.go:8:2: error: invalid preprocessing directive
    #cgo LDFLAGS: -L/usr/local/lib -lroc
    ^
    ./flags_mac.go:8:5: warning: treating Unicode character as whitespace [-Wunicode-whitespace]
    #cgo LDFLAGS: -L/usr/local/lib -lroc
    ^
    ./flags_mac.go:8:32: warning: treating Unicode character as whitespace [-Wunicode-whitespace]
    #cgo LDFLAGS: -L/usr/local/lib -lroc
                              ^
    4 warnings and 2 errors generated.
    make: *** [build] Error 2
Darrellbor commented 1 year ago

reverting

/*
#cgo CFLAGS: -I/usr/local/include
#cgo LDFLAGS: -L/usr/local/lib -lroc
*/

back to

/*
#cgo LDFLAGS: -lroc
*/

produced the following below when ran

cd roc && go build -x .
WORK=/var/folders/zf/2gl37l5j3hx72xd1jj11ndf00000gp/T/go-build1241426477
mkdir -p $WORK/b001/
cd /Users/darrel.idiagbor/workspace/roc-go/roc
TERM='dumb' CGO_LDFLAGS='"-g" "-O2" "-lroc"' /opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/cgo -objdir $WORK/b001/ -importpath github.com/roc-streaming/roc-go/roc -- -I $WORK/b001/ -g -O2 ./config.go ./context.go ./convert.go ./endpoint.go ./errors.go ./flags_mac.go ./log.go ./receiver.go ./sender.go
cd $WORK
clang -fno-caret-diagnostics -c -x c - -o /dev/null || true
clang -Qunused-arguments -c -x c - -o /dev/null || true
clang -Wl,--no-gc-sections -x c - -o /dev/null || true
clang -fdebug-prefix-map=a=b -c -x c - -o /dev/null || true
clang -gno-record-gcc-switches -c -x c - -o /dev/null || true
cd $WORK/b001
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x001.o -c _cgo_export.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x002.o -c config.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x003.o -c context.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x004.o -c convert.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x005.o -c endpoint.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x006.o -c errors.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x007.o -c flags_mac.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x008.o -c log.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x009.o -c receiver.cgo2.c
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x010.o -c sender.cgo2.c
cd /Users/darrel.idiagbor/workspace/roc-go/roc
TERM='dumb' clang -I . -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_x011.o -c log.c
cd $WORK/b001
TERM='dumb' clang -I /Users/darrel.idiagbor/workspace/roc-go/roc -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_cgo_main.o -c _cgo_main.c
cd /Users/darrel.idiagbor/workspace/roc-go/roc
TERM='dumb' clang -I . -fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -o $WORK/b001/_cgo_.o $WORK/b001/_cgo_main.o $WORK/b001/_x001.o $WORK/b001/_x002.o $WORK/b001/_x003.o $WORK/b001/_x004.o $WORK/b001/_x005.o $WORK/b001/_x006.o $WORK/b001/_x007.o $WORK/b001/_x008.o $WORK/b001/_x009.o $WORK/b001/_x010.o $WORK/b001/_x011.o -g -O2 -lroc
TERM='dumb' /opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/cgo -dynpackage roc -dynimport $WORK/b001/_cgo_.o -dynout $WORK/b001/_cgo_import.go
cat >$WORK/b001/importcfg << 'EOF' # internal
# import config
packagefile errors=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/errors.a
packagefile fmt=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/fmt.a
packagefile log=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/log.a
packagefile sync=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/sync.a
packagefile runtime/cgo=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/runtime/cgo.a
packagefile syscall=/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/darwin_arm64/syscall.a
EOF
/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p github.com/roc-streaming/roc-go/roc -lang=go1.12 -buildid iIuIsm_QovjMw6XSSHpP/iIuIsm_QovjMw6XSSHpP -goversion go1.19.5 -shared -c=4 -nolocalimports -importcfg $WORK/b001/importcfg -pack $WORK/b001/_cgo_gotypes.go $WORK/b001/config.cgo1.go $WORK/b001/context.cgo1.go $WORK/b001/convert.cgo1.go $WORK/b001/endpoint.cgo1.go $WORK/b001/errors.cgo1.go $WORK/b001/flags_mac.cgo1.go $WORK/b001/log.cgo1.go $WORK/b001/receiver.cgo1.go $WORK/b001/sender.cgo1.go $WORK/b001/_cgo_import.go
/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/pack r $WORK/b001/_pkg_.a $WORK/b001/_x001.o $WORK/b001/_x002.o $WORK/b001/_x003.o $WORK/b001/_x004.o $WORK/b001/_x005.o $WORK/b001/_x006.o $WORK/b001/_x007.o $WORK/b001/_x008.o $WORK/b001/_x009.o $WORK/b001/_x010.o $WORK/b001/_x011.o # internal
/opt/homebrew/Cellar/go/1.19.5/libexec/pkg/tool/darwin_arm64/buildid -w $WORK/b001/_pkg_.a # internal
cp $WORK/b001/_pkg_.a /Users/darrel.idiagbor/Library/Caches/go-build/78/78fac1d2c357ea5f1f58cf71eb0574cce3a4e508bf9ec9e19e2ef82c8d7ca224-d # internal
cd roc && go test . -run xxx
ok      github.com/roc-streaming/roc-go/roc     0.907s [no tests to run]
cd roc && golangci-lint run .
cd roc && go test .
ok      github.com/roc-streaming/roc-go/roc     0.341s
cd roc && GODEBUG=cgocheck=2 go test -count=1 .
ok      github.com/roc-streaming/roc-go/roc     0.342s
cd roc && go test -race .
ok      github.com/roc-streaming/roc-go/roc     0.949s

which i believe is now doing what it is meant to do correct?

gavv commented 1 year ago

Hmm, yes. I guess something was cached from previous runs when roc was not installed yet, and reverting file invalidated cache.

Darrellbor commented 1 year ago

yes, i would like to proceed to attempt the initial issue ;-)

gavv commented 1 year ago

Great;

I've renamed this issue to "Problems with build on macOS"

and created a new one for the original task: https://github.com/roc-streaming/roc-go/issues/54

gavv commented 1 year ago

I've tried to reproduce your original issue and was able to do it on M1 macbook (where brew packages also live in /opt/homebrew as on your machine) after removing pkg-config.

I wonder if you could verify that was the source of the problem, by doing the following in roc-toolkit work dir:

brew uninstall --ignore-dependencies pkg-config
scons -c
scons --build-3rdparty=openfec,libuv

Please copy what the command above prints to console and post it here, and copy contents of config.log and also post it here.

Then:

brew install pkg-config
scons -c
scons --build-3rdparty=openfec,libuv

Again, please post both what the command above prints to console and contents of config.log.

PS. no need to run sudo scons ... commands.

Darrellbor commented 1 year ago

running the first set of commands

brew uninstall --ignore-dependencies pkg-config
scons -c
scons --build-3rdparty=openfec,libuv

results in the following in the terminal

scons: Reading SConscript files ...
rm(bin)
rm(build)
scons: *** commit: Permission denied
scons: done reading SConscript files.
scons: Cleaning targets ...
scons: done cleaning targets.
 darrel.idiagbor@Darrels-MacBook-Pro-2  ~/workspace/roc-toolkit   master  scons --build-3rdparty=openfec,libuv
scons: Reading SConscript files ...
Searching PATH for llvm 14.0.0... (cached) /Library/Developer/CommandLineTools/usr/bin
Searching CXX executable... (cached) /usr/bin/clang++
Searching CXX executable... (cached) /usr/bin/clang++
Searching CC executable... (cached) /usr/bin/clang
Searching CXXLD executable... (cached) /usr/bin/clang++
Searching CCLD executable... (cached) /usr/bin/clang
Searching LD executable... (cached) /usr/bin/ld
Searching AR executable... (cached) /Library/Developer/CommandLineTools/usr/bin/ar
Searching RANLIB executable... (cached) /Library/Developer/CommandLineTools/usr/bin/ranlib (/Library/Developer/CommandLineTools/usr/bin/libtool)
Searching STRIP executable... (cached) /Library/Developer/CommandLineTools/usr/bin/strip
Searching OBJCOPY executable... (cached) not found
Searching INSTALL_NAME_TOOL executable... (cached) /usr/bin/install_name_tool
Searching for system library directory... (cached) /usr/local/lib
Searching PKG_CONFIG... (cached) not found
Searching PKG_CONFIG_PATH...(cached) /usr/local/lib/pkgconfig
/opt/homebrew/Cellar/scons/4.4.0/libexec/bin/python3.11 scripts/scons_helpers/build-3rdparty.py build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release 3rdparty/_distfiles '' release libuv-1.35.0 '' CXX=/usr/bin/clang++ CXXLD=/usr/bin/clang++ CC=/usr/bin/clang CCLD=/usr/bin/clang AR=/Library/Developer/CommandLineTools/usr/bin/ar RANLIB=/Library/Developer/CommandLineTools/usr/bin/ranlib
[download] https://dist.libuv.org/dist/v1.35.0/libuv-v1.35.0.tar.gz
[unpack] libuv-v1.35.0.tar.gz
[patch] include/uv.h
[execute] ./autogen.sh
[execute] ./configure --host= CXX=/usr/bin/clang++ CXXLD=/usr/bin/clang++ CC=/usr/bin/clang CCLD=/usr/bin/clang AR=/Library/Developer/CommandLineTools/usr/bin/ar RANLIB=/Library/Developer/CommandLineTools/usr/bin/ranlib CXXFLAGS=-fvisibility=hidden CFLAGS=-fvisibility=hidden LDFLAGS='' --with-pic --enable-static
[execute] make -j10
[install] build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/lib/libuv.a
[install] build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/include
Searching pkg-config package speexdsp...(cached) pkg-config not available
Checking for C library speexdsp... no
error: speexdsp not found (see 'config.log' for details)

and produces the following in the config.log file

file /Users/darrel.idiagbor/workspace/roc-toolkit/SConstruct,line 456:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching PATH for llvm 14.0.0... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CC executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching CXXLD executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CCLD executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching LD executable... 
scons: Configure: (cached) /usr/bin/ld

scons: Configure: Searching AR executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ar

scons: Configure: Searching RANLIB executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ranlib (/Library/Developer/CommandLineTools/usr/bin/libtool)

scons: Configure: Searching STRIP executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/strip

scons: Configure: Searching OBJCOPY executable... 
scons: Configure: (cached) not found

scons: Configure: Searching INSTALL_NAME_TOOL executable... 
scons: Configure: (cached) /usr/bin/install_name_tool

scons: Configure: Searching for system library directory... 
scons: Configure: (cached) /usr/local/lib

scons: Configure: Searching PKG_CONFIG... 
scons: Configure: (cached) not found

scons: Configure: Searching PKG_CONFIG_PATH...
scons: Configure: (cached) /usr/local/lib/pkgconfig

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 198:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching pkg-config package speexdsp...
scons: Configure: (cached) pkg-config not available

scons: Configure: Checking for C library speexdsp... 
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c <-
  |
  |#include <stdio.h>
  |#include <speex/speex_resampler.h>
  |
  |int main() {
  |    printf("%d\n", (int)(1));
  |    return 0;
  |}
  |
/usr/bin/clang -o .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.o -c -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_stable -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_common -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/include -I3rdparty/hedley .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c:3:10: fatal error: 'speex/speex_resampler.h' file not found
#include <speex/speex_resampler.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: Configure: no

The second set of commands

brew install pkg-config
scons -c
scons --build-3rdparty=openfec,libuv

results in the following in the terminal

...
Install file: "build/src/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/roc-recv" as "bin/arm64-pc-apple-darwin22.3.0/roc-recv"
/Library/Developer/CommandLineTools/usr/bin/strip -x build/src/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libroc.0.2.dylib
Install file: "build/src/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libroc.0.2.dylib" as "bin/arm64-pc-apple-darwin22.3.0/libroc.0.2.dylib"
ln(bin/arm64-pc-apple-darwin22.3.0/libroc.dylib)
ln(bin/arm64-pc-apple-darwin22.3.0/libroc.0.dylib)
scons: done building targets.

can't paste the complete result

and produces the following in the config.log file

file /Users/darrel.idiagbor/workspace/roc-toolkit/SConstruct,line 456:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching PATH for llvm 14.0.0... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CXX executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CC executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching CXXLD executable... 
scons: Configure: (cached) /usr/bin/clang++

scons: Configure: Searching CCLD executable... 
scons: Configure: (cached) /usr/bin/clang

scons: Configure: Searching LD executable... 
scons: Configure: (cached) /usr/bin/ld

scons: Configure: Searching AR executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ar

scons: Configure: Searching RANLIB executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/ranlib (/Library/Developer/CommandLineTools/usr/bin/libtool)

scons: Configure: Searching STRIP executable... 
scons: Configure: (cached) /Library/Developer/CommandLineTools/usr/bin/strip

scons: Configure: Searching OBJCOPY executable... 
scons: Configure: (cached) not found

scons: Configure: Searching INSTALL_NAME_TOOL executable... 
scons: Configure: (cached) /usr/bin/install_name_tool

scons: Configure: Searching for system library directory... 
scons: Configure: (cached) /usr/local/lib

scons: Configure: Searching PKG_CONFIG... 
scons: Configure: (cached) pkg-config

scons: Configure: Searching PKG_CONFIG_PATH...
scons: Configure: (cached) /usr/local/lib/pkgconfig

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 198:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching pkg-config package speexdsp...
scons: Configure: (cached) not found

scons: Configure: Checking for C library speexdsp... 
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c <-
  |
  |#include <stdio.h>
  |#include <speex/speex_resampler.h>
  |
  |int main() {
  |    printf("%d\n", (int)(1));
  |    return 0;
  |}
  |
/usr/bin/clang -o .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.o -c -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_stable -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_common -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/include -I3rdparty/hedley -I/opt/homebrew/Cellar/speexdsp/1.2.1/include .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.c
/usr/bin/clang++ -o .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0_2f299c98abec6b0e3f7590e453fc9763 .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0.o -Lbuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/lib -Lbuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/lib -L/opt/homebrew/Cellar/speexdsp/1.2.1/lib build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/lib/libopenfec.a build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/lib/libuv.a -lspeexdsp
.sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0_2f299c98abec6b0e3f7590e453fc9763 > .sconf_temp/conftest_9d97f46602cbd26ba2345c3655522767_0_2f299c98abec6b0e3f7590e453fc9763.out
scons: Configure: yes

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 293:
    Configure(confdir = .sconf_temp)
scons: Configure: Searching pkg-config package sox...
scons: Configure: (cached) not found

scons: Configure: Checking for C library sox... 
.sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0.c <-
  |
  |#include <stdio.h>
  |#include <sox.h>
  |
  |int main() {
  |    printf("%d\n", (int)(SOX_LIB_VERSION_CODE >= SOX_LIB_VERSION(14, 4, 0)));
  |    return 0;
  |}
  |
/usr/bin/clang -o .sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0.o -c -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_stable -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/include/lib_common -Ibuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/include -I3rdparty/hedley -I/opt/homebrew/Cellar/speexdsp/1.2.1/include -I/opt/homebrew/Cellar/sox/14.4.2_5/include .sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0.c
/usr/bin/clang++ -o .sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0_1fac05b37c7d4228985ad8c79dcfa336 .sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0.o -Lbuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/lib -Lbuild/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/lib -L/opt/homebrew/Cellar/speexdsp/1.2.1/lib -L/opt/homebrew/Cellar/sox/14.4.2_5/lib build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/openfec-1.4.2.4/lib/libopenfec.a build/3rdparty/arm64-pc-apple-darwin22.3.0/clang-14.0.0-release/libuv-1.35.0/lib/libuv.a -lspeexdsp -lsox
.sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0_1fac05b37c7d4228985ad8c79dcfa336 > .sconf_temp/conftest_5495290083d5a4409758c36b097ee518_0_1fac05b37c7d4228985ad8c79dcfa336.out
scons: Configure: yes

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 318:
    Configure(confdir = .sconf_temp)
scons: Configure: Checking for executable ragel... 
scons: Configure: (cached) /opt/homebrew/bin/ragel

file /Users/darrel.idiagbor/workspace/roc-toolkit/3rdparty/SConscript,line 339:
    Configure(confdir = .sconf_temp)
scons: Configure: Checking for executable gengetopt... 
scons: Configure: (cached) /opt/homebrew/bin/gengetopt
gavv commented 1 year ago

Thanks!!

Yes, it's exactly how it behaves on my machine too. So the solution was to install pkg-config and adding speexdsp to --build-3rdparty is not necessary.

I'll update docs.