It is currently Thu May 17, 2012 4:20 pm


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Sun Oct 12, 2008 10:18 pm 
Offline

Joined: Sun Oct 12, 2008 10:07 pm
Posts: 3
Successfully compiled GNS3 on Windows (Tested on XP-SP2 and Vista-64Bit)

Packages Needed:
---------------------

A- GNS3 Source
------------------

Stable (No Modification Required) http://www.gns3.net/download
OR
Development Version (Needs little modification) http://code.gns3.net/hgwebdir.cgi/gns3-devel/archive/tip.zip

B- Dependences
-------------------

Download these packages but don't install anything yet
Python http://www.python.org/download/
QT http://trolltech.com/developer/downloads/qt/windows
PYQT http://www.riverbankcomputing.co.uk/pyqt/download.php
SIP http://www.riverbankcomputing.co.uk/sip/download.php
MinGW http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
Py2EXE http://sourceforge.net/project/showfiles.php?group_id=15583

Steps:
--------

1- Prepare Python & Dependences
----------------------------------------

Follow this guide
http://www.diotavelli.net/PyQtWiki/BuildPyQt4Windows
Quote:
======================================================
The No-fuss Guide to Building PyQt on Windows XP
======================================================
:Date: 2007-07-11
:Author: Martin Blais <[email protected]>
:Abstract:

This document contains instructions on building PyQt under Windows,
using the pre-built binary version of Qt installed via its
installer.


Introduction
============
Typically, you want to built the PyQt snapshots when it is lagging a
little bit behind the Qt release. When I wrote this document, I wanted
to build PyQt for Qt-4.3.3 and there was no binary at that time.

See this thread for more details:
http://www.mail-archive.com/pyqt%40rive ... html#11081

Note: follow these instructions to-the-letter. This is Windows. Any
slight variation might throw you off.

Versions
--------
This document is up-to-date for the following versions:

- Qt-4.3.3
- Python-2.5
- MinGW-5.1.3
- SIP snapshot as of 2007-07-11
- PyQt4 snapshot as of 2007-07-11


Detailed Instructions
=====================
Installing Qt
-------------
- Grab the binary installer (.exe) for the latest Qt release on
TrollTech's webpage.
- Execute the installation, with or without MinGW depending on if you
already have it.

This will place Qt in ``C:\Qt\<version>`` by default.

Installing Python
-----------------
- Download the Python MSI binary from the python.org website and run
it, and install it (typically in ``C:\Python25\python.exe``).

Installing MinGW
----------------
You will need an install of MinGW that contains ``mingw32-make.exe``.
Install MinGW using the binaries from the MinGW website. I placed
mine in ``C:\MinGW``.

- Make sure you have::
C:\MinGW\bin/mingw32-make.exe
C:\MinGW\bin/g++.exe

Setting up for Build
--------------------
You MUST use the ``cmd.exe`` shell, and not Cygwin's bash nor MinGW
nor MKS not anything else.

Start ``cmd.exe`` and set your PATH to something clean that contains
both MinGW and Qt::

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Qt\4.3.3\bin;C:\MinGW\bin

Verify your PATH configuration by running these two commands::

g++ -v
qmake -v


Building and Installing SIP
---------------------------
- Download and unpack the SIP snapshot source for Windows.
- Configure it, making sure to use the ``-p`` option (otherwise the
build runs in an infinite loop)::

C:\tmp\sip-snapshot-20070704> C:/Python25/python configure.py -p win32-g++
C:\tmp\sip-snapshot-20070704> mingw32-make
C:\tmp\sip-snapshot-20070704> mingw32-make install

This should install the following files in your Python library::

C:\Python25\include\sip.h
C:\Python25\Lib\site-packages\sip.pyd
C:\Python25\Lib\site-packages\sipconfig.py
C:\Python25\Lib\site-packages\sipconfig.pyc
C:\Python25\Lib\site-packages\sipdistutils.py
C:\Python25\sip.exe


Building and Installing PyQt
----------------------------
Using the same shell setup as above,
- Download and unpack the PyQt4 snapshot source for Windows.
- Configure it::

C:\tmp\PyQt-win-gpl-4-snapshot-20070710> C:/Python25/python configure.py -w
Determining the layout of your Qt installation...
C:\Qt\4.3.3\bin\qmake.exe -o qtdirs.mk qtdirs.pro
mingw32-make -f qtdirs.mk release
mingw32-make -f qtdirs.mk.Release
mingw32-make[1]: Entering directory `C:/tmp/PyQt-win-gpl-4-snapshot-20070710'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE [...]
g++ -enable-stdcall-fixup -Wl,-enable-auto-import [...]
lqtmain -lQtCore4
mingw32-make[1]: Leaving directory `C:/tmp/PyQt-win-gpl-4-snapshot-20070710'
release\qtdirs.exe
This is the GPL version of PyQt 4-snapshot-20070710 (licensed under the GNU
General Public License) for Python 2.5 on win32.

Type 'L' to view the license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

Do you accept the terms of the license? yes
Checking to see if the QtGui module should be built...
g++ -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -I. -IC:\Qt\4.3.3\mkspecs\default [...]
[...]

This should complete succesfully.

Note: you should not have to set any variable. QTDIR is now
obsolete. QMAKESPEC should be found automatically, but if it is not,
you can probably safely use the ``-p win32-g++`` option.

- Compile it::

C:\tmp\PyQt-win-gpl-4-snapshot-20070710> mingw32-make

- Install it::

C:\tmp\PyQt-win-gpl-4-snapshot-20070710> mingw32-make install


This should install the following files::

C:/Python25
C:/Python25/Lib/site-packages
C:/Python25/Lib/site-packages/PyQt4
C:/Python25/Lib/site-packages/PyQt4/pyqtconfig.py
C:/Python25/Lib/site-packages/PyQt4/Qt.pyd
C:/Python25/Lib/site-packages/PyQt4/QtAssistant.pyd
C:/Python25/Lib/site-packages/PyQt4/QtCore.pyd
C:/Python25/Lib/site-packages/PyQt4/QtDesigner.pyd
C:/Python25/Lib/site-packages/PyQt4/QtGui.pyd
C:/Python25/Lib/site-packages/PyQt4/QtNetwork.pyd
C:/Python25/Lib/site-packages/PyQt4/QtOpenGL.pyd
C:/Python25/Lib/site-packages/PyQt4/QtScript.pyd
C:/Python25/Lib/site-packages/PyQt4/QtSql.pyd
C:/Python25/Lib/site-packages/PyQt4/QtSvg.pyd
C:/Python25/Lib/site-packages/PyQt4/QtTest.pyd
C:/Python25/Lib/site-packages/PyQt4/QtXml.pyd
C:/Python25/Lib/site-packages/PyQt4/uic
C:/Python25/Lib/site-packages/PyQt4/uic/Compiler
C:/Python25/Lib/site-packages/PyQt4/uic/Loader
C:/Python25/Lib/site-packages/PyQt4/uic/widget-plugins
C:/Python25/Lib/site-packages/sip.pyd
C:/Python25/Lib/site-packages/sipconfig.py
C:/Python25/Lib/site-packages/sipconfig.pyc
C:/Python25/pylupdate4.exe
C:/Python25/pyrcc4.exe
C:/Python25/pyuic4.bat
C:/Python25/sip
C:/Python25/sip/PyQt4
C:/Python25/sip/PyQt4/Qt
C:/Python25/sip/PyQt4/Qt/Qtmod.sip
C:/Python25/sip/PyQt4/QtAssistant
C:/Python25/sip/PyQt4/QtCore
C:/Python25/sip/PyQt4/QtDesigner
C:/Python25/sip/PyQt4/QtGui
C:/Python25/sip/PyQt4/QtNetwork
C:/Python25/sip/PyQt4/QtOpenGL
C:/Python25/sip/PyQt4/QtScript
C:/Python25/sip/PyQt4/QtSql
C:/Python25/sip/PyQt4/QtSvg
C:/Python25/sip/PyQt4/QtTest
C:/Python25/sip/PyQt4/QtXml


Test It
=======
Run Python and import PyQt4 to test it::

C:\tmp\PyQt-win-gpl-4-snapshot-20070710>C:/Python25/python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.Qt import *
>>> from sip import *
>>> print SIP_VERSION_STR, QT_VERSION_STR, PYQT_VERSION_STR


2-Compiling GNS3
---------------------

A- First install py2exe
B- Download GNS3 binary version and copy GNS3.ico to c:\
C- After that, run cmd and go to GNS3 source directory and type (change PATH directories to your installed directories for python,qt...)
Code:
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Python\Qt\4.3.4\bin;C:\Python\MinGW\bin;C:\Python\Python25;C:\Python\MinGW\libexec\gcc\mingw32\3.4.2
python setup.py py2exe


Tip: Create new Batch file in GNS3 folder (same directory of setup.py) and name it (CompileGNS3.bat), open it and type latest 2 command lines, then make a shortcut for it on your desktop

Important Note (To Compile Development Version of GNS3)
-------------------------------------------------------------------------

If you are using Development Version of GNS3 Sourcecode, you will need to modify gns3 file.
Open GNS3 File in main source folder and Change
Code:
# catch exceptions to write them in a file
sys.excepthook=exceptionHook
source_path = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'src'
if os.access(source_path, os.F_OK):
    sys.path.append(source_path)
import GNS3.Main
TO
Code:
# catch exceptions to write them in a file
sys.excepthook=exceptionHook
if os.access('./src', os.F_OK):
    sys.path.append('./src')
import GNS3.Main


3- Final Step
---------------

You finally will need to copy 2 DLL files from QT Bin folder (..\Qt\4.3.4\bin\) to compiled GNS3 directory (..\GNS3\dist)
QtSvg4.dll
QtXml4.dll

Have a nice time with this great software






Top
 Profile  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Tue Oct 14, 2008 7:00 pm 
Offline

Joined: Tue Oct 14, 2008 6:57 pm
Posts: 76
Very nice write up!

_________________
-------

LBSources
- GNS3 .. Cisco Routing on Your Desktop

Get some GNS3 labs @ http://www.gns3-labs.com


Top
 Profile  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Tue Jul 07, 2009 8:09 pm 
Wow, what a tutorial. Very detailed and useful. Perfect guide to compiling gns3 on windows. thanks.


Top
  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Mon Dec 07, 2009 7:36 pm 
Hi,

I'm totally newbie to compiling and all that stuff, so please apologize for my noob question : does it works for compiling in 64 bit ?
I'd like to use the full potential of RAM in win64bit for GNS3, and no precompiled, newbie-proof, 64 bit version of GNS3 ... I'm completely lost !

Thanks for the how to by the way.


Top
  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Thu Mar 11, 2010 6:03 am 
Thanks !
it's very userful


Top
  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Sat Apr 03, 2010 1:59 pm 
I'm new new to the GNS3 program and I'm not even sure if this topic pertains to my issues with the program. When you say compile GNS3 for windows are you saying that you need all of that software you listed for it to work properly or are you doing something different than just making the program work? I've gotten the program to run and read my ios files I downloaded but I cannot get the console to work with puddy or telnet. In puddy the console freezes with a green rectangle at the top left of the screen and in tell net it freezes or give me a long loop of an error...

Image


Top
  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Sat Jul 10, 2010 12:57 am 
That is a great information
Thanks,


Top
  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Wed Apr 20, 2011 1:55 pm 
Offline

Joined: Fri Mar 11, 2011 7:39 pm
Posts: 550
Location: Israel
Hello,

Can you update this please ?

I cannot compile "qemuwrapper.py" into .exe.

I did:
E:\adevel-vbox\GNS3-0.7.3-src\qemuwrapper>C:\Python27\python.exe make-qemuwrapper-exe.py

usage: make-qemuwrapper-exe.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts]
...]
or: make-qemuwrapper-exe.py --help [cmd1 cmd2 ...]
or: make-qemuwrapper-exe.py --help-commands
or: make-qemuwrapper-exe.py cmd --help

error: no commands supplied

Any ideas?

-Technologov


Top
 Profile  
 
 Post subject: Re: Step by Step Guide (How to Compile GNS3 on Windows)
PostPosted: Wed Apr 20, 2011 6:00 pm 
Offline

Joined: Mon Apr 18, 2011 2:32 pm
Posts: 7
What!!!this is boombastic,i need alot of time to understand these terms but anyway the floor should come in to help new entrants catchup with the gns3 crew,breakdown these terms guys!!






Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO