Bug 80271 - Error: $LANG contains an unknown character set when compiling a Motif Application with OpenMotif 2.1.30 and Metrolink Motif 1.2.4/2.01
Error: $LANG contains an unknown character set when compiling a Motif Applica...
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: openmotif (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
Brian Brock
http://www.bpa.gov/
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-23 13:21 EST by John Schaad
Modified: 2007-04-18 12:49 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-03-03 20:39:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Schaad 2002-12-23 13:21:49 EST
Description of problem:
This application has compiled successfully on Redhat 5.x, 6.x, 7.0, 7.1, and 
7.2 with Metrolink Motif 1.2.4/2.01 and most recently on Redhat 7.2 with 
OpenMotif 2.1.30.

However, starting with Redhat 7.3 and now with Redhat 8.0, there was some 
change made in the Redhat Distribution that causes the UID compile error 
described below.  I have tested it with both Metrolink Motif 1.2.4/2.01 and 
OpenMotif 2.1.30 and the result is the same.

Specific Error Message:
-----------------------------------------------
Error: $LANG contains an unknown character set

Info: no UID file was produced

Info: errors: 1  warnings: 0  informationals: 1
make: *** [gui.uid] Error 1
-----------------------------------------------


Version-Release number of selected component (if applicable):
Both Redhat 7.3 and 8.0

How reproducible:
Everytime

Steps to Reproduce:
1.  make -f gui.make
2.
3.
    
Actual results:
Compile Command Sequence:

[root@localhost exe]# make -f gui.make
/usr/bin/gcc -O4 -DTOP_DOWN -DOSF_2_0 -DIPFCONSTOK -DUNDERSCORE -DX_LOCALE -o gu
i gui.o -g -L../gui -L../ipc -L/usr/X11R6/lib -lgui -lipc -lMrm -lXm -lXpm -lXmu
 -lXt -lXext -lX11 -lSM -lICE -lm 
../gui/libgui.a(pf_cb.o): In function `print_plot':
/shr/ipf-3.27/gui/pf_cb.c:4277: the use of `tmpnam' is dangerous, better use 
`mkstemp'
size gui
   text    data     bss     dec     hex filename
 444540   44552 1532224 2021316  1ed7c4 gui
/usr/X11R6/bin/uil -I/usr/X11R6/include/uil -I../gui -I/usr/X11R6/include/uil -o
 gui.uid gui.uil

Error: $LANG contains an unknown character set

Info: no UID file was produced

Info: errors: 1  warnings: 0  informationals: 1
make: *** [gui.uid] Error 1
[root@localhost exe]# ls -l gui
-rwxr-xr-x    1 root     root      1329616 May 25 08:31 gui

[root@localhost exe]# 


Expected results:
A gui.uid file should have been created, so that the program "gui" will run.

Additional info:
Here it is again, also see web link below describing the application:

[root@localhost exe]# make -f gui.make
/usr/bin/gcc -O4 -DTOP_DOWN -DOSF_2_0 -DIPFCONSTOK -DUNDERSCORE -DX_LOCALE -o gu
i gui.o -g -L../gui -L../ipc -L/usr/X11R6/lib -lgui -lipc -lMrm -lXm -lXpm -lXmu
 -lXt -lXext -lX11 -lSM -lICE -lm 
../gui/libgui.a(pf_cb.o): In function `print_plot':
/shr/ipf-3.27/gui/pf_cb.c:4277: the use of `tmpnam' is dangerous, better use 
`mkstemp'
size gui
   text    data     bss     dec     hex filename
 444540   44552 1532224 2021316  1ed7c4 gui
/usr/X11R6/bin/uil -I/usr/X11R6/include/uil -I../gui -I/usr/X11R6/include/uil -o
 gui.uid gui.uil

Error: $LANG contains an unknown character set

Info: no UID file was produced

Info: errors: 1  warnings: 0  informationals: 1
make: *** [gui.uid] Error 1
[root@localhost exe]# ls -l gui
-rwxr-xr-x    1 root     root      1329616 May 25 08:31 gui

[root@localhost exe]# 

---------------------------------

Here is a web page where you can see the application and download the source 
code, if you would like to try it:

http://www.efn.org/~jschaad/ipf-1.html

I have posted warnings to users that it will not work with Redhat 7.3 or 8.0.
Comment 1 Arjan van de Ven 2002-12-23 13:31:38 EST
how is this a kernel bug ?
Comment 2 John Schaad 2002-12-23 13:41:23 EST
How is this a kernel bug?.... I do not know...

I have no idea what component it is related to, so I had to guess...in order to 
submit the bugzilla form..... (the form says to guess, if I do not know)

The problem started to appear with the Redhat 7.3 distribution, and tests have 
shown it to also appear with the 8.0 distribution

You would know more about it than I would....
Comment 3 Thomas Woerner 2003-01-02 09:06:59 EST
1) What does $LANG contain?

2) The links on your web-page are broken.
Comment 4 John Schaad 2003-01-06 14:20:25 EST
"------- Additional Comments From twoerner@redhat.com  2003-01-02 09:06 -------"
1) What does $LANG contain?

I do not know.....  I think it is some library in the Linux distribution that 
is accessed by the Motif compiler.   

2) The links on your web-page are broken.
Sorry about that.  The file names for those few links changed when I came up 
with versions optimized for Standard 8x11-inch Letter Paper, and other versions 
for A4 - Metric Paper (for which I still have to add the links).  If you access 
the main FTP site using "gftp" or "wsftp", instead of a web brower, you will 
see all of the files available for download.  
ftp://ftp.bpa.gov/downloads/software

Comment 5 Thomas Woerner 2003-01-21 11:24:26 EST
Please have a look at openmotif-2.2.2-13 in rawhide - uil works for me, now.
Comment 6 John Schaad 2003-03-03 20:39:39 EST
This Error applies to both Redhat Linux 8.0 and 7.3 distributions:

Here is the solution:
SUMMARY OF SOLUTION FOR UIL COMPILE ERROR UNDER REDHAT LINUX 7.3 AND 8.0:

GUI UIL Compile Errors for IPF-3.27 and 3.31 under both Redhat 7.3 and 8.0:
I found the clues as to what went wrong when Redhat advanced to versions 7.3 
and 8.0.  

The compile error stated something to the effect that:

	"$LANG contains an unknown character set"  

As a  result, the UIL compilation fails.

I made some discoveries;

When I do the command, "man $LANG" I get the following for the various versions 
of Redhat Linux:

RH 5.2:  no entry for en_US
RH 6.0:  no entry for en_US
RH 6.1:  no entry for en_US
RH 6.2:  no entry for en_US
RH 7.0:  no entry for en_US
RH 7.1:  no entry for en_US
RH 7.2:  no entry for en_US
RH 7.3:  no entry for en_US.iso885915
RH 8.0:  no entry for en_US.UTF-8

When the particular RH Linux Distribution default value for $LANG was changed 
from "en_US" to some other variation of "en_US with an extension", the GUI UIL 
compile fails for all versions of Motif that I have tested.

When I do "updatedb" and then "locate" for "en_US", I see that there is a whole 
mix of different "defaults" in various locations, which are either "en_US" or 
in some places, one of the variations of "en_US with an extension" of some 
kind, such as en_US.iso885915 or en_US.UTP-8.

So, it appears that if there is some way to translate or link the value for 
$LANG to "en_US" instead of the default Redhat Distribution Version value, the 
UIL compile might work correctly.  Apparently, the Motif 1.2.4 and also the 
latest OpenMotif 2.1.30 and 2.2.x, all depend on the value of $LANG 
being "en_US", and not something else, for the compilation of the IPF GUI.

Then, I did some additional testing and made some discoveries:

Redhat 7.3:  The only thing needed was:  "csh", then "setenv LANG en_US".  
However, I had to stay in the csh shell to successfully compile the GUI/GUI.UIL 
with "make -f gui.make".  If I went back to the bash shell, it would revert to 
the original Redhat setting for $LANG, and it would not work.  I had been 
unable to find a successful way, so far to set LANG 
to "en_US"using .bash_profile or adding a command to the Makefile.   All the 
rest compiled with no errors.  Redhat 7.3 has gcc 2.96-110.

Redhat 8.0:  Using "csh", then "setenv LANG en_US", resulted in successfully 
compiling the GUI/GUI.UIL with "make -f gui.make".
  
The rest compiled with other errors that will have to be fixed in some other 
way.  Redhat 8.0 has gcc 3.2-7 instead of gcc 2.96-xxx.  It appears that there 
are major differences between gcc 2.96-110 and gcc 3.2-7, resulting in 
additional required fixes.

After reading "man env" and "info env", I learned that the following syntax 
would be correct for this case:

 Replace the command  "make -f gui.make" with "env LANG=en_US make -f 
gui.make"  This redefines the environment variable only for that command.  

 Within the file, gui.make, modify the UIL compile command (revisions preceed 
first $ sign).  This redefines the environment variable, permanently, as part 
of the make file.

#
# new  rule for compiling uil files under Redhat 7.3 and 8.0:
# add "env LANG=en_US " at the beginning of the UIL command line.
#

.uil.uid:
	env LANG=en_US $(UIL) $(UILFLAGS) $(UILINC) -o $*.uid $<


Note You need to log in before you can comment on or make changes to this bug.