Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error on Big Sur #4155

Closed
kingpin24 opened this issue Jul 5, 2020 · 20 comments · Fixed by usnistgov/SCTK#24 or #4188
Closed

Make error on Big Sur #4155

kingpin24 opened this issue Jul 5, 2020 · 20 comments · Fixed by usnistgov/SCTK#24 or #4188
Assignees
Labels
bug in progress Issue has been taken and is being worked on

Comments

@kingpin24
Copy link

kingpin24 commented Jul 5, 2020

I get the following error when running 'make'

extras/check_dependencies.sh
extras/check_dependencies.sh: all OK.
if [ -d "" ]; then \
		cp -p "/sph2pipe_v2.5.tar.gz" .; \
	else \
		wget -T 10 -t 3 https://www.openslr.org/resources/3/sph2pipe_v2.5.tar.gz || \
		wget -T 10 -c https://sourceforge.net/projects/kaldi/files/sph2pipe_v2.5.tar.gz; \
	fi
--2020-07-04 17:03:16--  https://www.openslr.org/resources/3/sph2pipe_v2.5.tar.gz
Resolving www.openslr.org (www.openslr.org)... 46.101.158.64
Connecting to www.openslr.org (www.openslr.org)|46.101.158.64|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 329832 (322K) [application/x-gzip]
Saving to: ‘sph2pipe_v2.5.tar.gz’

sph2pipe_v2.5.tar.g 100%[===================>] 322.10K   260KB/s    in 1.2s    

2020-07-04 17:03:19 (260 KB/s) - ‘sph2pipe_v2.5.tar.gz’ saved [329832/329832]

tar --no-same-owner -xzf sph2pipe_v2.5.tar.gz
cd sph2pipe_v2.5/ && \
	cc -o sph2pipe  *.c -lm
file_headers.c:149:24: warning: format specifies type 'int' but the argument has
      type 'off_t' (aka 'long long') [-Wformat]
                        inpname, sampcount, statbuf.st_size );
                                            ^~~~~~~~~~~~~~~
file_headers.c:579:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
ConvertToIeeeExtended(num, bytes)
^
file_headers.c:629:1: warning: non-void function does not return a value
      [-Wreturn-type]
}
^
3 warnings generated.
shorten_x.c:187:29: warning: too many arguments in call to 'word_get'
            gbuffer = word_get(fpin);
                      ~~~~~~~~     ^
shorten_x.c:325:22: error: implicit declaration of function 'pcm2alaw' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
                    *writebufp++ = pcm2alaw( ulaw2pcm[data0[i]] );
                                   ^
shorten_x.c:381:24: error: implicit declaration of function 'pcm2ulaw' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
                      *writebufp++ = pcm2ulaw( data0[i] );
                                     ^
shorten_x.c:393:24: error: implicit declaration of function 'pcm2alaw' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
                      *writebufp++ = pcm2alaw( data0[i] );
                                     ^
shorten_x.c:435:20: error: implicit declaration of function 'pcm2ulaw' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
                  *writebufp++ = pcm2ulaw(data0[i] << 3);
                                 ^
1 warning and 4 errors generated.
sph2pipe.c:191:18: error: implicit declaration of function 'getopt' is invalid
      in C99 [-Werror,-Wimplicit-function-declaration]
    while (( i = getopt( ac, av, "daupf:c:t:s:h:" )) != EOF )
                 ^
sph2pipe.c:530:11: warning: assigning to 'unsigned char *' from 'char *'
      converts between pointers to integer types with different sign
      [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:545:8: warning: assigning to 'unsigned char *' from 'char *' converts
      between pointers to integer types with different sign [-Wpointer-sign]
                cptr = inpbuf;
                     ^ ~~~~~~
sph2pipe.c:547:15: warning: assigning to 'unsigned char *' from 'char *'
      converts between pointers to integer types with different sign
      [-Wpointer-sign]
                wptr = cptr = outbuf;
                            ^ ~~~~~~
sph2pipe.c:547:8: warning: assigning to 'char *' from 'unsigned char *' converts
      between pointers to integer types with different sign [-Wpointer-sign]
                wptr = cptr = outbuf;
                     ^ ~~~~~~~~~~~~~
sph2pipe.c:561:11: warning: assigning to 'unsigned char *' from 'char *'
      converts between pointers to integer types with different sign
      [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:568:11: warning: assigning to 'unsigned char *' from 'char *'
      converts between pointers to integer types with different sign
      [-Wpointer-sign]
            cptr = inpbuf;
                 ^ ~~~~~~
sph2pipe.c:616:7: warning: assigning to 'unsigned char *' from 'char *' converts
      between pointers to integer types with different sign [-Wpointer-sign]
        cptr = inpbuf;
             ^ ~~~~~~
7 warnings and 1 error generated.
make: *** [sph2pipe_v2.5/sph2pipe] Error 1

Running gcc -v gives me

Apple clang version 12.0.0 (clang-1200.0.22.7)
Target: x86_64-apple-darwin20.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
@kingpin24 kingpin24 added the bug label Jul 5, 2020
@danpovey
Copy link
Contributor

danpovey commented Jul 5, 2020 via email

@jtrmal
Copy link
Contributor

jtrmal commented Jul 5, 2020 via email

@kkm000
Copy link
Contributor

kkm000 commented Jul 15, 2020

This is interesting, because the latest release was 10, on March 24. Does Apple number their versions differently?

There is a tag for it, but it probably indicates a future branch. There is a branch for 11.x only.

$ git ls-remote https://github.com/llvm/llvm-project.git | fgrep -- -12
3fa4dd27822aee8b2d36a8cd46ba662aed91503d        refs/tags/llvmorg-12-init
7ab7b979d29e1e43701cf690f5cf1903740f50e3        refs/tags/llvmorg-12-init^{}

@kingpin24, do you have any idea what am I missing here? I never had a Mac.

@kkm000 kkm000 added the in progress Issue has been taken and is being worked on label Jul 15, 2020
@danpovey
Copy link
Contributor

danpovey commented Jul 15, 2020 via email

@colynhn
Copy link

colynhn commented Jul 16, 2020

I think you can only install command line tools(not install Xcode), or compile sph2pipe_v2.5.tar.gz yourself.

@kingpin24
Copy link
Author

@jtrmal
Copy link
Contributor

jtrmal commented Jul 20, 2020

I created a PR at nist's github. Last time, Jon Fiscus was pretty responsive.

kkm000 pushed a commit that referenced this issue Jul 21, 2020
X-Ref: usnistgov/SCTK#24
Close: #4155 
Co-authored-by: Jan 'Yenda' Trmal <jtrmal@apptek.com>
@fanelli
Copy link

fanelli commented Sep 29, 2020

I am having the same exact error while trying to compile. I also have Apple clang 12.0.0 on MacOS Catalina. Is this issue closed? Any solution?

@jtrmal
Copy link
Contributor

jtrmal commented Sep 29, 2020 via email

@johnjosephmorgan
Copy link
Contributor

johnjosephmorgan commented Sep 29, 2020 via email

@fanelli
Copy link

fanelli commented Sep 29, 2020

Thank you all for the answers!

I tried to reset xcode by following the steps here with no luck.

Kaldi is up to date on master branch.

This is the error in details:

extras/check_dependencies.sh
extras/check_dependencies.sh: all OK.
cd sph2pipe_v2.5/ &&
cc -o sph2pipe *.c -lm
file_headers.c:149:24: warning: format specifies type 'int' but the argument has type 'off_t' (aka 'long long')
[-Wformat]
inpname, sampcount, statbuf.st_size );
^~~~~~~~~~~~~~~
file_headers.c:579:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
ConvertToIeeeExtended(num, bytes)
^
file_headers.c:629:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
3 warnings generated.
shorten_x.c:187:29: warning: too many arguments in call to 'word_get'
gbuffer = word_get(fpin);
~~~~~~~~ ^
shorten_x.c:325:22: error: implicit declaration of function 'pcm2alaw' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
*writebufp++ = pcm2alaw( ulaw2pcm[data0[i]] );
^
shorten_x.c:381:24: error: implicit declaration of function 'pcm2ulaw' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
*writebufp++ = pcm2ulaw( data0[i] );
^
shorten_x.c:393:24: error: implicit declaration of function 'pcm2alaw' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
*writebufp++ = pcm2alaw( data0[i] );
^
shorten_x.c:435:20: error: implicit declaration of function 'pcm2ulaw' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
*writebufp++ = pcm2ulaw(data0[i] << 3);
^
1 warning and 4 errors generated.
sph2pipe.c:191:18: error: implicit declaration of function 'getopt' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
while (( i = getopt( ac, av, "daupf:c:t:s:h:" )) != EOF )
^
sph2pipe.c:530:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:545:8: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:547:15: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
wptr = cptr = outbuf;
^ ~~~~~~
sph2pipe.c:547:8: warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
wptr = cptr = outbuf;
^ ~~~~~~~~~~~~~
sph2pipe.c:561:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:568:11: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
sph2pipe.c:616:7: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
cptr = inpbuf;
^ ~~~~~~
7 warnings and 1 error generated.

Currently running MacOS Katalina 10.15.6.

The output of gcc -v is:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@jtrmal
Copy link
Contributor

jtrmal commented Sep 29, 2020 via email

@johnjosephmorgan
Copy link
Contributor

johnjosephmorgan commented Sep 29, 2020 via email

@jtrmal
Copy link
Contributor

jtrmal commented Sep 30, 2020 via email

jtrmal added a commit to jtrmal/kaldi that referenced this issue Sep 30, 2020
danpovey pushed a commit that referenced this issue Sep 30, 2020
Co-authored-by: Jan 'Yenda' Trmal <jtrmal@apptek.com>
@ntaiblum
Copy link

ntaiblum commented Oct 1, 2020

Thanks for the quick fix!
It resolved the issue for me

@kkm000
Copy link
Contributor

kkm000 commented Oct 1, 2020

@jtrmal Yenda, here's an option: https://github.com/burrmill/sph2pipe

I just put it for safekeeping there, because it's easier to pull. We can preapply your patch and pull code from there. You're an owner, do what you want with it :)

@jtrmal
Copy link
Contributor

jtrmal commented Oct 1, 2020 via email

@kkm000
Copy link
Contributor

kkm000 commented Oct 1, 2020

Let's just tag the original version. We can always revert to pulling from a tag if anything goes wrong with the patch.

Oh, in fact, there is already a tag: burrmill/sph2pipe@7371bed

@shadowusr
Copy link

As a simple & quick walkaround you can do CFLAGS="-w" make to disable all warnings

@kkm000
Copy link
Contributor

kkm000 commented Apr 29, 2021

@shadowusr, did you actually see the problem resurface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in progress Issue has been taken and is being worked on
Projects
None yet
9 participants