Salesforce

Can I tell whether an OE installation is 32-bit or 64-bit without PROCESS-ARCHITECTURE?

« Go Back

Information

 
TitleCan I tell whether an OE installation is 32-bit or 64-bit without PROCESS-ARCHITECTURE?
URL Namecan-i-tell-whether-an-oe-installation-is-32-bit-or-64-bit-without-process-architecture
Article Number000182916
EnvironmentProduct: OpenEdge
Version: 10.x, 11.0 through 11.2
OS: All supported platforms
Question/Problem Description
Can I tell whether an OE installation is 32-bit or 64-bit without PROCESS-ARCHITECTURE?

Workaround based on convention for determining whether 32-bit or 64-bit OpenEdge is installed. Can be used in OE versions prior to 11.3, when the PROCESS-ARCHITECTURE function was introduced.

A typical use case might be:
  • Shared libraries and/or DLLs for a platform independent task.
  • Code might run on Windows or Unix in either a 32-bit or 64-bit environment.
  • Goal is to eliminate multiple versions of the code and have only one.
  • External libraries should be referenced as string literals in external procedure declarations similar to "PROCEDURE  specialproc EXTERNAL '/lib/ourlibrary.so' CDECL".
  • Depending on the environment, the library might be in a location such as:
    • /lib/ourlibrary.so
    • /lib64/ourlibrary.so
    • ourlibrary.dll
How can the external procedure declaration reference the path to the correct shared library at run time?
 
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
There is no direct way to programmatically determine if an OpenEdge session is a 32-bit or 64-bit process in OE versions prior to 11.3, when the PROCESS-ARCHITECTURE function was introduced.

This limitation can potentially be worked around if a naming convention exists for OpenEdge installation directories (DLC) that identifies 32-bit vs. 64-bit installations. For example:
  1. If installation directories are named to indicate what version of OpenEdge is installed in them, including the bitness, the bitness can be parsed from the directory name. For example, the DLC might be /usr/DLC102b_64 on a Unix machine or C:\Progress\OpenEdge102b_32 on a Windows machine. If this condition is met, code like the following can determine which version is running:
 
cVersion = OS-GETENV('DLC').
IF OPSYS = 'WIN32'
THEN DO:
IF INDEX('32',cVersion) > 0
THEN hCallObject:LIBRARY = 'my32BitWinLibrary.dll'.
ELSE IF INDEX('64',cVersion)
THEN hCallObject:LIBRARY = 'my64BitWinLibrary.dll'.
ELSE MESSAGE 'no such bitness' VIEW-AS ALERT-BOX.
END. /* Windows' */
ELSE IF OPSYS = 'UNIX'
THEN DO:
IF INDEX('32',cVersion) > 0
THEN hCallObject:LIBRARY = 'my32BitUnixLibrary.so'.
ELSE IF INDEX('64',cVersion)
THEN hCallObject:LIBRARY = 'my64BitUnixLibrary.so'.
ELSE MESSAGE 'no such bitness' VIEW-AS ALERT-BOX.
END. /* Unix */
ELSE MESSAGE 'no such operating system' VIEW-AS ALERT-BOX.
  1. If the names of the installation directories do not follow a pattern, but they are known in advance and are not reused on different machines, they could be stored them in a database table along with their bitness and the bitness retrieved at run time. For example:
 
cVersion = OS-GETENV('DLC').
FIND FIRST LibraryTable WHERE Dlc = cVersion.
hCallObject:LIBRARY = LibraryTable.Library.
  1. Run <install-dir>/bin/showcfg from the command prompt or double-click the <install-dir>\progress.cfg file in Windows.  Match the port number shown in the config file viewer with the os-bitness using one of the below articles:
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:06 AM

Powered by