Difference between revisions of "Environment Variables"

(Improvements on ISE_LIBRARY)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler utilizes a number of environment and other localized variables. This page is dedicated to those variables, how they are defined and what they mean.
 
[[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler utilizes a number of environment and other localized variables. This page is dedicated to those variables, how they are defined and what they mean.
  
{{Note|There is a special notion called "[[LinuxUnixLayout|Unix Layout]]" in regards to special builds of [[:Category:EiffelStudio|EiffelStudio]]. When using a [[LinuxUnixLayout|Unix layout]] '''no environment variables''' are utilized because of the fragmented distribution of installed files. For such layouts this page provides no contribution to understanding [[:Category:EiffelStudio|EiffelStudio]].
+
{{Note|There is a special notion called "[[LinuxUnixLayout|Unix Layout]]" in regards to special builds of [[:Category:EiffelStudio|EiffelStudio]]. When using a [[LinuxUnixLayout|Unix layout]] '''no environment variables''' are used because of the fragmented distribution of installed files. For such layouts this page provides no contribution to understanding [[:Category:EiffelStudio|EiffelStudio]].
  
Unix layouts are utilized by package managers. See [[Linux Packages|here]] for supported package managers.}}
+
Unix layouts are used by package managers. See [[Linux Packages|here]] for supported package managers.}}
  
 
Unless otherwise stated, all the following environment variables are known by the Eiffel environment at run time.
 
Unless otherwise stated, all the following environment variables are known by the Eiffel environment at run time.
Line 10: Line 10:
 
The core variables are the Eiffel compiler variables that absolutely must be defined for the [[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler to function. Without them the Eiffel environment has no idea where it is or what platform binaries to load.
 
The core variables are the Eiffel compiler variables that absolutely must be defined for the [[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler to function. Without them the Eiffel environment has no idea where it is or what platform binaries to load.
  
'''ISE_EIFFEL''': The holy grail of everything Eiffel, the only difference being is that this variable can be found! The value should point to the root of the [[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler installation.
+
* '''ISE_EIFFEL''': The holy grail of everything Eiffel, the only difference being is that this variable can be found! The value should point to the root of the [[:Category:EiffelStudio|EiffelStudio]]/Eiffel compiler installation.
 
+
* '''ISE_PLATFORM''': Represents the named platform on which the Eiffel environment is running. Below is a list of compatible platform names:
'''ISE_PLATFORM''': Represents the named platform on which the Eiffel environment is running. Below is a list of compatible platform names:
+
** freebsd-x86-64
 
+
** freebsd-x86
* freebsd-x86-64
+
** irix-mips-64
 
+
** irix-mips
* freebsd-x86
+
** linux-ppc
 
+
** linux-sparc
* irix-mips-64
+
** linux-x86-64
 
+
** linux-x86
* irix-mips
+
** macosx-x86
 
+
** macosx-x86-64
* linux-ppc
+
** openbsd-x86
 
+
** solaris-sparc-64
* linux-sparc
+
** solaris-sparc
 
+
** solaris-x86-64
* linux-x86-64
+
** solaris-x86
 
+
** win64
* linux-x86
+
** windows
 
+
* macosx-x86
+
 
+
* macosx-x86-64
+
 
+
* openbsd-x86
+
 
+
* solaris-sparc-64
+
 
+
* solaris-sparc
+
 
+
* solaris-x86-64
+
 
+
* solaris-x86
+
 
+
* win64
+
 
+
* windows
+
  
 
=== Windows Variables ===
 
=== Windows Variables ===
 
Under Microsoft's Windows an extra variable is required, dictating the external C compiler used by the Eiffel environment. Like the core variables, this variable must be defined in order for an Eiffel environment to run.
 
Under Microsoft's Windows an extra variable is required, dictating the external C compiler used by the Eiffel environment. Like the core variables, this variable must be defined in order for an Eiffel environment to run.
  
'''ISE_C_COMPILER''': The noted and installed C compiler used by the Eiffel compiler to perform C/C++ compilation and to locate the compatible external libraries. Below is a list of compatible C compiler names:
+
* '''ISE_C_COMPILER''': The noted and installed C compiler used by the Eiffel compiler to perform C/C++ compilation and to locate the compatible external libraries. Below is a list of compatible C compiler names:
 
+
** ''msc'': Any supported [[Installing Microsoft C compiler|Microsoft Visual C/C++]] compiler prior to Visual Studio C++ 2015.
* ''msc'': Any supported [[Installing Microsoft C compiler|Microsoft Visual C/C++]] compiler.
+
** ''msc_vc140'': Visual Studio C++ 2015 or later.
* ''mingw'': The open source [http://www.mingw.org MinGW] C/C++ compiler, which at the time of writing is only available as a stable release for x86.
+
** ''mingw'': The open source [http://www.mingw.org MinGW] C/C++ compiler, which at the time of writing is only available as a stable release for x86.
* ''bcb'': The Free Borland 5.5 C++ compiler which is now deprecated and should not be used.
+
** ''bcb'': The Free Borland 5.5 C++ compiler which is now deprecated and should not be used.
  
 
== Optional Variables ==
 
== Optional Variables ==
Line 61: Line 43:
 
In addition to the core variables, there are a number of optional variables that can be defined to replace predefined values set by the Eiffel environments.
 
In addition to the core variables, there are a number of optional variables that can be defined to replace predefined values set by the Eiffel environments.
  
'''ISE_CFLAGS''': C compilation flags that are passed to the C compiler.
+
* '''ISE_LIBRARY''': Points to an alternative location for library source files. By default this is automatically set by EiffelStudio to the same location as [[#Core Variables|ISE_EIFFEL]]. This is usually set explicitly when you are checking out the source code directly.
  
'''ISE_SHAREDLIBS''': Some additional C/C++ libraries that are passed to the C/C++ linker. It can also be used to pass linker flags.
+
* '''ISE_PRECOMP''': The location of the Eiffel environment precompiled libraries. By default, this is automatically set by EiffelStudio to a user specific location which vary depending on the platform.
  
'''ISE_LIBRARY''': Points to an alternative location for library source files. By default this is automatically set by EiffelStudio to the same location as [[#Core Variables|ISE_EIFFEL]]. This is usually set explicitly when you are checking out the source code directly.
+
* '''ISE_CFLAGS''': C compilation flags that are passed to the C compiler. We recommend not using it but instead set the C compilation flags as part of your Eiffel Configuration File.
  
'''ISE_PRECOMP''': The location of the Eiffel environment precompiled libraries [[ConfigurationFileFormat|configuration files]].
+
* '''ISE_SHAREDLIBS''': Some additional C/C++ libraries that are passed to the C/C++ linker. It can also be used to pass linker flags. Like '''ISE_CFLAGS''', we recommend not using it but instead set the C compilation flags as part of your Eiffel Configuration File.
  
'''ISE_APP_DATA''': Location of the Eiffel environment configuration data, such as project settings data and session configuration data. This configuration data is hidden, managed by [[:Category:EiffelStudio|EiffelStudio]] and should not be manipulated manually.
+
* '''ISE_APP_DATA''': Location of the Eiffel environment configuration data, such as project settings data and session configuration data. This configuration data is hidden, managed by [[:Category:EiffelStudio|EiffelStudio]] and should not be manipulated manually.
  
'''ISE_USER_FILES''': Points to the location of Eiffel environment user files like the default projects location, user [[Code Templates|code templates]] and Eiffel environment [[Replaceable_User_Files|Replaceable User Files]].
+
* '''ISE_USER_FILES''': Points to the location of Eiffel environment user files like the default projects location, user [[Code Templates|code templates]] and Eiffel environment [[Replaceable_User_Files|Replaceable User Files]].
  
 
=== Auxiliary Variables ===
 
=== Auxiliary Variables ===
 
The following environment variables are defined when working with Eiffel environment sources. There is no internal knowledge of the following environment variables; they are used for configuration and compilation only.
 
The following environment variables are defined when working with Eiffel environment sources. There is no internal knowledge of the following environment variables; they are used for configuration and compilation only.
  
'''EIFFEL_SRC''': When working with the live Eiffel sources, EIFFEL_SRC points to the checked out /trunk/Src location.
+
* '''EIFFEL_SRC''': When working with the live Eiffel sources, EIFFEL_SRC points to the checked out /trunk/Src location.
  
'''ISE_SRC''': This environment variable is used to point to the ISE internal repository containing non-GPL code. The variable points to /trunk/Src of the internal repository.
+
* '''ISE_SRC''': This environment variable is used to point to the ISE internal repository containing non-GPL code. The variable points to /trunk/Src of the internal repository.
  
 
== Windows Localization ==
 
== Windows Localization ==
Line 96: Line 78:
 
User variables, available only to the currently logged on user, are found under the key:
 
User variables, available only to the currently logged on user, are found under the key:
  
  HKCU\Software\ISE\Eiffel''XX''\''app_name''
+
  HKCU\Software\ISE\Eiffel_''YY.MM''\''app_name''
  
This is the very first place any Eiffel system will look for a local variable. For instance, [[:Category:EiffelStudio|EiffelStudio]] and the Eiffel compiler are bundled in the executable ''ec.exe''. For release X.Y, built with a X.Y Eiffel compiler, ec.exe will first look for variables under:
+
This is the very first place any Eiffel system will look for a local variable. For instance, [[:Category:EiffelStudio|EiffelStudio]] and the Eiffel compiler are bundled in the executable ''ec.exe''. For release YY.MM built with a YY.MM Eiffel compiler, ec.exe will first look for variables under:
  
  HKCU\Software\ISE\EiffelXY\ec
+
  HKCU\Software\ISE\Eiffel_YY.MM\ec
  
 
Failing to find any variable under this key, the system will default to looking at the compiled version key (the version of the Eiffel compiler the system was compiled with.) Using the same example, the following key will be examined:
 
Failing to find any variable under this key, the system will default to looking at the compiled version key (the version of the Eiffel compiler the system was compiled with.) Using the same example, the following key will be examined:
  
  HKCU\Software\ISE\EiffelXY
+
  HKCU\Software\ISE\Eiffel_YY.MM
  
 
Again failing to locate a matching variable name, the system will proceed to check the local machine hive, using the same rules as used by the current user hive.
 
Again failing to locate a matching variable name, the system will proceed to check the local machine hive, using the same rules as used by the current user hive.
  
  HKLM\Software\ISE\Eiffel''XX''\''app_name''
+
  HKLM\Software\ISE\Eiffel_''YY.MM''\''app_name''
  
 
Using the same example. the application specific key at will be searched next:
 
Using the same example. the application specific key at will be searched next:
  
  HKLM\Software\ISE\EiffelXY\ec
+
  HKLM\Software\ISE\Eiffel_YY.MM\ec
  
 
And failing to find any matching variable the compiled version key will be the last place looked under:
 
And failing to find any matching variable the compiled version key will be the last place looked under:
  
  HKLM\Software\ISE\EiffelXY
+
  HKLM\Software\ISE\Eiffel_YY.MM
  
 
To sum up, here is the list of searched locations. ordered by priority for retrieving, a variable; environment, local or otherwise:
 
To sum up, here is the list of searched locations. ordered by priority for retrieving, a variable; environment, local or otherwise:

Latest revision as of 17:20, 8 July 2016

EiffelStudio/Eiffel compiler utilizes a number of environment and other localized variables. This page is dedicated to those variables, how they are defined and what they mean.

Information.png Note: There is a special notion called "Unix Layout" in regards to special builds of EiffelStudio. When using a Unix layout no environment variables are used because of the fragmented distribution of installed files. For such layouts this page provides no contribution to understanding EiffelStudio. Unix layouts are used by package managers. See here for supported package managers.

Unless otherwise stated, all the following environment variables are known by the Eiffel environment at run time.

Core Variables

The core variables are the Eiffel compiler variables that absolutely must be defined for the EiffelStudio/Eiffel compiler to function. Without them the Eiffel environment has no idea where it is or what platform binaries to load.

  • ISE_EIFFEL: The holy grail of everything Eiffel, the only difference being is that this variable can be found! The value should point to the root of the EiffelStudio/Eiffel compiler installation.
  • ISE_PLATFORM: Represents the named platform on which the Eiffel environment is running. Below is a list of compatible platform names:
    • freebsd-x86-64
    • freebsd-x86
    • irix-mips-64
    • irix-mips
    • linux-ppc
    • linux-sparc
    • linux-x86-64
    • linux-x86
    • macosx-x86
    • macosx-x86-64
    • openbsd-x86
    • solaris-sparc-64
    • solaris-sparc
    • solaris-x86-64
    • solaris-x86
    • win64
    • windows

Windows Variables

Under Microsoft's Windows an extra variable is required, dictating the external C compiler used by the Eiffel environment. Like the core variables, this variable must be defined in order for an Eiffel environment to run.

  • ISE_C_COMPILER: The noted and installed C compiler used by the Eiffel compiler to perform C/C++ compilation and to locate the compatible external libraries. Below is a list of compatible C compiler names:
    • msc: Any supported Microsoft Visual C/C++ compiler prior to Visual Studio C++ 2015.
    • msc_vc140: Visual Studio C++ 2015 or later.
    • mingw: The open source MinGW C/C++ compiler, which at the time of writing is only available as a stable release for x86.
    • bcb: The Free Borland 5.5 C++ compiler which is now deprecated and should not be used.

Optional Variables

In addition to the core variables, there are a number of optional variables that can be defined to replace predefined values set by the Eiffel environments.

  • ISE_LIBRARY: Points to an alternative location for library source files. By default this is automatically set by EiffelStudio to the same location as ISE_EIFFEL. This is usually set explicitly when you are checking out the source code directly.
  • ISE_PRECOMP: The location of the Eiffel environment precompiled libraries. By default, this is automatically set by EiffelStudio to a user specific location which vary depending on the platform.
  • ISE_CFLAGS: C compilation flags that are passed to the C compiler. We recommend not using it but instead set the C compilation flags as part of your Eiffel Configuration File.
  • ISE_SHAREDLIBS: Some additional C/C++ libraries that are passed to the C/C++ linker. It can also be used to pass linker flags. Like ISE_CFLAGS, we recommend not using it but instead set the C compilation flags as part of your Eiffel Configuration File.
  • ISE_APP_DATA: Location of the Eiffel environment configuration data, such as project settings data and session configuration data. This configuration data is hidden, managed by EiffelStudio and should not be manipulated manually.

Auxiliary Variables

The following environment variables are defined when working with Eiffel environment sources. There is no internal knowledge of the following environment variables; they are used for configuration and compilation only.

  • EIFFEL_SRC: When working with the live Eiffel sources, EIFFEL_SRC points to the checked out /trunk/Src location.
  • ISE_SRC: This environment variable is used to point to the ISE internal repository containing non-GPL code. The variable points to /trunk/Src of the internal repository.

Windows Localization

If you are running EiffelStudio/Eiffel compiler on a Microsoft Windows-based platform, environment variables may be localized to a specific version of the Eiffel compiler used to build the Eiffel application. This is extremely useful when using the Eiffel compiler with multiple source repositories, or when working on multiple branches or research versions. It is also used to allow the x86 and x64 versions of EiffelStudio to be installed side-by-side and even under the same location without bit-compatibility issues with the Eiffel compiler binaries or external C libraries.

Information.png Note: Environment variables defined for the user or system will override any localized variables.

EiffelStudio and the Eiffel compiler make use of localized variables to define information specific to each version of EiffelStudio installed. Those of you who have created environment variables used by the Eiffel environment, such as ISE_EIFFEL or ISE_PLATFORM, will have seen an installer warning indicating the danger in defining those variables at that level.

So, on to localization and how it works.

The Windows Registry

People hate it, people love it, the Windows registry. It's nice to have uniform access to a collection of hives containing varying degrees of access. It's also where localized Eiffel variables can be manipulated, added or removed.

There are four places where local variables can be defined, each with their own degree of prioritization.

User variables, available only to the currently logged on user, are found under the key:

HKCU\Software\ISE\Eiffel_YY.MM\app_name

This is the very first place any Eiffel system will look for a local variable. For instance, EiffelStudio and the Eiffel compiler are bundled in the executable ec.exe. For release YY.MM built with a YY.MM Eiffel compiler, ec.exe will first look for variables under:

HKCU\Software\ISE\Eiffel_YY.MM\ec

Failing to find any variable under this key, the system will default to looking at the compiled version key (the version of the Eiffel compiler the system was compiled with.) Using the same example, the following key will be examined:

HKCU\Software\ISE\Eiffel_YY.MM

Again failing to locate a matching variable name, the system will proceed to check the local machine hive, using the same rules as used by the current user hive.

HKLM\Software\ISE\Eiffel_YY.MM\app_name

Using the same example. the application specific key at will be searched next:

HKLM\Software\ISE\Eiffel_YY.MM\ec

And failing to find any matching variable the compiled version key will be the last place looked under:

HKLM\Software\ISE\Eiffel_YY.MM

To sum up, here is the list of searched locations. ordered by priority for retrieving, a variable; environment, local or otherwise:

  1. User environment variable table
  2. Machine environment variable table
  3. Current user registry hive under the Eiffel application specific key
  4. Current user registry hive under the Eiffel compiled version key
  5. Local machine registry hive under the Eiffel application specific key
  6. Local machine registry hive under the Eiffel compiled version key