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

Getting Error while building on FreeBSD 10.1 #81

Closed
ghost opened this issue Apr 16, 2015 · 11 comments
Closed

Getting Error while building on FreeBSD 10.1 #81

ghost opened this issue Apr 16, 2015 · 11 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2015

Getting Error while running make on FreeBSD 10.1
Nginx Version: 1.6.2 stable

/root/tes/nginx-vod-module-master/vod/common.h:65:9: error: 'MIN' macro redefined [-Werror]

define MIN(x, y) ngx_min(x, y)

    ^

/usr/include/sys/param.h:285:9: note: previous definition is here

define MIN(a,b) (((a)<(b))?(a):(b))

    ^

In file included from /root/tes/nginx-vod-module-master//ngx_http_vod_conf.c:1:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_conf.h:6:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_submodule.h:5:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_request_parse.h:7:
In file included from /root/tes/nginx-vod-module-master/vod/mp4_parser.h:5:
/root/tes/nginx-vod-module-master/vod/common.h:66:9: error: 'MAX' macro redefined [-Werror]

define MAX(x, y) ngx_max(x, y)

    ^

/usr/include/sys/param.h:286:9: note: previous definition is here

define MAX(a,b) (((a)>(b))?(a):(b))

    ^

2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /root/nginx-1.6.2
*** Error code 1

Stop.
make: stopped in /root/nginx-1.6.2

@jessp01
Copy link
Contributor

jessp01 commented Apr 16, 2015

Thanks. We'll take a look. What compiler and ver do you use?

May the source be with you,

Jess Portnoy

-------- Original message --------
From: Linuxbot notifications@github.com
Date:
To: kaltura/nginx-vod-module nginx-vod-module@noreply.github.com
Subject: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Getting Error while running make on FreeBSD 10.1
Nginx Version: 1.6.2 stable

/root/tes/nginx-vod-module-master/vod/common.h:65:9: error: 'MIN' macro redefined [-Werror]
#define MIN(x, y) ngx_min(x, y)
^
/usr/include/sys/param.h:285:9: note: previous definition is here
#define MIN(a,b) (((a)<(b))?(a):(b))
^
In file included from /root/tes/nginx-vod-module-master//ngx_http_vod_conf.c:1:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_conf.h:6:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_submodule.h:5:
In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_request_parse.h:7:
In file included from /root/tes/nginx-vod-module-master/vod/mp4_parser.h:5:
/root/tes/nginx-vod-module-master/vod/common.h:66:9: error: 'MAX' macro redefined [-Werror]
#define MAX(x, y) ngx_max(x, y)
^
/usr/include/sys/param.h:286:9: note: previous definition is here
#define MAX(a,b) (((a)>(b))?(a):(b))
^
2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /root/nginx-1.6.2
*** Error code 1

Stop.
make: stopped in /root/nginx-1.6.2

Reply to this email directly or view it on GitHubhttps://github.com//issues/81.

@erankor
Copy link
Contributor

erankor commented Apr 16, 2015

Please try to comment these 2 lines in vod/common.h (#define MIN & #define MAX) and let me know if you get any other errors. These can be easily solved by wrapping them with ifndef, but there may be other errors as we never compiled it on FreeBSD before

Thanks

Eran

@ghost
Copy link
Author

ghost commented Apr 17, 2015

After commenting Those two lines..i`m getting this error..

cc -c -pipe -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -I src/http -I src/http/modules -I src/mail -o objs/addon/hls/mp4_to_annexb_filter.o /root/tes/nginx-vod-module-master//vod/hls/mp4_to_annexb_filter.c/root/tes/nginx-vod-module-master//vod/hls/mp4_to_annexb_filter.c:179:17: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare] write_size = MIN(state->packet_size_left, buffer_end - buffer); ^ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~/usr/include/sys/param.h:285:23: note: expanded from macro 'MIN'#define MIN(a,b) (((a)<(b))?(a):(b)) ^1 error generated.* Error code 1
Stop.make[1]: stopped in /root/nginx-1.6.2
* Error code 1

Thank you..
Date: Thu, 16 Apr 2015 11:26:49 -0700
From: notifications@github.com
To: nginx-vod-module@noreply.github.com
CC: linuxbot@outlook.com
Subject: Re: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Please try to comment these 2 lines in vod/common.h (#define MIN & #define MAX) and let me know if you get any other errors. These can be easily solved by wrapping them with ifndef, but there may be other errors as we never compiled it on FreeBSD before

Thanks

Eran


Reply to this email directly or view it on GitHub.

@ghost
Copy link
Author

ghost commented Apr 17, 2015

OS : FreeBSD 10.1,Clang C compiler; clang version: 3.4.1..

Thank you

Date: Thu, 16 Apr 2015 10:38:25 -0700
From: notifications@github.com
To: nginx-vod-module@noreply.github.com
CC: linuxbot@outlook.com
Subject: Re: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Thanks. We'll take a look. What compiler and ver do you use?

May the source be with you,

Jess Portnoy

-------- Original message --------

From: Linuxbot notifications@github.com

Date:

To: kaltura/nginx-vod-module nginx-vod-module@noreply.github.com

Subject: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Getting Error while running make on FreeBSD 10.1

Nginx Version: 1.6.2 stable

/root/tes/nginx-vod-module-master/vod/common.h:65:9: error: 'MIN' macro redefined [-Werror]

#define MIN(x, y) ngx_min(x, y)

^

/usr/include/sys/param.h:285:9: note: previous definition is here

#define MIN(a,b) (((a)<(b))?(a):(b))

^

In file included from /root/tes/nginx-vod-module-master//ngx_http_vod_conf.c:1:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_conf.h:6:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_submodule.h:5:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_request_parse.h:7:

In file included from /root/tes/nginx-vod-module-master/vod/mp4_parser.h:5:

/root/tes/nginx-vod-module-master/vod/common.h:66:9: error: 'MAX' macro redefined [-Werror]

#define MAX(x, y) ngx_max(x, y)

^

/usr/include/sys/param.h:286:9: note: previous definition is here

#define MAX(a,b) (((a)>(b))?(a):(b))

^

2 errors generated.

*** Error code 1

Stop.

make[1]: stopped in /root/nginx-1.6.2

*** Error code 1

Stop.

make: stopped in /root/nginx-1.6.2

Reply to this email directly or view it on GitHubhttps://github.com//issues/81.


Reply to this email directly or view it on GitHub.

@jessp01
Copy link
Contributor

jessp01 commented Apr 17, 2015

Thanks. I will create a similar ENV and test.

May the source be with you,

Jess Portnoy

-------- Original message --------
From: Linuxbot notifications@github.com
Date:
To: kaltura/nginx-vod-module nginx-vod-module@noreply.github.com
Cc: Jess Portnoy jess.portnoy@kaltura.com
Subject: Re: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

OS : FreeBSD 10.1,Clang C compiler; clang version: 3.4.1..

Thank you

Date: Thu, 16 Apr 2015 10:38:25 -0700
From: notifications@github.com
To: nginx-vod-module@noreply.github.com
CC: linuxbot@outlook.com
Subject: Re: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Thanks. We'll take a look. What compiler and ver do you use?

May the source be with you,

Jess Portnoy

-------- Original message --------

From: Linuxbot notifications@github.com

Date:

To: kaltura/nginx-vod-module nginx-vod-module@noreply.github.com

Subject: [nginx-vod-module] Getting Error while building on FreeBSD 10.1 (#81)

Getting Error while running make on FreeBSD 10.1

Nginx Version: 1.6.2 stable

/root/tes/nginx-vod-module-master/vod/common.h:65:9: error: 'MIN' macro redefined [-Werror]

#define MIN(x, y) ngx_min(x, y)

^

/usr/include/sys/param.h:285:9: note: previous definition is here

#define MIN(a,b) (((a)<(b))?(a):(b))

^

In file included from /root/tes/nginx-vod-module-master//ngx_http_vod_conf.c:1:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_conf.h:6:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_submodule.h:5:

In file included from /root/tes/nginx-vod-module-master/ngx_http_vod_request_parse.h:7:

In file included from /root/tes/nginx-vod-module-master/vod/mp4_parser.h:5:

/root/tes/nginx-vod-module-master/vod/common.h:66:9: error: 'MAX' macro redefined [-Werror]

#define MAX(x, y) ngx_max(x, y)

^

/usr/include/sys/param.h:286:9: note: previous definition is here

#define MAX(a,b) (((a)>(b))?(a):(b))

^

2 errors generated.

*** Error code 1

Stop.

make[1]: stopped in /root/nginx-1.6.2

*** Error code 1

Stop.

make: stopped in /root/nginx-1.6.2

Reply to this email directly or view it on GitHubhttps://github.com//issues/81.

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-93956568.

@jessp01
Copy link
Contributor

jessp01 commented Apr 18, 2015

Hello,

I have created an instance on EC2 with the following AMI image - ami-4494132c :
FreeBSD ip-10-144-155-165 10.1-RC3-p1 FreeBSD 10.1-RC3-p1 #0: Tue Nov 4 01:23:22 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64

[root@ip-10-144-155-165 /tmp/nginx-vod-module]# clang -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
Selected GCC installation:

Which compiled correctly.

Can you please try checkout the latest master version and run:

./travis_build.sh

It will auto build for you, this is just to see if that one passes, then we can try to compare configure flags to find the diff.

Thanks,

@jessp01
Copy link
Contributor

jessp01 commented Apr 18, 2015

A few notes about building that way:
0. this is used to build on Travis as prep check for our RPM/Deb packaging, on your machine, you might want to change the prefix to be /usr/local as customary for placing self compiled software on the FS

  1. this also builds two additional Kaltura Nginx Akamai related modules which you may or may not want, you can comment them out accordingly, if you want support for the ffmpeg based features, you will also need ffmpeg, we use version 2.1.3 for our build.

Finally, here is a build log from our FreeBSD machine:
https://gist.github.com/jessp01/6cc60a8afdbb76355d3b

You may want to compare outputs.

@erankor
Copy link
Contributor

erankor commented Apr 18, 2015

Another thing we can do, in parallel to that, is that you'll disable the 'treat warnings as errors' compiler option, and run make again. After removing that option, the build will probably succeed, and you'll get all the warnings that bother your compiler. Once you have that, please paste it on this thread, and we'll fix them.

To remove this option, edit ./objs/Makefile, search for -Werror and remove it, for exmaple, I currently have:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g
so it would be:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g

@jessp01
Copy link
Contributor

jessp01 commented Apr 22, 2015

Hello @linuxbot,
Any news on this? Thanks

@ghost
Copy link
Author

ghost commented Apr 23, 2015

Sorry for delay..

I followed your Build log..It`s working now..

Thanks For your Support..

@ghost ghost closed this as completed Apr 23, 2015
@jessp01
Copy link
Contributor

jessp01 commented Apr 23, 2015

Welcome.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants