google / brotli

Brotli compression format
MIT License
13.47k stars 1.23k forks source link

makefile broken #1094

Open albgen opened 10 months ago

albgen commented 10 months ago

hi,

just tried to compile the new nginx 1.25.3 with brotli but cannot

make -f objs/Makefile modules make[1]: Entering directory/usr/src/nginx-1.25.3' cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I ../ngx_brotli/deps/brotli/c/include -I objs -I src/http -I src/http/modules \ -o objs/addon/filter/ngx_http_brotli_filter_module.o \ ../ngx_brotli/filter/ngx_http_brotli_filter_module.c cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I ../ngx_brotli/deps/brotli/c/include -I objs -I src/http -I src/http/modules \ -o objs/ngx_http_brotli_filter_module_modules.o \ objs/ngx_http_brotli_filter_module_modules.c cc -o objs/ngx_http_brotli_filter_module.so \ objs/addon/filter/ngx_http_brotli_filter_module.o \ objs/ngx_http_brotli_filter_module_modules.o \ -L../ngx_brotli/deps/brotli/c/../out -lbrotlienc -lbrotlicommon -lm \ -shared /usr/bin/ld: cannot find -lbrotlienc /usr/bin/ld: cannot find -lbrotlicommon collect2: error: ld returned 1 exit status make[1]: *** [objs/ngx_http_brotli_filter_module.so] Error 1 make[1]: Leaving directory /usr/src/nginx-1.25.3'

kkumar326 commented 10 months ago

I'm also getting the same error. Did you find any workaround @albgen ?

albgen commented 10 months ago

It was faster sokution for me to use gzip so currently i have removed brotli from the nginx config

vjick7 commented 10 months ago

The same problem. Does anyone find the solution?

kkumar326 commented 10 months ago

@vjick7 not yet. one way is to build by undoing new commits. it seems like it broke recently only so this might work.

vjick7 commented 10 months ago

I found out how to fix this issue. Just run by instruction of https://github.com/google/ngx_brotli.

git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli cd ngx_brotli/deps/brotli mkdir out && cd out cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed .. cmake --build . --config Release --target brotlienc

After that you can use dpkg-buildpackage -b -uc -us.

wyattoday commented 9 months ago

@vjick7

Yes, as I wrote in the readme. Better to link the actual source than to copy & paste it in a random issue or forum post. "Why?" you ask? So the canonical source can be referenced and updated when things inevitable change in the future.

pexcn commented 6 months ago

Temporary solution:

ln -s "$(find /usr/lib -type f -name "libbrotlienc*")" /usr/lib/libbrotlienc.so
ln -s "$(find /usr/lib -type f -name "libbrotlicommon*")" /usr/lib/libbrotlicommon.so