Kenneth,

Would it be possible to add a "--static" flag to the build to explicitly
request "static linking or fail" behavior? If static linking is truly
desired, having to read lots of debug messages is a painful way of
verifying that you have a static binary.

Jon


On Mon, Aug 6, 2012 at 10:03 AM, Tom Hoar <
tah...@precisiontranslationtools.com> wrote:

>  Thanks Ken. I downloaded/compiled with the latest changes up to
>  BOOST_CHECK_CLOSE. The exit code 1 disappeared and everything seems
>  okay.
>
>  One more question. Other than the log output at compile time, is there
>  any way to query the Moses binary to see which libraries are statically
>  vs dynamically linked?
>
>  For example, a while back, someone on the list gave this command to
>  test if the binary was compiled --with-srilm, and there are others for
>  IRSTLM, RANDLM and KENLM.
>
>    nm -C "/path/to/moses" | grep "vtable for Moses::LanguageModelSRI"`
>
>  I tried the obvious two grep searches "static" and "dynamic" (below),
>  but they don't seem to relate to the libraries. Does anyone know a way
>  to find/test if libraries are dynamically or statically linked?
>
>  Thanks,
>  Tom
>
>
>  tahoar@library1:~/domy-2.5$ nm -C `which moses` | grep "static"
>  00000000005ddbc0 t __static_initialization_and_destruction_0(int, int)
>  00000000005de7c1 t __static_initialization_and_destruction_0(int, int)
>  00000000005ded37 t __static_initialization_and_destruction_0(int, int)
>  00000000005e0067 t __static_initialization_and_destruction_0(int, int)
>  00000000005e2fc6 t __static_initialization_and_destruction_0(int, int)
>  00000000005ecae3 t __static_initialization_and_destruction_0(int, int)
>  00000000005ef140 t __static_initialization_and_destruction_0(int, int)
>  00000000005f475f t __static_initialization_and_destruction_0(int, int)
>  00000000005f4cd9 t __static_initialization_and_destruction_0(int, int)
>  00000000005f5e53 t __static_initialization_and_destruction_0(int, int)
>  00000000005f6f8e t __static_initialization_and_destruction_0(int, int)
>  00000000005f7183 t __static_initialization_and_destruction_0(int, int)
>  0000000000883cc0 d static_bl_desc
>  0000000000883ca0 d static_d_desc
>  0000000000610680 r static_dtree
>  0000000000883c80 d static_l_desc
>  0000000000610200 r static_ltree
>
>  tahoar@library1:~/domy-2.5$ nm -C `which moses` | grep "dynamic"
>  0000000000570c50 W
>  boost::unordered_detail::hash_table_unique_keys<std::pair<float const,
>  boost::dynamic_bitset<unsigned long, std::allocator<unsigned long> > >,
>  float, boost::hash<float>, std::equal_to<float>,
>  std::allocator<std::pair<float const, boost::dynamic_bitset<unsigned
>  long, std::allocator<unsigned long> > > > >::operator[](float const&)
>  000000000057baf0 W
>
>  
> boost::unordered_detail::hash_table_data_unique_keys<std::allocator<std::pair<std::pair<unsigned
>  char, unsigned char> const, boost::dynamic_bitset<unsigned long,
>  std::allocator<unsigned long> > > > >::~hash_table_data_unique_keys()
>  0000000000570af0 W
>
>  
> boost::unordered_detail::hash_table_data_unique_keys<std::allocator<std::pair<float
>  const, boost::dynamic_bitset<unsigned long, std::allocator<unsigned
>  long> > > > >::create_buckets()
>  0000000000570c00 W
>
>  
> boost::unordered_detail::hash_table_data_unique_keys<std::allocator<std::pair<float
>  const, boost::dynamic_bitset<unsigned long, std::allocator<unsigned
>  long> > > > >::node_constructor::~node_constructor()
>  0000000000570b70 W
>
>  
> boost::unordered_detail::hash_table_data_unique_keys<std::allocator<std::pair<float
>  const, boost::dynamic_bitset<unsigned long, std::allocator<unsigned
>  long> > > > >::~hash_table_data_unique_keys()
>  000000000057ba60 W
>
>  
> boost::unordered_detail::hash_table_data_unique_keys<std::allocator<std::pair<unsigned
>  int const, boost::dynamic_bitset<unsigned long, std::allocator<unsigned
>  long> > > > >::~hash_table_data_unique_keys()
>                   U __dynamic_cast@@CXXABI_1.3
>
>
>
>
>  On Mon, 06 Aug 2012 08:20:00 -0400, Kenneth Heafield
>  <mo...@kheafield.com> wrote:
> > Hi,
> >
> > You're correct.  There doesn't seem to be a static version of this
> > library.  I've added the --nosegfault option (which isn't as cool as
> > it sounds) to skip this library.
> >
> > Kenneth
> >
> > On 08/06/2012 02:08 AM, Tom Hoar wrote:
> >> I read the comment "In order to obtain a fully static Moses, every
> >> g++
> >> command line that includes "-static" must pass with exit code 0."
> >> with
> >> interest.
> >>
> >> When we compile moses, this log output line shows an exit code 1.
> >> All
> >> the others are 0.
> >>
> >> bash -c "g++ -static -lSegFault -x c++ - <<<'int main() {}' -o
> >> /dev/null
> >>  >/dev/null 2>/dev/null"
> >> 1
> >>
> >> Any suggestions as to what's missing/how to correct so we have a
> >> fully-static Moses?
> >>
> >> Thanks,
> >> Tom
> >>
> >>
> >>
> >> On Fri, 03 Aug 2012 18:13:47 -0400, Kenneth Heafield
> >> <mo...@kheafield.com> wrote:
> >>> Hi,
> >>>
> >>> Moses attempts to link statically by default but falls back to
> >>> dynamic
> >>> links. You must have static versions of all the dependencies
> >>> installed
> >>> as well. Run
> >>>
> >>> bjam --debug-configuration
> >>>
> >>> and, near the top, it will show you some command lines followed by
> >>> their
> >>> exit code. In order to obtain a fully static Moses, every g++
> >>> command
> >>> line that includes "-static" must pass with exit code 0.
> >>>
> >>> Kenneth
>
> _______________________________________________
> Moses-support mailing list
> Moses-support@mit.edu
> http://mailman.mit.edu/mailman/listinfo/moses-support
>
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to