PotreeConverter: locale::facet::_S_create_c_locale name not valid

Hi there! I am trying to make PotreeConverter work on MacOS 10.12. I have managed to compile it (with gcc6) but when I try to run it I get the following error:

PotreeConverter -h
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Abort trap: 6

Any ideas how to fix this problem?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 15

Most upvoted comments

So, after checking out various posts on similar issues I tried putting this in my .profile: export LC_ALL=C; unset LANGUAGE

and now it works 😃

in my case, I could not make it work with the previous 2 commands changing both LC_ALL and LANGUAGE

I had to edit the file /etc/locale.gen and uncomment the line

en_US.UTF-8 UTF-8

and finally run the command “sudo locale-gen”

I think this issue was closed too soon, changing the locale is a workaround and not a fix.

I got the same issue when running from python:3.7-alpine but I do not have the issue when running from alpine

alpine

FROM alpine


ENV POTREECONVERTER_BUILD_DIR /tmp/potreeconverter_build

RUN apk update && apk add --clean \
    g++ \
    git \
    cmake \
    build-base \
    boost-system \
    boost-thread \
    boost-filesystem \
    boost-program_options \
    boost-regex \
    boost-iostreams

WORKDIR ${POTREECONVERTER_BUILD_DIR}
RUN git clone https://github.com/m-schuetz/LAStools.git \
    && cd ${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip \
    && mkdir build \
    && cd build \
    && cmake -DCMAKE_BUILD_TYPE=Release .. \
    && make \
    && make install \
    && cd ${POTREECONVERTER_BUILD_DIR} \
    && git clone -b develop https://github.com/potree/PotreeConverter.git \
    && cp -R ${POTREECONVERTER_BUILD_DIR}/PotreeConverter/PotreeConverter/resources/ / \
    && mkdir PotreeConverter/build \
    && cd PotreeConverter/build \
    && cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DLASZIP_INCLUDE_DIRS=${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip/dll \
        -DLASZIP_LIBRARY=${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip/build/src/liblaszip.so \
        .. \
    && make \
    && make install \
    && rm -r ${POTREECONVERTER_BUILD_DIR}

WORKDIR /

RUN PotreeConverter
Step 7/7 : RUN PotreeConverter
 ---> Running in 269889febb35
  -i [ --source ]                        input files
  -h [ --help ]                          prints usage
  -p [ --generate-page ]                 Generates a ready to use web page with the given name.
  --page-template                        directory where the web page template is located.
  -o [ --outdir ]                        output directory
  -s [ --spacing ]                       Distance between points at root level. Distance halves each level.
  -d [ --spacing-by-diagonal-fraction ]  Maximum number of points on the diagonal in the first level (sets spacing). spacing = diagonal / value
  -l [ --levels ]                        Number of levels that will be generated. 0: only root, 1: root and its children, ...
  -f [ --input-format ]                  Input format. xyz: cartesian coordinates as floats, rgb: colors as numbers, i: intensity as number
  --color-range
  --intensity-range
  --output-format                        Output format can be BINARY, LAS or LAZ. Default is BINARY
  -a [ --output-attributes ]             can be any combination of RGB, INTENSITY and CLASSIFICATION. Default is RGB.
  --scale                                Scale of the X, Y, Z coordinate in LAS and LAZ files.
  --aabb                                 Bounding cube as "minX minY minZ maxX maxY maxZ". If not provided it is automatically computed
  --incremental                          Add new points to existing conversion
  --overwrite                            Replace existing conversion at target directory
  --source-listing-only                  Create a sources.json but no octree.
  --projection                           Specify projection in proj4 format.
  --list-of-files                        A text file containing a list of files to be converted.
  --source                               Source file. Can be LAS, LAZ, PTX or PLY
  --title                                Page title
  --description                          Description to be shown in the page.
  --edl-enabled                          Enable Eye-Dome-Lighting.
  --show-skybox
  --material                             RGB, ELEVATION, INTENSITY, INTENSITY_GRADIENT, CLASSIFICATION, RETURN_NUMBER, SOURCE, LEVEL_OF_DETAIL
  --store-size                           A node is split once more than store-size points are added. Reduce for better results at cost of performance. Default is 20000
  --flush-limit                          Flush after X points. Default is 10000000

python:3.7-alpine

FROM python:3.7-alpine


ENV POTREECONVERTER_BUILD_DIR /tmp/potreeconverter_build

RUN apk update && apk add --clean \
    g++ \
    git \
    cmake \
    build-base \
    boost-system \
    boost-thread \
    boost-filesystem \
    boost-program_options \
    boost-regex \
    boost-iostreams

WORKDIR ${POTREECONVERTER_BUILD_DIR}
RUN git clone https://github.com/m-schuetz/LAStools.git \
    && cd ${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip \
    && mkdir build \
    && cd build \
    && cmake -DCMAKE_BUILD_TYPE=Release .. \
    && make \
    && make install \
    && cd ${POTREECONVERTER_BUILD_DIR} \
    && git clone -b develop https://github.com/potree/PotreeConverter.git \
    && cp -R ${POTREECONVERTER_BUILD_DIR}/PotreeConverter/PotreeConverter/resources/ / \
    && mkdir PotreeConverter/build \
    && cd PotreeConverter/build \
    && cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DLASZIP_INCLUDE_DIRS=${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip/dll \
        -DLASZIP_LIBRARY=${POTREECONVERTER_BUILD_DIR}/LAStools/LASzip/build/src/liblaszip.so \
        .. \
    && make \
    && make install \
    && rm -r ${POTREECONVERTER_BUILD_DIR}

WORKDIR /

RUN PotreeConverter
Step 7/7 : RUN PotreeConverter
 ---> Running in da3f299cf1c2
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid