Compiling Tup on Windows

419 views
Skip to first unread message

Evgeny Andreeshchev

unread,
Apr 4, 2013, 1:59:29 PM4/4/13
to tup-...@googlegroups.com
Greetings!

Are there any instructions available on compiling tup on Windows?

I've got fresh ming32 installation, latest sources from git://github.com/gittup/tup.git 
and tried both "tup upd" and build.sh, both report some errors.

"tup upd" command results in 
tup error: Unable to find tup entry for file 'win32.tup'

and ./build,sh fails with:
Package fuse was not found in the pkg-config search path.
Perhaps you should add the directory containing `fuse.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fuse' found
 
Thank you
Evgeny

Mike Shal

unread,
Apr 4, 2013, 2:05:50 PM4/4/13
to tup-...@googlegroups.com
Hi Evgeny,
The Windows binaries are actually cross-compiled from Linux - I don't know how much work would be involved to get it to compile locally in Windows. Do you have a Linux machine available? If so you can install gcc-mingw there. Eg on Ubuntu:

sudo apt-get install gcc-mingw-w64-i686
cd tup
echo 'CONFIG_TUP_MINGW=i686-w64-mingw32' >> tup.config
./bootstrap.sh

Then you should get tup.exe and tup-dllinject.dll in addition to the Linux executable. You can copy those two files to your Windows machine for testing.

-Mike

Evgeny Andreeshchev

unread,
Apr 4, 2013, 5:40:36 PM4/4/13
to tup-...@googlegroups.com
Hey Mike, thank you for the quick reply!

After some editing of Tupfiles I succeeded in building with mingw32 on Windows.

For this I had to comment out some of the linux specific commands in root Tupfile and change !cc macro to empty one.
I will try cross-compiling from linux in case I face any difficulities with my build.

Best wishes,
Evgeny

Nathan Brown

unread,
Apr 8, 2013, 2:05:18 PM4/8/13
to tup-...@googlegroups.com
To debug the dllinject portion of Tup in Visual Studio, I managed to compile it in Visual Studio.  I had to change how Tup used the Windows headers because the platform SDK headers must have diverged quite a bit from what is available on Linux.

Mike Shal

unread,
Apr 8, 2013, 3:21:09 PM4/8/13
to tup-...@googlegroups.com
So is it worthwhile officially supporting building tup with mingw locally on Windows? I didn't realize it is just some Tupfile changes (though I guess that shouldn't be too surprising, since it's mingw in both places). I'm probably thinking of the original patches to support compiling with Visual Studio locally on Windows, which were fairly invasive.

Is it worthwhile supporting building just the dll injection code in Visual Studio? Or does compiling locally with mingw allow for better debugging as well? I don't think it will be easy to get full Visual Studio support, but if just dll injection helps then that would be a good first step.

Thanks,
-Mike

--
--
tup-users mailing list
email: tup-...@googlegroups.com
unsubscribe: tup-users+...@googlegroups.com
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups "tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tup-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Evgeny Andreeshchev

unread,
Apr 18, 2013, 11:19:04 AM4/18/13
to tup-...@googlegroups.com
Just to clarify my statement about "some Tupfile changes" - it didn't try bootstraping, I used existing precompiled tup to compile it. 

Kennis Koldewyn

unread,
Jun 13, 2013, 12:59:14 AM6/13/13
to tup-...@googlegroups.com
I'm running 64-bit Debian, and would like to cross-compile for 64-bit Windows 7.  I've installed gcc-mingw-w64-x86-64 (the GCC for MinGW-w64 targeting Win64), and discovered via Google that I should set CONFIG_TUP_MINGW to x86_64-w64-mingw32.  However, when I run bootstrap.sh, I get the following error:

* 8) src/dllinject: MINGW32CC dllinject.c                                     
dllinject.c: In function 'tup_inject_dll':
dllinject.c:1894:27: error: 'CONTEXT' has no member named 'Eip'
dllinject.c:1895:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:70: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1909:5: error: 'CONTEXT' has no member named 'Eip'
dllinject.c:1909:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 *** tup errors ***
 *** Command ID=1249 failed with return value 1
tup error: Expected to write to file 'dllinject.omingw' from cmd 1249 but didn't
 *** Additionally, command 1249 failed to process input dependencies. These should probably be fixed before addressing the command failure.
 9) [0.790s] src/compat/win32: MINGW32CC dirpath.c                            
 10) [0.624s] src/compat/win32: MINGW32CC mmap.c                              
 11) [0.523s] src/compat/win32: MINGW32CC open.c                              
 [     ETA~=<1s      ]  57%
 *** tup: 1 job failed.

Any ideas?  I've tried it with both gcc 4.7 and 4.8 with the same result.


On Thursday, April 4, 2013 2:05:50 PM UTC-4, mar...@gmail.com wrote:
Hi Evgeny,

Mike Shal

unread,
Jun 13, 2013, 2:58:06 PM6/13/13
to tup-...@googlegroups.com
Hi Kennis,


On Thu, Jun 13, 2013 at 12:59 AM, Kennis Koldewyn <kennis....@gmail.com> wrote:
I'm running 64-bit Debian, and would like to cross-compile for 64-bit Windows 7.  I've installed gcc-mingw-w64-x86-64 (the GCC for MinGW-w64 targeting Win64), and discovered via Google that I should set CONFIG_TUP_MINGW to x86_64-w64-mingw32.  However, when I run bootstrap.sh, I get the following error:

* 8) src/dllinject: MINGW32CC dllinject.c                                     
dllinject.c: In function 'tup_inject_dll':
dllinject.c:1894:27: error: 'CONTEXT' has no member named 'Eip'
dllinject.c:1895:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1896:70: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dllinject.c:1909:5: error: 'CONTEXT' has no member named 'Eip'
dllinject.c:1909:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 *** tup errors ***
 *** Command ID=1249 failed with return value 1
tup error: Expected to write to file 'dllinject.omingw' from cmd 1249 but didn't
 *** Additionally, command 1249 failed to process input dependencies. These should probably be fixed before addressing the command failure.
 9) [0.790s] src/compat/win32: MINGW32CC dirpath.c                            
 10) [0.624s] src/compat/win32: MINGW32CC mmap.c                              
 11) [0.523s] src/compat/win32: MINGW32CC open.c                              
 [     ETA~=<1s      ]  57%
 *** tup: 1 job failed.

Any ideas?  I've tried it with both gcc 4.7 and 4.8 with the same result.



Unfortunately tup only works on 32-bit Windows at the moment. The MinGW compiler I use has the prefix 'i686-w64-mingw32'. Ideally the DLL injection code would support both 32 & 64-bit, but I don't know how hard it will be to convert it.

-Mike

Kennis Koldewyn

unread,
Jun 13, 2013, 4:10:59 PM6/13/13
to tup-...@googlegroups.com
Mike, thanks for the quick reply.  Sorry I was too lazy to look at the tup source late last night.  Now that I have, it looks like it may not be terribly difficult to support 64 bit.  Eip becomes Rip, DWORD becomes DWORD_PTR, etc.

Consider this a desperate plea for tup on 64-bit Windows—as far as I'm concerned, all other build systems were written by trolls!

Cheers,

- Kennis


On Thursday, June 13, 2013 2:58:06 PM UTC-4, mar...@gmail.com wrote:
Hi Kennis,
Reply all
Reply to author
Forward
0 new messages