VCVRack / Fundamental

https://vcvrack.com/Fundamental
Other
235 stars 76 forks source link

libsamplerate compilation failing on MacOS during make #38

Closed wizardishungry closed 6 years ago

wizardishungry commented 6 years ago
cd dep && curl -OL http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4235k  100 4235k    0     0  4307k      0 --:--:-- --:--:-- --:--:-- 4303k
cd dep && tar xf libsamplerate-0.1.9.tar.gz
cd dep/libsamplerate-0.1.9 && ./configure --prefix="/Users/jon/Projects/Rack/plugins/Fundamental/dep"
checking build system type... i386-apple-darwin17.5.0
checking host system type... i386-apple-darwin17.5.0
checking target system type... i386-apple-darwin17.5.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
/Users/jon/Projects/Rack/plugins/Fundamental/dep/libsamplerate-0.1.9/Cfg/missing: Unknown `--is-lightweight' option
Try `/Users/jon/Projects/Rack/plugins/Fundamental/dep/libsamplerate-0.1.9/Cfg/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... rm: conftest.dSYM: is a directory
yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/local/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert i386-apple-darwin17.5.0 file names to i386-apple-darwin17.5.0 format... func_convert_file_noop
checking how to convert i386-apple-darwin17.5.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... rm: conftest.dSYM: is a directory
no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking for windres... no
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether ln -s works... yes
checking for ANSI C header files... (cached) yes
checking for stdint.h... (cached) yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking size of int... 4
checking size of long... 8
checking size of float... 4
checking size of double... 8
checking processor byte ordering... little
checking for malloc... yes
checking for calloc... yes
checking for free... yes
checking for memcpy... yes
checking for memmove... yes
checking for alarm... yes
checking for signal... yes
checking for floor in -lm... yes
checking for floor... yes
checking for ceil... yes
checking for fmod... yes
checking for SIGALRM... yes
checking for lrint... yes
checking for lrintf... yes
checking processor clipping capabilities... none
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SNDFILE... yes
checking alsa/asoundlib.h usability... no
checking alsa/asoundlib.h presence... no
checking for alsa/asoundlib.h... no
checking for FFTW3... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating M4/Makefile
config.status: creating src/Version_script
config.status: creating Win32/Makefile
config.status: creating Win32/Makefile.mingw
config.status: creating src/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating libsamplerate.spec
config.status: creating samplerate.pc
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-=-

  Configuration summary :

    Version : ..................... 0.1.9

    Host CPU : .................... i386
    Host Vendor : ................. apple
    Host OS : ..................... darwin17.5.0

-e   Tools :

    Compiler is GCC : ............. yes
    GCC major version : ........... 4

  Extra tools required for testing and examples :

    Have FFTW : ................... yes
    Have libsndfile : ............. yes
    Have ALSA : ................... no

  Installation directories :

    Library directory : ........... /Users/jon/Projects/Rack/plugins/Fundamental/dep/lib
    Program directory : ........... /Users/jon/Projects/Rack/plugins/Fundamental/dep/bin
    Pkgconfig directory : ......... /Users/jon/Projects/Rack/plugins/Fundamental/dep/lib/pkgconfig

Compiling some other packages against libsamplerate may require
-e the addition of "/Users/jon/Projects/Rack/plugins/Fundamental/dep/lib/pkgconfig" to the
-e PKG_CONFIG_PATH environment variable.

cd dep/libsamplerate-0.1.9 && /Applications/Xcode.app/Contents/Developer/usr/bin/make
Making all in M4
make[2]: Nothing to be done for `all'.
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CC       samplerate.lo
  CC       src_sinc.lo
  CC       src_zoh.lo
  CC       src_linear.lo
  CCLD     libsamplerate.la
Making all in doc
make[2]: Nothing to be done for `all'.
Making all in examples
  CC       sndfile-resample.o
  CCLD     sndfile-resample
  CC       varispeed-play.o
  CC       audio_out.o
audio_out.c:38:3: warning: redefinition of typedef 'AUDIO_OUT' is a C11 feature [-Wtypedef-redefinition]
} AUDIO_OUT ;
  ^
./audio_out.h:9:28: note: previous definition is here
typedef struct AUDIO_OUT_s AUDIO_OUT ;
                           ^
audio_out.c:435:10: fatal error: 'Carbon.h' file not found
#include <Carbon.h>
         ^~~~~~~~~~
1 warning and 1 error generated.
make[2]: *** [audio_out.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [dep/lib/libsamplerate.a] Error 2
wizardishungry commented 6 years ago

(For anyone who needs to test stuff with 0.6 series Fundamental, 5d676bb compiles fine)

AndrewBelt commented 6 years ago

Could I get more context than just one line please?

wizardishungry commented 6 years ago

updated.

AndrewBelt commented 6 years ago

Are you able to compile libsamplerate 0.1.9 manually from scrach? If so, what did you have to do differently?

cschol commented 6 years ago

Similar issue on Windows. It fails compiling examples for libsamplerate, that are platform-specific.

Fails with manual compilation and when building with the Fundamental Makefile.

audio_out.c:826:2: error: 'sample_count' undeclared (first use in this function); did you mean 'frame_count'?
  sample_count = win32_out->bufferlen ;
  ^~~~~~~~~~~~
  frame_count
audio_out.c:826:2: note: each undeclared identifier is reported only once for each function it appears in
cschol commented 6 years ago

I checked, the Windows issue has been fixed in the latest HEAD of the libsamplerate repository. Unfortunately, the .zip file from the website is older than that and does not have the fix for Windows, which is essentially just declaring a "sample_count" variable.

rossco255 commented 6 years ago

Just spent about an hour struggling with this on macOS 10.12.6. Got it working by commenting out #include <Carbon.h> and compiling libsamplerate 0.1.9 manually.

AScustomWorks commented 6 years ago

With the latest rack and Fundamental sources everything works as expected, at least on the mac side.

rossco255 commented 6 years ago

I was able to build libsamplerate by changing it to <Carbon/Carbon.h>. Not sure if it's just an issue with how the frameworks are installed on my mac.

AScustomWorks commented 6 years ago

@cschol any hints about installing libsamplerate on win? just tried doing it manually and failed.

cschol commented 6 years ago

In general, you should be able to do the same thing as Fundamental does. Did you check the latest Fundamental source?

AScustomWorks commented 6 years ago

@cschol Long story short: Yes, up to date with Fundamental, is just that I thought it could be a good idea to keep adding compiled releases on github repository (Mac compiles just fine, Linux gave some hiccups but seems to work in the end, Win stuck on errors hehe). If anything I may just do the github releases with source code only, to keep a history of changes.

cschol commented 6 years ago

I don't quite understand how Fundamental can build on Windows and other plugins have issues. Unless Andrew's build system for Windows is different.

jeremywen commented 6 years ago

I ran into the same issue just now. Looks like this issue is similar -> https://github.com/VCVRack/Rack/issues/143 I changed the makefile to just make src and then things seemed to compile fine:

cd dep/libsamplerate-0.1.9/src && $(MAKE)
cd dep/libsamplerate-0.1.9/src && $(MAKE) install
AndrewBelt commented 6 years ago

@jeremywen the src idea is what I was looking for! Best solution, thanks.

bafonso commented 6 years ago

Where did you change this @jeremywen ? I just ran into the same issue. I commented the Carbon.h compiled but then when making fundamental it complains that it's linked against a different version so I'm guessing I messed up a step

jeremywen commented 6 years ago

Change these lines https://github.com/VCVRack/Fundamental/blob/master/Makefile#L22-L23

AndrewBelt commented 6 years ago

Fixed in 45f6f7e