Cannot make Demo Example from Titan [message #1714092] |
Mon, 09 November 2015 20:26 |
Muhammad Burhan Hassan Messages: 28 Registered: November 2015 |
Junior Member |
|
|
HI,
I tried to make Demo , MyExample.ttcn, which came with titan installation. I made the copy of the folder and tried to make it with existing Test Ports and .cfg file.
I got errors in it, shown in image. Am i missing any other library for Titan compilation?
From make file , i wrote ttcn3 instead ttcn3-parallel, then this error vanishes, but the second error persist. Although File "titanver" is present in its directory.
Regards,
Burhan
-
Attachment: Capture.PNG
(Size: 40.92KB, Downloaded 447 times)
|
|
|
Re: Cannot make Demo Example from Titan [message #1714095 is a reply to message #1714092] |
Mon, 09 November 2015 20:58 |
|
Hi Muhammad,
I think you don't have your environment variables set correctly:
If say Titan is installed in /home/<userid>/titan/Install
then you have to set your variables as follows:
setenv TTCN3_DIR /home/<userid>/titan/Install
setenv PATH /home/<userid>/titan.core/Install/bin/:${PATH}
setenv LD_LIBRARY_PATH /home/<userid>/titan.core/Install/lib:${LD_LIBRARY_PATH}
for csh
or
export TTCN3_DIR=/home/<user id>/titan/Install
export PATH=/home/<userid>/titan.core/Install/bin/:${PATH}
export LD_LIBRARY_PATH=/home/<userid>/titan.core/Install/lib:${LD_LIBRARY_PATH}
for bash
I hope this helps
P.S. I'll answer the DNS question tomorrow, that will take some time.
Best regards
Elemer
|
|
|
Re: Cannot make Demo Example from Titan [message #1714125 is a reply to message #1714095] |
Tue, 10 November 2015 07:28 |
|
Hi,
I agree with Elemer, the settings of environment variables are faulty.
From your make log this line is interesting:
"/bin/sh/: line 4: c:cygwin64homeb.hassaninstall/bin/titanver"
It seems that the "/" characters disappeared.
Check them not only in the cygwin environment but in the windows environment as well ! Especially the PATH env var. (I suppose the mistake is on cygwin level as Elemer said.)
BR
Jeno
|
|
|
Re: Cannot make Demo Example from Titan [message #1714175 is a reply to message #1714095] |
Tue, 10 November 2015 13:47 |
Muhammad Burhan Hassan Messages: 28 Registered: November 2015 |
Junior Member |
|
|
Hi,
I tried to change the Env Variables, as you said and shown in the image "EnvVariable.PNG",
i re started my PC and tried to generate make file, but this time it said "command not found", shown in image "After ChangingEnvVariable".. I also updated the Windows Env Variables as you said.
I think the problem was of writing "titan.core" instead of "titan" (also removed from Windows Env Variables)... So set the variables again after removing ".core", and tried to make file again, but the same old error raised.
My Directory is.. :
C:\cygwin64\home\b.hassan\install (have bin,demo,etc,help,include,lib and man folders)
C:\cygwin64\home\b.hassan\titan
I thought this info can be helpfull...
According to above directories and "Installation guide" came with Titan package, i think my TTCN3 Directory is "C:\cygwin64\home\b.hassan\install"..So in setting Env Variables, i tried with "install" in place of "titan" as well, but of no use.
NOTE: I followed this video "Install ttcn3 on windows using eclipse titan" from You tube to set up Titan, and at time "30:50", it is setting env variables..
Hope i explained the problem i m in ..
Regards,
Burhan
|
|
|
|
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714212 is a reply to message #1714211] |
Tue, 10 November 2015 18:32 |
|
Hi Muhammad,
yes there is a small typo there, but now we know that
you have your Titan installation in
C:\cygwin64\home\b.hassan\install
so binaries are in
C:\cygwin64\home\b.hassan\install\bin
and libraries in
C:\cygwin64\home\b.hassan\install\lib
TTCN3_DIR looks OK, so please set PATH:
export PATH=C:\cygwin64\home\b.hassan\install\bin:${PATH}
(this will add C:\cygwin64\home\b.hassan\install\bin in front of the current value for PATH)
and LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=C:\cygwin64\home\b.hassan\install\lib:${LD_LIBRARY_PATH}
which does the same for LD_LIBRARY_PATH;
after that verify with
and
that variables are correct ; if they are , then your installation should work.
Please let me know if it helped.
BR Elemer
|
|
|
Re: Cannot make Demo Example from Titan [message #1714214 is a reply to message #1714212] |
Tue, 10 November 2015 18:44 |
|
Hi Muhammad,
sorry, this is how you should set you environment variables in windows (as shown in the video)
Within Cygwin, you need to use it differently:
export TTCN3_DIR=/home/b.hassan/install:${PATH}
export PATH=/home/b.hassan/install/bin:${PATH}
export LD_LIBRARY_PATH=/home/b.hassan/install/lib:${LD_LIBRARY_PATH}
sorry for the confusion.
So again, set in windows your env. variables as
TTCN3_DIR=C:\cygwin64\home\b.hassan\install
PATH=C:\cygwin64\home\b.hassan\install\bin:${PATH}
LD_LIBRARY_PATH=C:\cygwin64\home\b.hassan\install\lib:${LD_LIBRARY_PATH}
and in Cygwin, as above, with export
export TTCN3_DIR=/home/b.hassan/install:${PATH}
export PATH=/home/b.hassan/install/bin:${PATH}
export LD_LIBRARY_PATH=/home/b.hassan/install/lib:${LD_LIBRARY_PATH}
|
|
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714221 is a reply to message #1714220] |
Tue, 10 November 2015 19:51 |
|
Hi Muhammad,
OK , I see the problem:
this environmental variable can receive value both from the setting Windows and from the setting in cygwin bash, and the two values are in conflict;
so please set the value in cygwin with
export TTCN3_DIR=/home/b.hassan/install
but do not restart, check first if your compilation works.
If it does, then you need to edit your .bashrc file and add
export TTCN3_DIR=/home/b.hassan/install
export PATH=/home/b.hassan/install/bin:${PATH}
export LD_LIBRARY_PATH=/home/b.hassan/install/lib:${LD_LIBRARY_PATH}
to it;
this will make sure that the setting are not lost
then erase the settings in Windows and only then restart and check the values
Thus, the variables will be set only from within cygwin, the .bashrc file.
Please let me know of the result
BR Elemer
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714224 is a reply to message #1714223] |
Tue, 10 November 2015 21:01 |
|
Hi Muhammad, OK, we are close
Problem is , you have compiled for parallel mode (multi components) but try to execute in single mode (single component)
so you need to regenerate the Makefile with:
makefilegen -f -s MyExample.ttcn PCOType.hh PCOType.cc
where -s signifies single mode
than
make clean
make
./MyExample
Please let me know of the result
BR Elemer
|
|
|
Re: Cannot make Demo Example from Titan [message #1714225 is a reply to message #1714223] |
Tue, 10 November 2015 21:08 |
Muhammad Burhan Hassan Messages: 28 Registered: November 2015 |
Junior Member |
|
|
I got it, i was not including "MyExample.cfg " in ttcn3_genmakefile command, now its working... (also changed ttcn3_parallel to ttcn3)
I have another question, I have deleted the env variables from Windows, now if i use Titan plugin from Eclipse, should it work correctly?
You did great help Elmer, i really appreciate the effort you put for me, you rock
Thanks and hope to see you soon in another issue ..
Regards,
Burhan
[Updated on: Tue, 10 November 2015 21:10] Report message to a moderator
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714260 is a reply to message #1714254] |
Wed, 11 November 2015 08:29 |
|
Hi Burhad,
1. HelloWorld or MyExample shall be compiled in parallel mode because it contains real (test) components. The rule is that if you have components (ttcn component, which is a ttcn term, see ttcn tutorial or spec "ETSI ES 201 873-1 V4.7.1") then you shall use parallel mode.
2. The TTCN3_DIR, PATH, LD_LIBRARY path should be set in cygwin. The only Wndows environment variable is PATH which can interfere with (=disturb ) cygwin $PATH.
$PATH in cygwin shell inherits windows path ( with some tricks) but cygwin shell overwrite the windows variables within the shell. Therefore I would suggest to do all the following steps:
- add only the cygwin bin dir to your windows environment variable "PATH", for example "C:\cygwin64\bin;"
- the others add to any of the the cygwin init batch files ( You have done it already)
- start eclipse NOT from cygwin command line but from Windows ( as any other windows program )
Eclipse is independent from cygwin. Eclipse use cygwin for build and for execution. Its method that Eclipse Titan plugin starts a cygwin command "sh -c <any cywin command>". In this shell your cygwin environment will be set first then the program will start. You can check it from Eclipse, from the console view. For example:
sh -c ln -sf '/cygdrive/c/Users/ETHBAAT/runtime-titan_debug/HW/src/A.ttcn' 'A.ttcn'
Operation finished successfully.
( see attachment)
Best regards
Jeno Balasko
-
Attachment: Console.PNG
(Size: 171.11KB, Downloaded 2125 times)
|
|
|
Re: Cannot make Demo Example from Titan [message #1714263 is a reply to message #1714223] |
Wed, 11 November 2015 08:43 |
|
Hi Burhan,
Use ./MyExample and any parallel component this way from cygwin (and from linux) command line:
$ ttcn3_start MyExample MyConfig.cfg
Note: ttcn3_start is a script. It executes a difficult algorithm described in the titan user guide ( Chapter 4, especially 4.4.5 of userguide.pdf, 1/198 17-CRL 113 200/5 )
Best regards
Jeno Balasko
|
|
|
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714668 is a reply to message #1714665] |
Sun, 15 November 2015 11:20 |
|
Hi Muhammad,
probably the quickest thing you can do is to reinstall everything from scratch as it's not easy to figure out what went wrong.
A piece of advice: Titan for MinGW has a very limited functionality , it can only be used to verify the syntax and semantics, but no execution is possible.
If you want to make your life easier , use some mainstream Linux (Ubuntu, Suse) instead of Cygwin or MinGW.
Best regards
Elemer
|
|
|
|
Re: Cannot make Demo Example from Titan [message #1714717 is a reply to message #1714713] |
Mon, 16 November 2015 08:07 |
|
Hi Muhammad,
at first execute "make clean" after that execute "make".
The line "Notify: None of the files needed update." shows that the C++ generation was not refreshed.
The line "g++ -c -DWIN32 -I/home/b.hassan/install/include -Wall -o hello_world.o hello_world.cc" shows that your TTCN3_DIR is correctly set for "/home/b.hassan/install/" and g++ shall search include files (also) in folder "/home/b.hassan/install/include". And that directory should contain TTCN3.hh - if everything is installed correctly.
Best regards
Jeno Balasko
|
|
|
|
|
|
|