public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Roland Schwingel <roland@onevision.com>
To: insight@sourceware.org, kobus@spamcop.net
Subject: Re: Steps to build Insight for Windows
Date: Fri, 02 Nov 2012 10:06:00 -0000	[thread overview]
Message-ID: <50939B2B.9090903@onevision.com> (raw)

Hi Kobus,

insight-owner@sourceware.org wrote on 01.11.2012 07:29:23:

 > From: Kobus Engelbrecht <kobus@spamcop.net>
 > Hi
 >
 > I have a clean Windows XP Pro SP3 32-bit vritual machine on which I
 > want to run the latest version of Insight.
 >
 > Can you please email me and also make a link under
 > "http://www.sourceware.org/insight/faq.php" that shows step by step
 > what software I must download, where I must download it from, which
 > versions it should be, how it should be setup/installed and the
 > commands I need to enter.
 >
 > I assume you need cygwin to do this. If so, please state which options
 > should be installed since the default settings doesn't seem enough.
 >
 > In short, a foolproof recipe nobody (including me) can get wrong.
I do not have a real foolproof recipe but these are the major steps I 
do. It is not a really smooth procedure.

Build environment:
Mingw/msys with either the stock mingw gcc toolchain or the mingw-w64 
toolchain. The benefit of the mingw-w64 toolchain is that you can build
both 32bit and 64bit insight binaries. I still use gcc 4.6.2 toolchains. 
64bit is still a bit more tricky but can be done by exchanging tcl/tk 
with 8.6 version. If you do it using cygwin you most likely end up with 
a cygwin binary which will need X11 for the gui. Maybe not what you 
want. At least I don't want this. The sourceware.org repos contains a 
tcl/tk 8.4 version which is quite old nowadays and it does not support 
64bit windows. With some tweaking it compiles but I am using a (slightly 
handcrafted) 8.6b2 version. When 8.6 gets final I will try to make a 
patch replacing the old intree tcl/tk with 8.6.

Here is my brief way to do it:
(some of the steps are recapped from memory or some set aside notes,
  but most I do have performed just some days ago on windows 7 64bit
  to generate a 32bit stock insight binary).
1. Install mingw/msys with a gcc 4.6 toolchain.
2. Check out CVS source of insight from sourceware.org. You need the
    following folders:
    bfd,etc,expat,gdb,include,itcl,libdecnumber,libgui,
    libiberty,opcode,readline,tcl,tk
    plus *ALL* files in the toplevel hierarchy.
    I suggest to check them out eg in D:\compile\insight_src
    (you can check out the whole tree but than building will take way
     longer as of the fact libraries are buildt insight is not using).
    For CVS operations I use cygwin. I check out the whole tree and
    remove the folders I do not need.
3. Start a msys window and cd to /d/compile
4. mkdir insight_obj
5. cd insight_obj
6. ../insight_src/configure --prefix=/d/compile/insight_bin
    (This configures insight to build in insight_obj and install to
    insight_bin).
7. make
    (now it will start out to configure/build the individual components.
     It will fail compiling in tcl.)
8. Change the following lines in the following files:
    tcl/win/tclWinChan.c - lines 125/126 should be changed to:
    static void __attribute__ ((used)) *ESP;
    static void __attribute__ ((used)) *EBP;
    tcl/win/tclWinDde.c - line 1178:
    objv += (async + 3);
    tcl/win/tclWinReg.c - line 750:
    while (*(p)++ != 0) {}
    Some of these changes are a little rude but I don't matter here as
    insight does not really uses this. We just need to get it compiled!
    These changes are only neccessary for the old intree tcl to get it
    compiled with a decent gcc. (4.6.2 in my case). With 8.6 I do not
    have heavy changes.
9. make
    (it passes now tcl but fails later in configuring libgui because of
    not finding tcl/tk configs.)
10. cd tcl && make install && cd ..
11. cd tk && make install && cd ..
12. cd libgui
13. make "TK_INCLUDES=-I/d/compile/insight_src/tk/generic 
-I/d/compile/insight_src/tk/unix -I/d/compile/insight_src/tk/win"
14. cd ..
15. make
     (It should succeed now without any further errors)
16. make install
     (All binaries are now installed into D:\compile\insight_bin)
17. /d/compile/insight_bin/bin/insight.exe
     (insight should now startup ...)

Roland

             reply	other threads:[~2012-11-02 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 10:06 Roland Schwingel [this message]
     [not found] <1357848662.20894.ezmlm@sourceware.org>
2013-01-10 20:46 ` Hugh Sparks
2013-01-10 22:47   ` Keith Seitz
  -- strict thread matches above, loose matches on Subject: below --
2012-11-01  6:29 Kobus Engelbrecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50939B2B.9090903@onevision.com \
    --to=roland@onevision.com \
    --cc=insight@sourceware.org \
    --cc=kobus@spamcop.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).