lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Environment variables and lmi


From: Greg Chicares
Subject: [lmi] Environment variables and lmi
Date: Fri, 31 May 2019 23:23:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

This command shows all the environment variables that are
important to set for lmi development work:

env |grep 'LMI\|PERFORM\|coeff\|^WINE\|^PATH\|LANG\|^LC_\|LESSCHAR'

The last several are significant even without lmi:
 - LANG and variables prefixed LC_ affect the locale: e.g., how
   dates and numbers are formatted, how lists are alphabetized,
   and even what "grep '[A-Z]'" does.
 - LESSCHAR affects output formatting for commands like 'git log'.
 - PATH determines how programs are found outside the current
   working directory.
 - Variables prefixed WINE are used only if you're running msw
   programs on a GNU/Linux system; otherwise they don't matter.
Those variables are important even if you're not building lmi.
Typically they are set, each time you open a terminal, to values
specified in a shell startup file such as ~/.zshrc . My own
personal startup script is in git as 'gwc/.zshrc'.

The others are specific to lmi:
 - LMI_COMPILER says which compiler to use (gcc, for example).
 - LMI_TRIPLET says what "architecture" you're building: e.g.,
   32-bit lmi for msw vs. 64-bit lmi for msw.
 - PERFORM, like variables prefixed WINE, matters only if you're
   running msw programs on a GNU/Linux system; it may safely be
   unset otherwise.
 - coefficiency says how many CPU cores to use. You never need
   to set it: if it's unset, then a reasonable default is used.

PATH is important with or without lmi. For lmi, it's set to a
special value that varies by operating system.

It is rarely necessary to set any environment variable by hand.
Any that aren't set in ~/.zshrc are set by 'set_toolchain.sh'.
Its leading comment explains its purpose:

# Set $PATH, $WINEPATH, and $PERFORM based on $LMI_COMPILER and $LMI_TRIPLET.

If you don't specify LMI_COMPILER and LMI_TRIPLET, then that
script sets them to defaults corresponding to the system
currently in production (gcc, 32-bit lmi for msw right now).
Then it sets all the other variables that matter to lmi.

If you want to switch between 32- and 64-bit builds, just copy
and paste the appropriate lines shown as comments in the script.
For example, to switch to 64-bit builds for msw, paste this into
a terminal:

  LMI_COMPILER=gcc ; LMI_TRIPLET=x86_64-w64-mingw32 ; . 
/opt/lmi/src/lmi/set_toolchain.sh

and this:

  LMI_COMPILER=gcc ; LMI_TRIPLET=i686-w64-mingw32 ; . 
/opt/lmi/src/lmi/set_toolchain.sh

to switch back to 32-bit builds for msw. If you're not switching
at all, and just want to use the current production build, you
can ignore this paragraph: you get what you want by default.

And if you only want the current production build, you should
never have to use the 'set_toolchain.sh' script or set any
environment variable by hand (although you probably want to set
the first group in ~/.zshrc). That's because all makefiles, and
various scripts, invoke 'set_toolchain.sh' automatically. Thus,
if you open a new terminal and immediately run the command above:

env |grep 'LMI\|PERFORM\|coeff\|^WINE\|^PATH\|LANG\|^LC_\|LESSCHAR'

then you probably won't see anything matching beginning with
LMI, PERFORM, coeff, or WINE. I myself see:

PATH=/usr/bin:/bin:/usr/sbin:/sbin
coefficiency=--jobs=32
LANG=en_US.UTF-8
LC_ALL=C.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE=C.UTF-8
LESSCHARSET=utf-8

But whenever you run 'make', those variables should be defined
nonetheless. I.e., even though they aren't defined in the global
environment described by 'env', they are defined for the duration
of a 'make' run. Try this:

  cd /opt/lmi/src/lmi
  make show_env

I see:

Internal make variables particular to lmi:

LMI_COMPILER = "gcc"
LMI_TRIPLET  = "i686-w64-mingw32"
coefficiency = "--jobs=32"
PATH         = 
"/opt/lmi/local/gcc_i686-w64-mingw32/bin:/opt/lmi/local/gcc_i686-w64-mingw32/lib:/usr/bin:/bin:/usr/sbin:/sbin"
WINEPATH     = 
"Z:\opt\lmi\local\gcc_i686-w64-mingw32\bin;Z:\opt\lmi\local\gcc_i686-w64-mingw32\lib;Z:\opt\lmi\third_party\bin"
PERFORM      = "wine"

but note that LMI_COMPILER and LMI_TRIPLET aren't (and needn't be)
set in the global environment (i.e., 'env' says they aren't there),
but everything you normally do should still work. Try this (after
you've built lmi, of course):

  cd /opt/lmi/bin
  ./lmi_wx_shared --ash_nazg --data_path=/opt/lmi/data

and it just works under msw (under GNU/Linux, you'd add 'wine').
So does this:

  cd /tmp
  /opt/lmi/src/lmi/nychthemeral_test.sh

(as long as you've already installed lmi's prerequisite libraries
with 'install_msw.sh'), and also this:

  cd ~
  /opt/lmi/src/lmi/gui_test.sh

(as long as you've already installed lmi), and in fact every '.sh'
script you should ever have a reason need to run.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]