<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Renzhi,<div class=""><br class=""></div><div class="">106 MB does seem a bit large for a static build of NCL; most of our static builds end up around 50 MB (although we do not run the strip command).</div><div class=""><br class=""></div><div class="">Unfortunately, I don’t think you’ll be able to get it much smaller than 28 MB. NCL itself contains many components (graphics, computational routines, file I/O, etc), which will require a certain minimum amount of disk space.</div><div class=""><br class=""></div><div class="">As for the shared libraries, most of the libraries listed in your “ldd ncl” output are either direct dependencies of NCL or are required by one of the direct dependencies. You could theoretically statically link against some of those libraries (if the appropriate *.a files exist), although <i class="">this will increase the size of your final NCL binary</i>.</div><div class=""><br class=""></div><div class="">If you do wish to prioritize static libraries over shared, you can modify some of the <font face="Menlo" class="">#define</font> statements in the file <font face="Menlo" class="">$nclsrc/config/Project</font>. For example, on my machine I do the following for cairo:</div><div class="">original:</div><div class=""><font face="Menlo" class="">#define CAIROlib -lcairo -lXrender -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -liconv -lbz2</font></div><div class=""><br class=""></div><div class="">modified:</div><div class=""><font face="Menlo" class="">#define CAIROlib /Users/hallock/dev/external/lib/libcairo.a -lfontconfig /Users/hallock/dev/external/lib/libpixman-1.a /Users/hallock/dev/external/lib/libfreetype.a /Users/hallock/dev/external/lib/libexpat.a /Users/hallock/dev/external/lib/libpng.a -lz -liconv -lXrender -lbz2</font></div><div class=""><br class=""></div><div class="">However, instead of modifying the <font face="Menlo" class="">Project</font> file directly, I would recommend adding these <font face="Menlo" class="">#define</font> statements to your <font face="Menlo" class="">$nclsrc/config/Site.local</font> file as it will override the defaults in <font face="Menlo" class="">Project</font>. The <font face="Menlo" class="">Project</font> file should just be used as a reference for which macros need to be redefined.</div><div class=""><br class=""></div><div class="">I hope this helps,</div><div class="">Kevin</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Mar 30, 2018, at 9:56 AM, 王忍之 via ncl-install <<a href="mailto:ncl-install@ucar.edu" class="">ncl-install@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear NCL Developer:</div><div class=""><br class=""></div><div class=""> I have build ncl 6.4.0 at openSUSE Tumbleweed. gcc version is 7.3.1 . Most of library have been compiled statically.</div><div class=""> such as netcdf 4.5.0, hdf5-1.8.20, hdf, hdf-eos, gdal ..and etc.</div><div class=""><br class=""></div><div class=""> But I fonud ncl binary file is too big (106MB), so I use 'strip' command reduced ncl size. Finally it only have 28MB.</div><div class=""><br class=""></div><div class=""> And I run 'ldd ncl' command . it's output:</div><div class=""><br class=""></div><div class=""> <span style="white-space: pre;" class=""> </span>linux-vdso.so.1 (0x00007ffc6b8fb000)</div><div class=""><span style="white-space:pre" class=""> </span>libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007feb1402a000)</div><div class=""><span style="white-space:pre" class=""> </span>libz.so.1 => /lib64/libz.so.1 (0x00007feb13e13000)</div><div class=""><span style="white-space:pre" class=""> </span>liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007feb13c04000)</div><div class=""><span style="white-space:pre" class=""> </span>libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2 (0x00007feb139b0000)</div><div class=""><span style="white-space:pre" class=""> </span>libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007feb1377e000)</div><div class=""><span style="white-space:pre" class=""> </span>libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007feb1354c000)</div><div class=""><span style="white-space:pre" class=""> </span>libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007feb13308000)</div><div class=""><span style="white-space:pre" class=""> </span>libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007feb12fd2000)</div><div class=""><span style="white-space:pre" class=""> </span>libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007feb12dc7000)</div><div class=""><span style="white-space:pre" class=""> </span>libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007feb12b82000)</div><div class=""><span style="white-space:pre" class=""> </span>libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007feb128dc000)</div><div class=""><span style="white-space:pre" class=""> </span>libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007feb12635000)</div><div class=""><span style="white-space:pre" class=""> </span>libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00007feb12418000)</div><div class=""><span style="white-space:pre" class=""> </span>libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007feb120d7000)</div><div class=""><span style="white-space:pre" class=""> </span>libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007feb11ec5000)</div><div class=""><span style="white-space:pre" class=""> </span>libgfortran.so.4 => /usr/lib64/libgfortran.so.4 (0x00007feb11af1000)</div><div class=""><span style="white-space:pre" class=""> </span>libm.so.6 => /lib64/libm.so.6 (0x00007feb1175e000)</div><div class=""><span style="white-space:pre" class=""> </span>libdl.so.2 => /lib64/libdl.so.2 (0x00007feb1155a000)</div><div class=""><span style="white-space:pre" class=""> </span>libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007feb111d1000)</div><div class=""><span style="white-space:pre" class=""> </span>libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007feb10fa1000)</div><div class=""><span style="white-space:pre" class=""> </span>libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feb10d89000)</div><div class=""><span style="white-space:pre" class=""> </span>libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feb10b6a000)</div><div class=""><span style="white-space:pre" class=""> </span>libc.so.6 => /lib64/libc.so.6 (0x00007feb107ac000)</div><div class=""><span style="white-space:pre" class=""> </span>libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feb10595000)</div><div class=""><span style="white-space:pre" class=""> </span>libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007feb10378000)</div><div class=""><span style="white-space:pre" class=""> </span>libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007feb1010d000)</div><div class=""><span style="white-space:pre" class=""> </span>libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007feb0fc83000)</div><div class=""><span style="white-space:pre" class=""> </span>libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007feb0fa38000)</div><div class=""><span style="white-space:pre" class=""> </span>libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007feb0f825000)</div><div class=""><span style="white-space:pre" class=""> </span>libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007feb0f621000)</div><div class=""><span style="white-space:pre" class=""> </span>libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007feb0f3f8000)</div><div class=""><span style="white-space:pre" class=""> </span>libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007feb0f1ea000)</div><div class=""><span style="white-space:pre" class=""> </span>libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007feb0ef59000)</div><div class=""><span style="white-space:pre" class=""> </span>librt.so.1 => /lib64/librt.so.1 (0x00007feb0ed51000)</div><div class=""><span style="white-space:pre" class=""> </span>/lib64/ld-linux-x86-64.so.2 (0x00007feb14293000)</div><div class=""><span style="white-space:pre" class=""> </span>libquadmath.so.0 => /usr/lib64/libquadmath.so.0 (0x00007feb0eb11000)</div><div class=""><span style="white-space:pre" class=""> </span>libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007feb0e837000)</div><div class=""><span style="white-space:pre" class=""> </span>libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007feb0e605000)</div><div class=""><span style="white-space:pre" class=""> </span>libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feb0e401000)</div><div class=""><span style="white-space:pre" class=""> </span>libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007feb0e1f4000)</div><div class=""><span style="white-space:pre" class=""> </span>libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007feb0df3e000)</div><div class=""><span style="white-space:pre" class=""> </span>libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007feb0dd3a000)</div><div class=""><span style="white-space:pre" class=""> </span>libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007feb0db08000)</div><div class=""><span style="white-space:pre" class=""> </span>libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 (0x00007feb0d904000)</div><div class=""><span style="white-space:pre" class=""> </span>libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feb0d6db000)</div><div class=""><span style="white-space:pre" class=""> </span>libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007feb0d44e000)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> I compared with precompiled binaries. it need too more shared library .So Can you help me how to reduce 'ncl' dependent dynamic library? </div><div class=""><br class=""></div><div class=""> </div><table class="gt-baf-table" style="border-spacing: 0px; color: rgb(119, 119, 119); font-family: arial, sans-serif; font-size: 13px;"><tbody class=""><tr class=""><td colspan="2" style="padding: 0px;" class=""><div class="gt-baf-cell"><span class="gt-baf-word-clickable" style="height: 18px; cursor: pointer; vertical-align: top; white-space: nowrap; unicode-bidi: embed; margin: 1px 0px 0px 4px;"> Builded NCL is work well at present. </span></div></td><td style="padding: 0px; width: 520px;" class=""></td></tr></tbody></table><h1 style="margin: 5px 0px 0px -5px; padding: 5px; font-size: 20pt; line-height: 22pt; font-family: "lucida sans", verdana, arial, sans-serif; color: rgb(2, 83, 143); clear: both;" class=""><br class=""></h1><div class="">Sincerely</div><div class="">Renzhi Wang</div>_______________________________________________<br class="">ncl-install mailing list<br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-install" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-install</a><br class=""></div></blockquote></div><br class=""></div></body></html>