GithubHelp home page GithubHelp logo

Comments (6)

mgautierfr avatar mgautierfr commented on July 22, 2024

How have you compile/install kiwix-lib ? static or dynamic ?

from libkiwix.

mgautierfr avatar mgautierfr commented on July 22, 2024

I'd totally forget but I added the right link flags in the kiwix-build.py script.

That was a mistake :/

Now, meson add the right flags itself if we use the -Dstatic-linkage=true option.
If all depedency libraries are correctly installed, you should be able to compile a static binaries with :
meson -Dstatic-linkage=true . build
You don't need --default-library=static anymore as this is usefull only when compiling libraries and
kiwix-tools doesn't have library.

from libkiwix.

kelson42 avatar kelson42 commented on July 22, 2024

@mgautierfr starmad I have try again (with the new meson command line arguments) and now I get an other error

$ ninja
[1/14] 'Generating resources with a custom command.'
jquery-ui/jquery-ui.structure.min.css ['jquery_ui', 'jquery_ui_structure_min_css']
jquery-ui/jquery-ui.min.js ['jquery_ui', 'jquery_ui_min_js']
jquery-ui/external/jquery/jquery.js ['jquery_ui', 'external', 'jquery', 'jquery_js']
jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png ['jquery_ui', 'images', 'ui_bg_flat_0_aaaaaa_40x100_png']
jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png ['jquery_ui', 'images', 'ui_bg_flat_75_ffffff_40x100_png']
jquery-ui/images/ui-icons_222222_256x240.png ['jquery_ui', 'images', 'ui_icons_222222_256x240_png']
jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png ['jquery_ui', 'images', 'ui_bg_glass_55_fbf9ee_1x400_png']
jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png ['jquery_ui', 'images', 'ui_bg_highlight_soft_75_cccccc_1x100_png']
jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png ['jquery_ui', 'images', 'ui_bg_glass_65_ffffff_1x400_png']
jquery-ui/images/ui-icons_2e83ff_256x240.png ['jquery_ui', 'images', 'ui_icons_2e83ff_256x240_png']
jquery-ui/images/ui-icons_cd0a0a_256x240.png ['jquery_ui', 'images', 'ui_icons_cd0a0a_256x240_png']
jquery-ui/images/ui-icons_888888_256x240.png ['jquery_ui', 'images', 'ui_icons_888888_256x240_png']
jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png ['jquery_ui', 'images', 'ui_bg_glass_75_e6e6e6_1x400_png']
jquery-ui/images/animated-overlay.gif ['jquery_ui', 'images', 'animated_overlay_gif']
jquery-ui/images/ui-bg_glass_75_dadada_1x400.png ['jquery_ui', 'images', 'ui_bg_glass_75_dadada_1x400_png']
jquery-ui/images/ui-icons_454545_256x240.png ['jquery_ui', 'images', 'ui_icons_454545_256x240_png']
jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png ['jquery_ui', 'images', 'ui_bg_glass_95_fef1ec_1x400_png']
jquery-ui/jquery-ui.theme.min.css ['jquery_ui', 'jquery_ui_theme_min_css']
jquery-ui/jquery-ui.min.css ['jquery_ui', 'jquery_ui_min_css']
home.html.tmpl ['home_html_tmpl']
include.html.part ['include_html_part']
taskbar.css ['taskbar_css']
taskbar.html.part ['taskbar_html_part']
[3/14] Compiling cpp object 'src/searcher/kiwix-search@exe/kiwix-search.cpp.o'
../src/searcher/kiwix-search.cpp: In function ‘int main(int, char**)’:
../src/searcher/kiwix-search.cpp:109:12: warning: deleting object of abstract class type ‘kiwix::Searcher’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]
     delete searcher;
            ^
../src/searcher/kiwix-search.cpp:38:8: warning: variable ‘verboseFlag’ set but not used [-Wunused-but-set-variable]
   bool verboseFlag = false;
        ^
../src/searcher/kiwix-search.cpp:41:20: warning: variable ‘backend’ set but not used [-Wunused-but-set-variable]
   supportedBackend backend = XAPIAN;
                    ^
[5/14] Compiling cpp object 'src/reader/kiwix-read@exe/kiwix-read.cpp.o'
../src/reader/kiwix-read.cpp: In function ‘int main(int, char**)’:
../src/reader/kiwix-read.cpp:91:18: warning: unused variable ‘contentLength’ [-Wunused-variable]
     unsigned int contentLength = 0;
                  ^
[7/14] Linking target src/searcher/kiwix-search
FAILED: src/searcher/kiwix-search 
c++    -o src/searcher/kiwix-search 'src/searcher/kiwix-search@exe/kiwix-search.cpp.o' '-L/usr/local/lib/x86_64-linux-gnu' '-L/usr/local/lib/pugixml-1.8' '-L/usr/local/lib' '-Wl,--no-undefined' '-Wl,--as-needed' '-static-libstdc++' '--static' '-pthread' '-lkiwix' '-lzim' '-llzma' '-licui18n' '-licuuc' '-licudata' '-ldl' '-lm' '-lpugixml' '-lxapian' '-lmicrohttpd' '-lgcrypt' '-lgnutls' '/usr/lib/x86_64-linux-gnu/libz.so' '-Wl,-rpath' '-Wl,/usr/lib/x86_64-linux-gnu' '-lp11-kit' '-lgmp' '-lhogweed' '-lgmp' '-lnettle' '-ltasn1' '-lidn' '-lp11-kit' '-lz' '-lctpp2' '-lz' 
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libicuuc.a(putil.ao): In function `uprv_dl_open_55':
(.text+0x18c2): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lxapian
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libz.so'
collect2: error: ld returned 1 exit status
[8/14] Linking target src/indexer/kiwix-index
FAILED: src/indexer/kiwix-index 
c++    -o src/indexer/kiwix-index 'src/indexer/kiwix-index@exe/kiwix-index.cpp.o' '-L/usr/local/lib/x86_64-linux-gnu' '-L/usr/local/lib/pugixml-1.8' '-L/usr/local/lib' '-Wl,--no-undefined' '-Wl,--as-needed' '-static-libstdc++' '--static' '-pthread' '-lkiwix' '-lzim' '-llzma' '-licui18n' '-licuuc' '-licudata' '-ldl' '-lm' '-lpugixml' '-lxapian' '-lmicrohttpd' '-lgcrypt' '-lgnutls' '/usr/lib/x86_64-linux-gnu/libz.so' '-Wl,-rpath' '-Wl,/usr/lib/x86_64-linux-gnu' '-lp11-kit' '-lgmp' '-lhogweed' '-lgmp' '-lnettle' '-ltasn1' '-lidn' '-lp11-kit' '-lz' '-lctpp2' '-lz' 
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libicuuc.a(putil.ao): In function `uprv_dl_open_55':
(.text+0x18c2): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lxapian
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libz.so'
collect2: error: ld returned 1 exit status
[9/14] Linking target src/reader/kiwix-read
FAILED: src/reader/kiwix-read 
c++    -o src/reader/kiwix-read 'src/reader/kiwix-read@exe/kiwix-read.cpp.o' '-L/usr/local/lib/x86_64-linux-gnu' '-L/usr/local/lib/pugixml-1.8' '-L/usr/local/lib' '-Wl,--no-undefined' '-Wl,--as-needed' '-static-libstdc++' '--static' '-pthread' '-lkiwix' '-lzim' '-llzma' '-licui18n' '-licuuc' '-licudata' '-ldl' '-lm' '-lpugixml' '-lxapian' '-lmicrohttpd' '-lgcrypt' '-lgnutls' '/usr/lib/x86_64-linux-gnu/libz.so' '-Wl,-rpath' '-Wl,/usr/lib/x86_64-linux-gnu' '-lp11-kit' '-lgmp' '-lhogweed' '-lgmp' '-lnettle' '-ltasn1' '-lidn' '-lp11-kit' '-lz' '-lctpp2' '-lz' 
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libicuuc.a(putil.ao): In function `uprv_dl_open_55':
(.text+0x18c2): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lxapian
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libz.so'
collect2: error: ld returned 1 exit status
[10/14] Linking target src/installer/kiwix-install
FAILED: src/installer/kiwix-install 
c++    -o src/installer/kiwix-install 'src/installer/kiwix-install@exe/kiwix-install.cpp.o' '-L/usr/local/lib/x86_64-linux-gnu' '-L/usr/local/lib/pugixml-1.8' '-L/usr/local/lib' '-Wl,--no-undefined' '-Wl,--as-needed' '-static-libstdc++' '--static' '-pthread' '-lkiwix' '-lzim' '-llzma' '-licui18n' '-licuuc' '-licudata' '-ldl' '-lm' '-lpugixml' '-lxapian' '-lmicrohttpd' '-lgcrypt' '-lgnutls' '/usr/lib/x86_64-linux-gnu/libz.so' '-Wl,-rpath' '-Wl,/usr/lib/x86_64-linux-gnu' '-lp11-kit' '-lgmp' '-lhogweed' '-lgmp' '-lnettle' '-ltasn1' '-lidn' '-lp11-kit' '-lz' '-lctpp2' '-lz' 
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libicuuc.a(putil.ao): In function `uprv_dl_open_55':
(.text+0x18c2): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lxapian
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libz.so'
collect2: error: ld returned 1 exit status
[11/14] Compiling cpp object 'src/server/kiwix-serve@exe/kiwix-serve.cpp.o'
../src/server/kiwix-serve.cpp: In function ‘MHD_Response* build_response(const void*, unsigned int, const string&, const string&, bool, bool)’:
../src/server/kiwix-serve.cpp:200:36: warning: ‘MHD_Response* MHD_create_response_from_data(size_t, void*, int, int)’ is deprecated [-Wdeprecated-declarations]
   struct MHD_Response * response = MHD_create_response_from_data(length,
                                    ^
In file included from ../src/server/kiwix-serve.cpp:74:0:
/usr/include/microhttpd.h:2022:1: note: declared here
 MHD_create_response_from_data (size_t size,
 ^
../src/server/kiwix-serve.cpp:200:36: warning: ‘MHD_Response* MHD_create_response_from_data(size_t, void*, int, int)’ is deprecated [-Wdeprecated-declarations]
   struct MHD_Response * response = MHD_create_response_from_data(length,
                                    ^
In file included from ../src/server/kiwix-serve.cpp:74:0:
/usr/include/microhttpd.h:2022:1: note: declared here
 MHD_create_response_from_data (size_t size,
 ^
../src/server/kiwix-serve.cpp:203:73: warning: ‘MHD_Response* MHD_create_response_from_data(size_t, void*, int, int)’ is deprecated [-Wdeprecated-declarations]
                                                                  MHD_YES);
                                                                         ^
In file included from ../src/server/kiwix-serve.cpp:74:0:
/usr/include/microhttpd.h:2022:1: note: declared here
 MHD_create_response_from_data (size_t size,
 ^
../src/server/kiwix-serve.cpp: In function ‘MHD_Response* handle_random(MHD_Connection*, int&, kiwix::Reader*, kiwix::Searcher*, const string&, const string&, bool)’:
../src/server/kiwix-serve.cpp:429:8: warning: unused variable ‘cacheEnabled’ [-Wunused-variable]
   bool cacheEnabled = false;
        ^
../src/server/kiwix-serve.cpp: In function ‘MHD_Response* handle_content(MHD_Connection*, int&, kiwix::Reader*, kiwix::Searcher*, const string&, const string&, bool)’:
../src/server/kiwix-serve.cpp:452:16: warning: unused variable ‘contentLength’ [-Wunused-variable]
   unsigned int contentLength;
                ^
../src/server/kiwix-serve.cpp: In function ‘int accessHandlerCallback(void*, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**)’:
../src/server/kiwix-serve.cpp:596:14: warning: unused variable ‘acceptRange’ [-Wunused-variable]
   const bool acceptRange = acceptRangeHeaderValue != NULL;
              ^
../src/server/kiwix-serve.cpp: In function ‘int main(int, char**)’:
../src/server/kiwix-serve.cpp:959:10: warning: unused variable ‘host’ [-Wunused-variable]
     char host[NI_MAXHOST];
          ^
[12/14] Compiling cpp object 'src/server/kiwix-serve@exe/static_server_server-resources.cpp.o'
ninja: build stopped: subcommand failed.

from libkiwix.

mgautierfr avatar mgautierfr commented on July 22, 2024

I see two errors :

  • It cannot find xapian
  • It try to link with /usr/lib/x86_64-linux-gnu/libz.so

For the first one : How have you installed xapian ?
For the second one, this is a bug in the pgkconfig file gnutls.pc provided by ubuntu package. It include a direct path to the .so file and so break the static compilation. gnutls is a dependency of libmicrohttpd.
I've opened a bug for this (https://bugs.launchpad.net/ubuntu/+source/gnutls28/+bug/1660915) but for now, you must compile you're own version of libmicrohttpd without gnutls.

from libkiwix.

kelson42 avatar kelson42 commented on July 22, 2024

@mgautierfr

I have installed Xapian 1.4.2 manually

$ xapian-config --version
xapian-config - xapian-core 1.4.2

For libz, I think this should be added directly as a dependency of kiwix-tools/kiwix-serve, as kiwix-serve uses the zlib directly to compress content with deflate.

from libkiwix.

kelson42 avatar kelson42 commented on July 22, 2024

@mgautierfr Everything seems to work fine now. Thanks for your help.

from libkiwix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.