Sunday, May 24, 2020

How To Install an Old Version of Python on CentOS 7 without messing the default Python 2.7.x version installed

Ok this is how i install old Python 2.6.4 on a specific folder in my CentOS 7 without messing the Python 2.7.5 (default) that was installed in it.

What i want to do:
1. I am trying to run the UPG python script but somehow its binary strictly want to use python 2.6.4 or else it won't run
2. CentOS 7 comes with Python 2.7.x with it and i believe CentOS requires this version to be able to run its python scripts
3. So i need to be able to install Python 2.6.4 on a separate folder without messing with the default python version installed which is 2.7.x

What to do:


  1. 1. download python 2.6.4 source code package: https://www.python.org/downloads/release/python-264/
  2. download the tar file of course.
  3. unpack in any folder in your CentOS system but of course, you install it in preferred location /opt/ltx because UPG script refers to #!/opt/ltx/Python-2.6.4/bin/python 
  4. make sure you login as root
  5. Assuming you unpack it in /opt/ltx, cd to /opt/ltx/Python-2.6.4
  6. run configure like this >./configure --prefix=/opt/ltx/Python-2.6.4/.
    • this make install script to install the binaries and include files to /opt/ltx/Python-2.6.4/
  7. then finally >make install
  8. you can now see  /opt/ltx/Python-2.6.4/bin/python
  9. within this folder, you can do >python --version and the version will be 2.6.4
  10. however, doing >python --version on any other folder will show 2.7.x which means the default is still 2.7.x unless your script such as UPG strictly points to  /opt/ltx/Python-2.6.4/bin/ folder



Wednesday, April 10, 2019

How to Enable WIR, WCR, WRR records on STDF in Unison



Unison doesn't automatically add WIR, WCR, and WRR records into STDF file. To enable it, you need to add Wafer Descriptor object in the test program. To do this, follow the instructions below:


  1. In Optool menu, go to Tools > Wafer Map, the WaferMapTool will open.
  2. In the WaferMapTool, create Wafer Descriptor object. In my example below, I named the object “PutWaferDescriptorObjectNameHere”



  1. In the WaferMapTool menu, go to Edit > Edit Wafer Description…, the Edit Wafer Description Tool will open
  2. Put all the necessary values in the fields as shown below. Click OK


  1. Now that you have the Wafer Descriptor object. Let’s make it active.  In OpTool menu, go to Setup > Active Object > Wafer…, select the Wafer Descriptor you created. In my case it’s the “PutWaferDescriptorObjectNameHere”.
  2. Don’t forget to SAVE your program!!!
  3. Now from here on, as long as you use CURI driver that is for prober/wafer testing, you should generate WIR, WCR, and WRR in your STDF file.


Thursday, October 25, 2018

Compiling C++ Codes into shared Library and Linking Them


Compiling C++ Codes into shared library and linking them

Let's say you have files print.h and print.cpp, shown below that contains C++ codes you wish to compile as .so (shared object) file and they are stored in ~/demo/lib folder.

#ifndef __PRINT__
#define __PRINT__

#include <iostream>
#include <stdio.h>
void print(const char* p, bool endl = true);

#endif
#include <print.h>

void print(const char* p, bool endl)
{
std::cout << "print: " << p;
if (endl) std::cout << std::endl;
}

You can compile the above code into .o (static library) file with the command

~/demo/g++ -o lib.o -c ./lib/print.cpp

But we want to compile it as .so (shared library) file so we use the command instead

~/demo/g++ -o ./lib/liblib.so -shared -fpic ./lib/print.cpp

Note that with the above commands, liblib.so and lib.o is created in ~/demo/lib folder upon successful compilation.

Now let's say you have another set of C++ files loop.cpp and loop.h, shown below and you wish to compile them together with another C++ file into an .so file...

#ifndef __LOOP__
#define __LOOP__

#include <iostream>
#include <unistd.h>

class loop
{
public:
loop()
{
std::cout << "loop constructor"<< std::endl;
}
virtual ~loop()
{
std::cout << "loop destructor"<< std::endl;
}

void run(int i, int r);
};

#endif

#include <loop.h>

void loop::run(int i, int r)
{
while(r)
{
sleep(i);
std::cout << "loop..." << std::endl;
r--;
}
}

To compile print.cpp and loop.cpp files into a single .so file, do the command as shown below

~/demo/g++ -o ./lib/liblib.so -shared -fpic ./lib/print.cpp ./lib/loop.cpp

Now that we have .so file already, let's create a C++ program that will use this shared library and use the function and class it contains.
The C++ file below will be our C++ program. It is stored as main.cpp in ~/demo folder.
It uses print() from print.cpp to print "hello world" and uses loop class to perform a loop of 5 intervals.

#include <iostream>
#include <print.h>
#include <loop.h>

int main()
{
print("hello world");
loop p;
p.run(1,5);
return 0;
}

Let's compile this code and link the shared library with it. The command below shows how to compile it into "run".

g++ -o run main.cpp -L/lib -llib -I./lib -I./

If compile is successful, and executable named 'run' should appear in ~/demo folder. If you execute it, you might encounter an error as shown below. This is because when executing a program that has dependency on a shared library, it needs to know where the library is.

run: error while loading shared libraries: liblib.so: cannot open shared object file: No such file or directory

To fix this, you can do either of the two possible solutions

1. Copy the liblib.so into any folder listed in the system's LD_LIBRARY_PATH environment variable. This is a more consistent solution because you only do this once.

2. add ~/demo/lib folder into LD_LIBRARY_PATH environment variable. You have to keep setting this every time you try to execute your program in a new terminal. To do this, follow the command below:

~/setenv LD_LIBRARY_PATH ~/demo/lib:${LD_LIBRARY_PATH}

Now try to run the program again.

Using Makefile 

You can create a makefile to simplify this process. Copy the code below into ~/demo/makefile

all: so main

so : ./lib/print.cpp ./lib/loop.cpp
g++ -o ./lib/liblib.so -shared -fpic ./lib/print.cpp ./lib/loop.cpp -I./lib

main : ./lib/liblib.so
g++ -o run main.cpp -L./lib -llib -I./lib -I ./

Then just call 'make' and the whole compiling process will be done.


Linking the Shared Library (.so) in Unison

In this guide, we will link a share library (.so) in a Unison test program and use the functions and classes defined in the shared library.

1. Optional: copy the .so file as well as its .h header files into test program folder

2. After loading test program, open TestTool



3. In the TestTool, select the application library you want to link the .so file. double-click it to open its settings. Below shows that I selected ST_DLOG application library from my test program.



4.  Click on "Compiler and Linker" tab. Click the "Add Path.." button and select the path where the .so file is located.



5. Once done, you will see the path in the "Linker Paths" list box.



6. In the "Linker Flags" list box, click an empty row. then type -L<.so path> -l<.so name w/o lib prefix>. The -l flag lets me specify the filename of the .so file I want to use, but I without the 'lib' prefix and .so extension. My .so file's filename is liblib.so so removing the prefix and extension, it becomes -llib.



7. Click "Include Paths" tab.



8. Click the "Add Path.." button and select the path where the .h file is selected. Once done, you will see the path in the "Include Paths" list box.



9. Add the include file in the application library's source code. Below shows I declared the include on ST_Datalog.cpp. I included the 2 header files from my shared library - loop.h and print.h



10. Somewhere in ST_Datalog.cpp, i called mydemo::print() function which is defined in the shared library.


11. Finally, compile your application library.










Wednesday, July 4, 2018

How to Create Periodic and One-shot Timer in EIM

**Note that this also works on EIM @ solaris**


Assuming you want to create a periodic timer that starts with program or EIM loading, add the these codes to the following EIM entry points:

void myEIM::ExtIntfInit( ProgramControl *program, const int head )
{
// ------------------------------------------------------------------
// create periodic timer that fires every x amount of seconds
// ------------------------------------------------------------------
StopTimer(0xFF); // stop this timer first in case there's already one running with this id
unsigned int nSec = 60;
if (!CreateTimer(0xFF, 1, nSec, 0, true))
{
program->writeln(STDOUT, "ERROR! Failed to create periodic timer of %d seconds!\n", nSec);
}
else
{
time_t tTime;
  struct tm * localTime;
time ( &tTime );
  localTime = localtime ( &tTime );
program->writeln(STDOUT, "SUCCESS! Created periodic timer of %d seconds Starting at %s", nSec, asctime (localTime));
}
}

- myEIM is the external interface' name
- timer id for this code is 0xFF; you can set any unique integer you want
- the above code creates a periodic timer that immediately starts its countdown when CreateTimer() call is successful
- the timer is set to periodically trigger every 60 seconds

How to Increase Root Partition of CentOS 7 VMware

Part 1: Add a vmdk

1. Shutdown your CentOS 7 VMware and re-launch VMware player

2. Select your CentOS 7 VMware and click "Edit Virtual Machine Settings"


3. In the Hardware tab, click "Add.." button. "Add Hardware Wizard" dialog box will open


4. In the "Add hardware Wizard", select "Hard Disk". click "Next >"

5. Select "SCSI" as disk type. click "Next >"


6. Select "Create a new virtual disk". click "Next >"


7. Specify disk size in GB and select "Split virtual disk into multiple files." click "Next >"


8. Specify file name of the disk file. recommended to leave it as default. click "Finish".


9. In the "Virtual Machine Settings", you will now see "New Hard Disk" in the "Hardware" tab



Part 2: Configure LVM

1. Scan the host
find /sys -type f -iname "scan" -print

2. You will see the following list as shown below
[root@centos7vm localuser]# find /sys -type f -iname "scan" -print
/sys/devices/pci0000:00/0000:00:07.1/ata1/host1/scsi_host/host1/scan
/sys/devices/pci0000:00/0000:00:07.1/ata2/host2/scsi_host/host2/scan
/sys/devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0/scan

3. Rescan the SCSI bus by passing to each host the "- - -".
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata1/host0/scsi_host/host0/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata2/host1/scsi_host/host1/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2/scan

4. create new pv for the new disk
pvcreate /dev/sdb

5. Now check if the new disk is now available
ls -ltr /dev/disk/by-id/

6. You will see the following list from above command
[root@centos7vm localuser]# ls -lrt /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Jul  4 15:36 lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb
lrwxrwxrwx 1 root root  9 Jul  5  2018 ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 -> ../../sr0
lrwxrwxrwx 1 root root 10 Jul  5  2018 lvm-pv-uuid-GEwd0z-EDrV-hdB6-0o8M-S8eL-RzqU-gnSCIh -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQl7dtNtoPOoI8yhrsKP3RFs70WdmfTP4o -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQL9essrhuujmOBF6M9VcK2LK0BUEeWlMR -> ../../dm-1
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-swap -> ../../dm-1

7. One of the disk listed above points to our new disk /dev/sdb. in our above list, it's 
lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

8. Get your volume group of the root partition that we wish to expand
vgdisplay | grep 'VG Name'

    the output will be as shown below where "centos_centos7vm" is the volume group
[root@centos7vm localuser]# vgdisplay | grep 'VG Name'
  VG Name               centos_centos7vm

9. Let's now extend the root partition with the new disk
vgextend centos_centos7vm /dev/disk/by-id/lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

10. Do this command to finalize extending the root partition with the new disk. Note that the command says +20GiB but you can set the value to the size you set your new disk.
lvextend -r -L +20GiB /dev/centos_centos7vm/root

   

11. Finally, verify the change
[root@centos7vm localuser]# df -k
Filesystem                        1K-blocks     Used Available Use% Mounted on
/dev/mapper/centos_centos7vm-root  41141472 18793492  20444880  48% /
devtmpfs                            2006452        0   2006452   0% /dev
tmpfs                               2021876      156   2021720   1% /dev/shm
tmpfs                               2021876     9180   2012696   1% /run
tmpfs                               2021876        0   2021876   0% /sys/fs/cgroup
/dev/sda1                            999320   121212    809296  14% /boot
tmpfs                                404376        0    404376   0% /run/user/0
tmpfs                                404376       12    404364   1% /run/user/1001







Tuesday, June 19, 2018

How To Compile CURI FAmodule in CentOS 7.2 with U1709 64-Bit OS and CURI 1.21

Note that this instruction is tested only with the following system and software versions:

OS: CentOS 7.2
Unison: U1709
Curi: CURI_1.12_2.121.x86_64

1. edit your project.makefile to look like this:

TARGET_MINOR_VERSION = 1

SO_TARGET = fademo_hooks.so

# -- Start of project files --
PROJECT_SOURCES = fademo_attach.cpp \
fademo_hooks.cpp  \

PROJECT_HEADERS   = fademo_hooks.h \

NO_PTHREAD=true
MBITS=64
PROJECT_INCLUDE_PATHS = -DLINUX_TARGET -DLINUX -DUNISON -I. -I/ltx/include 
PROJECT_LIBRARIES=-Wl,-rpath,/ltx/lib$(MBITS) -L/ltx/lib$(MBITS) -levxa

ifeq ("$(BUILD_OS)", "Linux")
CFLAGS:=-DLINUX_TARGET
endif

LDFLAGS:=

prepare:

Note the "MBITS=64" added

2. update all "long" arguments in fademo_hooks.h, fademo_attach.cpp, fademo_hooks.cpp to FA_LONG and "unsigned long" to FA_ULONG if any

3. use this command to compile > gmake CFG=Release MBITS=64 MBITS_CURI=64

4. after compiling as above, the .so files are stored in ~Release/ folder. rename Release to Release64 

5. update CURI config file /opt/ateTools/curi/unison/config/curi_conf.xml to point to this FAmodule:

<CURI_CONF>
    <Config Configuration_ID="DefaultConfiguration">
        <ConfigEnv Equipment_Path="/opt/ateTools/curi/unison/lib" Communications_Path="/opt/ateTools/curi/unison/lib" User_Path="/home/localuser/Desktop/famodule/Release"/>
        <CommunicationsList>
            <GPIB_IF>
                <Settings>
                    <stringSetting token="IbcAUTOPOLL" value="0"/>
                </Settings>
            </GPIB_IF>
            <RS232_IF/>
            <TTL_IF/>
            <TTL_IF DriverID="ASL PCI PORT" AccessName="ASL_XP_TTL" Library="curi_asl_ttl" />
            <TTL_IF DriverID="ASL AT PORT" AccessName="ASL_NT_TTL" Library="curi_asl_ttl" />
            <TCPIP_IF Port="65000"/>
            <USB_IF/>
        </CommunicationsList>
    </Config>

    <UserLibrary AccessName="Demo famodule" Library="fademo_hooks">
        <Settings>
    <stringSetting token="Module Type" value="FAPROC Module"/>
    <stringSetting token="Priority" value="50"/>
        </Settings>
    </UserLibrary>

Where /home/localuser/Desktop/famodule/Release is the path (without the '64' suffix) where your Famodule .so file is located and fademo_hooks is the name of the .so file

6. make sure to relaunch Unison

Monday, June 18, 2018

READ THIS if you are trying to use Fademo (GEM Host Simulator) on any platform

CentOS7

  • must create a symbolic link libexpat.so.0 -> /usr/lib/libexpat.so.1.6.0 as fademo references to libexpat.so.0. Note that in previous versions of CentOS, this link may point out to an older version of libexpat (e.g libexpat.so.1.5.0 in CentOS 6.2) libexpat but that's fine. it works.

Tuesday, March 20, 2018

How to Fix Unison 6.2 VM's issue where lmhostid returns "" and not mac address

edit /etc/udev/rules.d/70-persistent-net.rules

it contains:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:aa:6d:77", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

just change NAME= to NAME="eth0", keep the rest as is.



edit /etc/sysconfig/network-scripts/ifcfg-eth0

it contains:
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:AA:6D:77"
DOMAIN="ltx.com ltx-credence.com ltxc.com"
IPV6INIT="no"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

make sure the HWADDR is set to correct mac address. you can get mac address from call to ifconfig


restart the system

Sunday, March 18, 2018

How To Install Unison In CentOS

Instructions for extracting Evx releases and patches.

1.  If you do not have gnu tar and gzip, retrieve the files
    gnutar and gzip. By clicking the download link.
    

2. Retrieve the appropriate release. By clicking the download link. 

   

   NOTE: You will need approximately 500 Meg free on your machine
   to hold the file, and approximately 2 Gig to extract it.
   

3. Once the transfer is complete, you can extract the file.  You
   must use gnu tar to extract the file.  The directory nesting
   of an Evx release is too deep for most unix tars.
   Again, make sure you have at least 2 Gig free in the directory
   where you will be extracting the tar file.
   Assuming that gnutar, gzip and the downloaded archive are all
   in the same directory, run the following commands to extract the
   archive:

   Make gnutar and gzip executable
   # chmod 755 gnutar gzip

   Uncompress the archive
   # ./gzip -dc R12.2.0.gnutar.gz | ./gnutar xf -
   
   Uncompress command for R12.4.0 and above:
   # ./gzip -dc R12.4.0.gnutar.gz | ./gtar xf - 

   Uncompress command for Linux Example:
   # /bin/gzip -dc R15.4.0.i686_linux_2.6.9.gnutar.gz | /bin/gtar xf -

4. Once the archive has been extracted, you will find installation
   instructions in the doc directory








~Uxx/x86*/pkgs/install_evx

[root@centos62 pkgs]# ./install_evx
QT v5.2.1 can be installed to a local directory or to a network directory.
You can also link to an existing directory that is network accessible.
Would you like to link to an existing installation?: (Y/[N]): ^C
You have new mail in /var/spool/mail/localuser
[root@centos62 pkgs]# pwd
/home/localuser/Desktop/U5.2.2.1/x86_64_linux_2.6.32/pkgs
[root@centos62 pkgs]# ./install_evx
QT v5.2.1 can be installed to a local directory or to a network directory.
You can also link to an existing directory that is network accessible.
Would you like to link to an existing installation?: (Y/[N]): N

The default location for v5.2.1 is /opt/ltx/Qt
Hit enter to use /opt/ltx/Qt or enter an alternate directory:
Continue installation using /opt/ltx/Qt? ([Y]/N): Y
Installing QT ...
QT install complete
Preparing...                ########################################### [100%]
package LTXC3pdi_installer-1.2-1.x86_64 (which is newer than LTXC3pdi_installer-1.1-1.x86_64) is already installed
The default location for U5.2.2.1 is /opt/ltx/releases
Use the default location?
1. Yes
2. No
USE DEFAULT LOCATION [1]: Y
Use the default location?
1. Yes
2. No
USE DEFAULT LOCATION [1]: 1
Installing LTXevx .....
Preparing...                ########################################### [100%]
   1:LTXevx-U5.2.2.1        ########################################### [100%]
Updating doc indexes for add-ons

Make this the default tester release?

1.   Yes
2.   No

SELECT DEFAULT RELEASE [1]: 1

The links in /opt/ltx/bin contain release independent
executables (i.e. launcher) and should always point to
the latest (highest numbered) installed release.
Currently these files are linked to nothing.
Should these links be changed to point to this release?

Make this the default tester release
for /opt/ltx/bin links?

1.   Yes
2.   No
DEFAULT RELEASE FOR BIN LINKS [1]: 1
Adding support for rsh to /etc/pam.d/rsh
Adding support for rlogin to /etc/pam.d/rlogin
Setting U5.2.2.1 as the default release
Setting U5.2.2.1 as the default release for bin objects

This release supports permission controls that
can restrict one user from stopping another user's
tester processes.

Refer to the documentation for instructions on
setting up permission controls with the
/opt/ltx/site/RestartTester.Users file.

Installing common files ..... passed
Preparing...                ########################################### [100%]
   1:LTXCglobalrules        ########################################### [100%]
Created /etc/udev/rules.d/98-LTXCglobal.rules
Preparing...                ########################################### [100%]
package LTXCpython-2.6.4-1.i686 is already installed

The default location for LTXCfmitool-43.0-1.i686 is /opt/ltx
Press Enter to use /opt/ltx or input an alternate directory:
Continue installation using /opt/ltx? ([Y]/N): Y
Installing LTXCfmitool-43.0-1.i686.rpm
package LTXCfmitool-44.0-1.i686 (which is newer than LTXCfmitool-43.0-1.i686) is already installed
Error installing LTXCfmitool-43.0-1.i686.rpm
/opt/ltx/releases/U5.2.2.1/x86_64_linux_2.6.32/bin/fmiTool: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

To complete the installation, set the LM_LICENSE_FILE variable, then run:

/opt/ltx/releases/U5.2.2.1/x86_64_linux_2.6.32/bin/fmiTool -c U5.2.2.1
Preparing...                ########################################### [100%]
   1:hedgehog-U5.2.2-Rev1   ########################################### [100%]
Updating doc indexes for add-ons
Preparing...                ########################################### [100%]
   1:pixel-U5.2.2-Rev1      ########################################### [100%]
Updating doc indexes for add-ons
Install Acrobat for access to help documentation? ([Y]/N): N
Install of Unison and related packages complete.
You have new mail in /var/spool/mail/localuser

Sunday, January 21, 2018

GEM FAQ's


How to enable GEM in Unison/CentOS
  • SECS/Gem is initially disabled in Unison. To enable SECS/Gem in Unison, you will need to run the config_gem command from xterm. This command is found in the /ltx/com directory. 
  • config_gem <tester_name> [-enable|-disable] [-verbose] [-reset]
  • The execution of config_gem tool will create the gem_config file for CGem in the tester pwrup directory
    • /ltx/testers/<tester_name>/pwrup/gem_config

SECS-GEM on CentOS 7.2, U1709

  • make sure to yum install the latest version. the first U1709 version release has issue on GEM component and may require update so...


Wednesday, November 22, 2017

How To Compile EVXA (cxx_examples) Code In Any Terminal In Unison

Copy the LD_LIBRARY_PATH env parameter on Unison's xterm (Optool>Tools>Xterm) and add it as first line in makefile. Below is example

LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib:/usr/local/lib:/opt/ltx/releases/U4.2.B4/x86_64_linux_2.6.32/customer/lib:/opt/ltx/releases/U4.2.B4/x86_64_linux_2.6.32/customer/lib:/opt/ltx/releases/U4.2.B4/x86_64_linux_2.6.32/lib/VX6/FX1:/opt/ltx/releases/U4.2.B4/x86_64_linux_2.6.32/lib/VX6

CC=/usr/bin/g++

CFLAGS=-m32 -fpermissive -g -Wall -Wno-return-type -Wno-unknown-pragmas -DLINUX_TARGET
LFLAGS=-m32 -lcrypt -lnsl -lm -lrt

Monday, May 1, 2017

How To Compile a C++ Source Code in CentOS

  • Linux (CentOS)
    • g++ <source code>
      • g++ foo.c where foo.c is the source code, output will be a.out
    • g++ -o <output> <source code>
      • g++ -o foo foo.c where foo is executable, and foo.c is the source code

Wednesday, February 8, 2017

How To Install X11VNC on Red Hat Linux (ITE)

1. download installer here
Click me to download X11vnc installer
download the file > x11vnc-0.9.13.tar.gz

2. unzip the file and cd to source directory
(un-tar the x11vnc+libvncserver tarball)
# gzip -dc x11vnc-0.9.13.tar.gz | tar -xvf -
# cd x11vnc-0.9.13

3. compile the source code
(run configure and then run make)
# ./configure
# make
> you may notice some warnings about missing libraries. ignore it for now unless it says critical error

4. run x11vnc server
# cd x11vnc
# ./x11vnc

5. if you need the IP of the linux machine
#ifconfig


Monday, August 15, 2016

Understanding Loaded and Selected Sites in EVXA /EIM

ProgramControl.getNumberLoadedSites()
- returns the number of defined sites in Adapter Object of the test program + 1


ProgramControl.getNumberSelectedSites()
- returns the number of sites (selected or not selected in bin tool) from site 1 up to maximum site that is active (selected in bin tool) + 1
- say 4-site is [1101] where site 3 is inactive. return value is 5
- say 4-site is [1010] where sites 2 and 4 are inactive, return value is 4
- say 4-site is [0110] where sites 1 and 4 are inactive, return value is 4
- say 4-site is [0001] where sites 1, 2, and 3 are inactive, return value is 5


ProgramControl.getLoadedSites()
- returns a a pointer to an array of sites that are defined in Adapter Object of the test program
- site 1 is referenced to array [1] and array[0] does not really define a site
- the size of the array it points to is the return value of getNumberLoadedSites()


ProgramControl.getSelectedSites()
- returns a a pointer to an array of sites from site 1 to last site that is active (selected in bin tool)
- if no site is selected in bin tool, returns 0 ***
- site 1 is referenced to array [1] and array[0] does not really define a site
- the size of the array it points to is the return value of getNumberSelectedSites()











Tuesday, July 26, 2016

Clone an Existing EIM using MethodTool

  1. Load the EIM to be cloned
    • Set MethodTool>Edit>Test Methods>External Interface
    • Click "External Interface" button and "Find enVision Object" dialog box will appear and shows a list of ExternalInterface to choose. 
    • Select The ExternalInterface to clone and press OK.
    • The text box beside "ExternalInterface" button now displays the name of the EIM you selected
    • The "Method Directory" now displays the path of the source code for the loaded EIM
    • All the member functions and variables defined or added into this EIM are also displayed 
  2. Clone the loaded EIM 
    • Set MethodTool>File>Clone...
    • in "Select Clone Directory" popup
      • set name of cloned EIM in text box beside "ExternalInterface"
      • set directory where the cloned EIM will be stored in text box beside "Method Directory:"
        • make sure to specify the folder where the source code and binaries will be stored
      • Click OK 
        • If a new folder is specified, it will be created 
        • mid, tmk, cxx, and hxx files will be created and are copies of the EIM that is cloned
        • the newly created cloned EIM is automatically compiled and DNT/FX1 folder with evso is created after successful build 
  3. Update sources
    • You can now make changes to the source code of the clone EIM

    Thursday, July 21, 2016

    How to Update enVision Demo License in Solaris (Unix Box for EIM Compiling)

    1. Follow instruction from AppsWiki on how to create demo license "license.dat" file for enVision/Unison
      • root access is password:ltxroot
    2. If ".cshrc" file does not exist in maint account home directory, create it
      • make sure to login as  user: maint, password: maint
      • run /ltx/apps_support/com/cde_account_config
        • the above command will generate ".cshrc" file in maint's home directory
    3. log out and log back in again with "maint" account. 
    4. launch enVision

    Tuesday, July 19, 2016

    Create New EIM from Scratch Using MethodTool

    1. Create a new program or load an existing program. 
      • MethodTool can only be invoked when a program is loaded in enVision.
    2. Launch MethodTool from OpTool>Tools>Development>Method
    3. In MethodTool's menu, set MethodTool>Edit>Tool Mode>External Interface
    4. Set the working directory for EIM. 
      • Click the "Method Directory:" button in MethodTool
      • In the file selection dialog box, select the directory where the EIM files are to be stored
      • Optional: If a directory name is specified in "Enter Directory:" field in the file selection dialog box, this new directory will be created (if it does not exist yet) and the EIM files will be stored in it
    5. Specify EIM name using the "ExternalInterface:" button in MethodTool
      • clicking this button will invoke popup listing existing EIM already created previously. If you already created one before and wish to modify it, select it from the list
      • To create a new EIM, type the EIM name in the textbox beside "ExternalInterface:" button and press <return>
      • Once EIM is specified, you will notice that the "Linked Filename:" will now be filled with <path>/<external interface name>.evso and buttons in MethodTool for creating/modifying/building EIM source codes will be enabled
      • The .evso file will be the output binary file of a successful EIM source code compile
    6. Specify the entry point functions to be included in your EIM class
      • Entry point functions are methods that will be included in your EIM class. these methods are event handlers that you can modify to perform action when an event occur in enVision e.g. StartTest(), a function that is executed by EIM when testing starts in enVision. You can modify StartTest() function to perform actions you need when a start of test occurs
      • In MethodTool, click Edit>Entry Points... and "Select Entry Points" popup will appear. Select which entry point function you wish to add in your EIM class and press OK
    7. Create source codes 
      • In MethodTool, click "Create Sources" button and the following files will be created in the working directory:
        • <eim name>.mid
        • <eim name>.cxx
        • <eim_name>.hxx
      • Check the .cxx files if the entry point functions you selected are defined in the code
    8. Create Makefile
      • In MethodTool, click Options>Create Method Makefile... and "Create Method Makefile popup will appear
        • The evso Name will be the name of the binary file to be created when compiling is successful
        • The Path is where the source codes to be compiled are located
      • Right click on each lines listing the required source code files and choose "Dynamic Linked"
      • Press "Create Makefile" button
      • In the working directory, you will now see new files:
        • Makefile
        • <eim name>.tmk
    9. Define member parameters for your custom EIM class
      • MethodTool will only include 2 member methods init_local_member_data() and free_local_member_data() only if at least one custom parameter is declared
      • choose one of the rows (preferably the top most available) and write the name of the variable in "Name" column.
      • to specify the type of variable (e.g. TestheadConnection*)...
        • right-click on the member variable's "Data Type" field and popup will appear. choose "Local Data...".
        • In the dialog box that appear, enter the type name in the text box below "Standard Data Type" and press OK
      • Adding new member parameters or changing/updating existing ones will require you to update your source code in MethodTool so that changes will reflect.
        • In the MethodTool, click the "Update Sources" button
    10. Modify your source code and save changes
    11. Build the EIM
      • In MethodTool, click "Build" button.
      • You will be prompted couple of times. Just keep clicking Yes/OK
      • A terminal will open showing compile in progress. it will automatically close if successful. otherwise it will remain open for you to see the errors
      • The following files will be created in working directory upon successful build:
        • <DNT of FX1>/<eim name>.evso
        • Note that the folder can either be DNT or FX1 depending on which tester you used to compile it with
    12. Test the EIM
      • Create or load an existing test program of your choice in OpTool
      • Load your EIM in MethodTool
      • For debug purposes, make sure to add the ExtIntfInit() entry point function in your EIM if you haven't done so
        • Modify the source code by adding the following line inside ExtIntfInit() function in <eim>.cxx
          • program->writeln(STDOUT, "Hello EIM world!\n");
      • Compile the EIM and if successful, load it into enVision by clicking "Reload" button in MethodTool
      • In Optool menu, go to OpTool>Setup>EIM... and "Setup External Interface Method" popup will appear
        • If your test program already have an existing external interface object defined, you can just insert your EIM method in it by pressing "Insert Methods" button and selecting your EIM in the popup list. 
        • Note that if you can't find your EIM in the list, try pressing "Reload" button again in the MethodTool
        • Press OK
      • Once your EIM is loaded, a message "Hello EIM World!" will be printed in the Dataviewer
      • Note: In simulation, enVision does not automatically start EIM process so start it manually by restarting tester via command line as shown:
        • >restart_tester <tester> -seim


    Friday, July 15, 2016

    EIM FAQ

    • MethodCompiler location
      • Solaris 8 Sun OS: /opt/ltx/bin/, /opt/ltx/releases/<release>/DNT/customer/bin
      • CentOS 4.6: /opt/ltx/releases/<release>/i686*/bin
    • Default EIM source code location
      • enVision (Solaris): /opt/ltx/releases/<version>/customer/test_methods/
      • enVision (CentOS 4.6): 
    • Custom EIM binary location (where the compiled "evso" file is to be placed)
      • enVision (Solaris): 
        • /opt/ltx/releases/<version>/customer/custom_methods/DNT
        • /opt/ltx/releases/<version>/customer/custom_methods/FX1
        • DNT for CX testers while FX1 for FX testers but need to confirm this 
      • enVision (CentOS 4.6): 
        • /opt/ltx/releases/<version>/i686*/custom_methods/DNT
        • /opt/ltx/releases/<version>/i686*/custom_methods/FX1
        • DNT for CX testers while FX1 for FX testers 
    • Command to compile EIM source code
      • >MethodCompiler -t DNT/FX1 -f <file>.tmk
        • Note: Some systems required you to set the full path of MethodCompiler command. 
        • Specify either DNT for DX systems,  or FX1 for X-series systems
    • Do's in Developing EIM 
    • Don'ts in Developing EIMl
    • How to Properly load an EIM into MethodTool
      • enVision only loads EIM's (evso files) that are located in default EIM source code location and custom EIM binary locations.
      • If you have an EIM source code and wishes to load it into MethodTool, follow this:
        • open OpTool>MethodTool
        • in OpTool>MethodTool>Method Directory:, specify the path where your EIM source code is located (cxx, hxx, mid, makefile, etc...)
        • set OpTool>MethodTool>Edit>Tool Mode>External Interface. If you are in the right path, a pop-up will appear letting you select which EIM object to load. select which one you prefer
        • press OpTool>MethodTool>Reload
        • If successful, press OpTool>MethodTool>ExternalInterface and select your EIM. Press OK and your EIM will be loaded successfully

    Wednesday, July 6, 2016

    How to Install and Test CURI

    • Download CURI package from Expedite (Software Support)
      • Make sure to choose the right version 
        • enVision 
          • isg_enVision_curi-<version.<arch>.rpm
          • e.g. isg_enVision_curi-1.12-1.117.cnt4.6.i386.rpm 
        • Unison
          • isg_unison_curi-<version>.<arch>.rpm
          • e.g. isg_unison_curi-1.12-2.117.cnt4.6.i386.rpm
      • Note: The above filename convention is supposed to be for versions older than 112. However, newer versions such as the example above (version 117) are still observed to be following the old naming convention. refer to curi deployment presentation for this issue
    • Install CURI package
      • login as root
      • >rpm -ivh <curi>.rpm
      • make sure not to use -uvh as option
    • Check for install locations
      • Windows: c:\opt\ateTools\curi\CURI_<release>
      • Linux: /opt/ateTools/curi/CURI_<version>
        • e.g. installing isg_enVision_curi-1.12-1.117.cnt4.6.i386.rpm
          • Install location: /opt/ateTools/curi/CURI_CURI_1.12_1.117
        • e.g. installing isg_unison_curi-1.12-2.117.cnt4.6.i386.rpm
          • Install location: /opt/ateTools/curi/CURI_CURI_1.12_2.117
      • Symbolic links: /opt/ateTools/curi/
        • Legacy - ITE and enVision
          • CURI=> <curi directory>
        • Unison
          • unison => <curi directory>
      • CURI config file locations
        • Unison: /opt/ateTools/curi/unison/config/curi_conf.xml
        • enVision: /opt/ateTools/curi/CURI/config/curi_conf.xml
    • Optional: Change write permissions of curi_conf.xml
      • curi_conf.xml can be found here:
        • Unison: /opt/ateTools/curi/unison/config/curi_conf.xml
        • enVision: /opt/ateTools/curi/CURI/config/curi_conf.xml
    • Verify if CURI is installed correctly
      • Linux
        • /opt/ateTools/curi/CURI_<release>/bin/test_curi 
        • /opt/ateTools/curi/CURI_<release>/bin/test_curi -noTestLoop
          • option to not enter into loop mode
        • Ignore the "FAILED: onEquipment not supported..." in the output log
      • Windows
        • C;\opt\ateTools\curi\CURI_<release>bin/test_curi.exe
      • Above commands will list all equipment this CURI release knows. if no list comes out, something is wrong


    How to uninstall CURI from CentOS
    • login as root
    • to find the installed curi package, execute this command
      • >rpm -qa | grep curi 
    • rpm -e <curi>

    Install locations:
    • Windows: c:\opt\ateTools\curi\CURI_<release>
    • Linux: /opt/ateTools/curi
      • Pre v112
        • /opt/ateTools/curi/CURI_<release>
      • v112 and higher
        • /opt/ateTools/curi/diamond-curi-<release>
        • /opt/ateTools/curi/enVision-curi-<release>
        • /opt/ateTools/curi/unison-curi-<release>
        • note that the diamond is for ITE
    • Symbolic links
      • Legacy - ITE and enVision
        • CURI=> <curi directory>
      • Unison
        • unison => <curi directory>
    • CURI config file locations
      • Unison
        • /opt/ateTools/curi/unison/config/curi_conf.xml
      • enVision
        • /opt/ateTools/curi/CURI/config/curi_conf.xml

    How to verify if CURI is installed correctly
    • Linux
      • /opt/ateTools/curi/CURI_<release>/bin/test_curi 
      • /opt/ateTools/curi/CURI_<release>/bin/test_curi -noTestLoop
        • option to not enter into loop mode
    • Windows
      • C;\opt\ateTools\curi\CURI_<release>bin/test_curi.exe
    • Above commands will list all equipment this CURI release knows. if no list comes out, something is wrong


      Sunday, May 15, 2016

      How to Install R15.8.4 with Customized GEM option for ST


      INSTALLATION
      • Login as root
      • Unpack R15.8.4 tar.gz package
        • gunzip R15.8.4.i686_linux_2.6.9.gnutar.gz
        • tar -xvf R15.8.4.i686_linux_2.6.9.gnutar
        • cd R15.8.4
      • Install the enVision software
        • go to R15.8.4 folder where the tar.gz package is decompressed
        • go to the appropriate directory ~/R15.8.4/i686*/Disk2/DNT/pkgs
        • run >./install_evx
        • you will be prompted to choose install location. recommended to install on default location
        • you will be prompted to make R15.8.4 as default tester release. 
        • you will be prompted to set R15.8.4 as default tester release for /opt/ltx/bin links. recommended as it should always point to the latest (highest numbered) installed enVision release.
      • Install enVision common files
        • go to R15.8.4 folder where the tar.gz package is decompressed
        • go to the appropriate directory ~/R15.8.4/i686*/Disk1/DNT/pkgs
        • run ./install_common
      • Install enVision On-line Documentation
        • go to R15.8.4 folder where the tar.gz package is decompressed
        • go to the appropriate directory ~/R15.8.4/i686*/Disk1/DNT/pkgs
        • run >./Acrobat7/INSTALL
        • you will be prompted to accept or deny installation.
        • you will be prompted to specify installation directory and offer default path. recommended to accept default path
      • Install flexnet license manager
        • This maybe optional. but won't hurt to install again
        • go to R15.8.4 folder where the tar.gz package is decompressed
        • go to the appropriate directory ~/R15.8.4/i686*/Disk1/DNT/pkgs
        • run >rpm -Uvh LTXflexnet*.rpm
      • Install CURI
        • go to R15.8.4 folder where the tar.gz package is decompressed
        • go to the appropriate directory ~/R15.8.4/i686*/Disk1/DNT/pkgs
        • run >rpm -Uvh isg_enVision_curi*.rpm 


      RECIPE HANDLER CONFIGURATION
      • It is recommended to do this on xterm terminal launched through enVision.
      • Go to directory where recipeHandler is located 
      • Compile to source code 
        • ~/recipeHandler/make -f /opt/ateTools/curi/CURI/dev/makeTemplates/makefile.curi CFG=Release
      • run recipeHandler 
        • ~/recipeHandler/Release/recipeHandler <tester> -c
      • or you can run with debug log ON
        • ~/recipeHandler/Release/recipeHandler <tester> -c -d

      CGEM CONFIGURATION