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

boost locale support #41

Closed
mlampros opened this issue May 5, 2017 · 4 comments
Closed

boost locale support #41

mlampros opened this issue May 5, 2017 · 4 comments

Comments

@mlampros
Copy link

mlampros commented May 5, 2017

First of all thank you for all your contributions especially for the Rcpp, RcppArmadillo and BH packages.

A few months back, I created a text processing package textTinyR using the boost library. Although I faced some problems due to the boost-locale, I partly overcame those by not using locale on Windows (I also came across a similar issue) and by adding a configure file for linux and macintosh (on macintosh it worked only for the latest release, Sierra). Last week I submitted an updated version to CRAN and I realized that it doesn't work for macintosh any more.

I wonder if it's possible to add full support for boost-locale in the BH package? In such a case I would restructure my package accordingly, so that it works on all OS's.

@eddelbuettel
Copy link
Owner

Quick question: Is that header-only? Can it be made header-only?

A few Boost library require linking, a few of those can be #ifdef'ed to remove some features to not require linking. But most examples still requiring linking are text / string related so I am not too hopeful here.

Can you try to find out some more details?

@mlampros
Copy link
Author

mlampros commented May 5, 2017

Besides the BH package I do include (for a unix OS) also the following,

#ifndef _WIN32
  #include <boost/locale.hpp>
#endif

As of boost 1.62 the boost/locale.hpp file includes the following:

#ifndef BOOST_LOCALE_HPP_INCLUDED
#define BOOST_LOCALE_HPP_INCLUDED

#include <boost/locale/boundary.hpp>
#include <boost/locale/collator.hpp>
#include <boost/locale/conversion.hpp>
#include <boost/locale/date_time.hpp>
#include <boost/locale/date_time_facet.hpp>
#include <boost/locale/encoding.hpp>
#include <boost/locale/format.hpp>
#include <boost/locale/formatting.hpp>
#include <boost/locale/generator.hpp>
#include <boost/locale/gnu_gettext.hpp>
#include <boost/locale/info.hpp>
#include <boost/locale/localization_backend.hpp>
#include <boost/locale/message.hpp>
#include <boost/locale/util.hpp>

#endif

The locale issue is apparent, for instance, when I try to convert non english text to lower/upper case.

@eddelbuettel
Copy link
Owner

That does not answer my question about the need for linking. Looking at your package I see

@LOCALE_LIBS@ -lboost_system

and that is a no-no for the BH package. No linking. Headers only.

@eddelbuettel
Copy link
Owner

And it is right in your own configure.ac as LOCALE_LIBS="-lboost_locale".

Sorry, can't do in BH. You can try to build on top of BH and shadow with local copies your package. Some stan related packages did that for a while, and we moved things which are in fact header-only over.

BH cannot give you all of Boost without linking. No Free Lunch. Sorry.

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

No branches or pull requests

2 participants