Thursday 18 October 2012

How to install Klocwork in linux


*****************How to Install Klocwork in Local Server?*********************************

1) Create a user and group (klocwork/klocwork123)
2) Login into the machine using above user and password.
3) create a directory klocwork_9.2 (mkdir klocwork_9.2)
4) Copy kw-server-installer.9.2.1.7276.linux.sh to klocwork_9.2 folder.
5) chmod 755 *.sh
6) Create kwtables, kw92 and kwdata directory in klocwork_9.2 folder(eg : mkdir kw82 kwdata)
7) Run kw-server-installer.9.2.1.7276.linux.sh
(eg: ./kw-server-installer.9.2.1.7276.linux.sh -a -i /home/klocwork/klocwork_9.2/kw92/ -p /home/klocwork/klocwork_9.2/kwdata/
8) open bashrc and export klocwork binary paths.
(eg: export PATH=$PATH:/home/klocwork/klocwork_9.2/kw92/bin/)
9) save bashrc file and run it( source ~/.bashrc)
10) kwservice set-service-property <path to kwdata> license host <license machine ip address>
(eg: ./kwservice set-service-property /home/klocwork/klocwork_9.2/kwdata/ license host 172.16.1.151
11) cd ..
12)chmod 755 *.sh
13) Install kw-user-installer.9.2.1.7276.linux.sh
(eg:./kw-user-installer.9.2.1.7276.linux.sh /home/klocwork/klocwork_9.2_Client/)
14) Enter then type Yes again Enter
15) After Installation is over open .bashrc and add client bin path
(eg:/home/klocwork/klocwork_9.2_Client_New/bin/)
****now your export path is :export PATH=$PATH:/home/klocwork/Klocwork9.2/kw92/bin/:/home/klocwork/klocwork_9.2_Client_New/bin/
16) save bashrc and run (source .bashrc)
17) Go to kwdata/config folder (eg :/home/klocwork/Klocwork9.2/kwdata/config)
18) Open admin.conf file
19) Change project.host , project.java.rmi.server.hostname , web.host, database.host as Ip address of Klockwork installing machine.
20) If project.java.rmi.server.hostname is not present in admin.conf add it ( *its not mandatory)
21) Change license.host = IP Address of License Server.(172.16.1.151)
22) If Required change web port .
23) Save the admin.conf
24) kwservice start <path to kwdata>
(eg: kwservice start /home/klocwork/klocwork_9.2/kwdata/ )
25) Now License Server, Database Server , Project Server and Web Server should start.
    Change the port-adress of database.port to some other port if  default 3306 is used by default mysql already installed in the system.
    Webserver is the klocserver.
    project server is the project_root installed in the machine.
   
26) If databse /project/web server is not starting check these ports are already using or not ?
****if is its using change the port and start again.
27) if any problem for starting License server contact klocwork admin
28) open gui http://ipaddressof klocwork installed machine:webport
(eg:http://172.19.1.61:8072)
29) open gui in another way also go to <path of kw92/bin> ./kmc
(eg:/home/klocwork/klocwork_9.2/kw92/bin)
****before starting kmc install cigwin or any other tool

*****************To work with KlocWork*********************


Once the installation is done now to work with the code fallow the fallowing procedure.


1)Go to the sourcecode folder, here we need to generate build specification file. Use the fallowing command
to generate build.spec file
    kwinject -o build.spec make
    The above command uses make file in the source code folder and complies and generates specification file.
    Dont forget to do make clean before to do make.
2)Run KMC in command window using command kmc. This will invoke a GUI tool where we can create project and build it.
3)To create project, go to file->New project, Name the project and select the language  click next.

4) In the next window select Build From Build Specification files click add, browse for the build specification file that you have done in step 1.

5)Click Next.
6)Select the options in the next window and click finish.
7)On the left side of the UI you will project list, right click on your project click on build. This step intiates building of recent build version.

8)UI will asks for KlocWorks Tables Directory, Select  Reuse Tables Directory and browse for the tables directory path /home/klocwork/klocwork_9.2/kwtables/ and click build.

9)Your code starts building and the process will take some time. After completion of successful build you can see the reports on the browser.

10)Open the browser with klocServer ip addess (ex: http://172.19.3.178:8080) and select Klocwork Review. UI asks username and password. username is admin and no password.

11)UI will load the complete list of projects, select your coressponding project to view reports.






1 comment:

  1. Hi givens steps are very useful. I am facing issue with listing the klocwork users. Is there any way to get the users list from GUI or From server.

    ReplyDelete