CaGe-graph / CaGe

The Chemical and abstract Graph environment
9 stars 2 forks source link

CaGe broken if system-locale uses a comma instead of a decimal point #1

Closed nvcleemp closed 10 years ago

nvcleemp commented 10 years ago

In the file read_graph.c the function sscanf is used to parse writegraph files. At some point it uses the format %lf to parse a double. If the locale uses a comma instead of a decimal point, this parses the wrong number. As a consequence, the dimension is incorrectly guessed and no graph is returned to CaGe.

nvcleemp commented 10 years ago

This causes the following error message in the user interface:

==========
java.io.IOException: embedder problem: graph data doesn't match format (parser)
        at cage.NativeEmbedEmbedder.nEmbed3D(Native Method)
        at cage.NativeEmbedEmbedder.embed3D(NativeEmbedEmbedder.java:287)
        at cage.EmbedThread.processTask(EmbedThread.java:85)
        at cage.EmbedThread.run(EmbedThread.java:36)

Context was 'embedding exception (graph 1, 3D)'.

Embedder produced no diagnostic output.
==========
nvcleemp commented 10 years ago

In the start-up script cage.sh we set the variable LANG to POSIX. This is apparently not sufficient on some systems. The relevant variable that also needs to be set is LC_NUMERIC. On most (?) systems this gets set automatically when LANG is set, but this is not always the case.