Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: support mingw/cygwin makefile cmake target with cl compiler, for make -j #71

Closed
derekbruening opened this issue Nov 27, 2014 · 5 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on March 03, 2009 18:25:20

now that we have cmake we can support different build system targets

to get parallel builds we should try mingw or cygwin makefile target from
cmake but using the cl compiler

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=71

@derekbruening
Copy link
Contributor Author

From [email protected] on March 06, 2009 08:23:55

xref http://www.cmake.org/pipermail/cmake/2006-December/012199.html They talk about using cygwin gnu make with cl, how you need a patched gnu
make (probably the colon-in-path being interpreted as a pattern rule issue,
especially since they say 3.81 does not work: we could revive the 3.80
make.exe I had in make/), and how gnu make is slower than nmake. -j5 gets
it closer but nmake is still faster, meaning this may not be worthwhile
after all (though this post is running a pretty short build so it may not
be representative): http://www.cmake.org/pipermail/cmake/2006-December/012201.html My own time tests show nmake as faster but not so much faster that -jN
wouldn't beat it:

Windows:
/usr/bin/time cmake -G"NMake Makefiles" -DBUILD_TOOLS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF
-DBUILD_DRGUI:BOOL=OFF -DBUILD_SAMPLES:BOOL=OFF ../dynamorio; /usr/bin/time nmake
0:05.46 + 0:51.10 => 0:56.56
make DEBUG=0 INTERNAL=0 clean; /usr/bin/time make DEBUG=0 INTERNAL=0
1:06.21

Linux:
/usr/bin/time cmake -DBUILD_TOOLS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF
-DBUILD_DRGUI:BOOL=OFF -DBUILD_SAMPLES:BOOL=OFF ../dynamorio; /usr/bin/time make -j 4
0:02.67 + 0:11.94 => 0:14.61
make DEBUG=0 INTERNAL=0 clean; /usr/bin/time make DEBUG=0 INTERNAL=0
0:33.07

@derekbruening
Copy link
Contributor Author

From [email protected] on March 11, 2009 14:48:35

The way to get this to work is to use the native Windows cmake to get the right
paths, but ask for -G"Unix Makefiles". I also had to specify all of the compiler
vars explicitly to avoid cmake picking up gcc tools. Then, using a pre-3.81 cygwin
make.exe I was able to build in parallel:

seq => 1:40.39 (why so much slower than pre-cmake? the status updates?)
-j2 => 0:58.56
-j3 => 0:44.45
-j4 => 0:39.43
-j5 => 0:37.29
-j6 => 0:36.03
-j7 => 0:36.07

hand-removing the status updates which were indeed quite slow w/ cygwin (separate
cmake invocation for each one):
for i in find . -name \*build.make; do sed -i '/cmake_echo/d;/progress/d' $i; done
gmake seq => 1:07.59
gmake -j6 => 0:30.79
nmake seq => 0:46.07

I tried mingw make, which is faster than cygwin make, but its -j support wasn't
working: not sure why: xref http://www.cmake.org/pipermail/cmake/2008-April/021341.html TODO:

  • write up concrete examples in HowtoBuild.wiki
  • re-instate the 3.80 make.exe in make/
  • find cmake feature for disabling progress/status messages: I don't think it exists
    though
  • figure out how to get mingw to enable its -j: should be even faster

@derekbruening
Copy link
Contributor Author

From [email protected] on March 11, 2009 15:57:52

I filed a CMake bug requesting an option to disable progress+status messages: http://www.cmake.org/Bug/view.php?id=8726

@derekbruening
Copy link
Contributor Author

From [email protected] on March 11, 2009 17:30:56

r86 has instructions for building in parallel on Windows and re-instates make.exe

I gave up on mingw as its sh.exe doesn't run very well on 64-bit XP (I can run it
from 32-bit cmd but not from cygwin even via cmd /c). The sequential build was 1:32,
vs 1:40 for cygwin make, so it could shave a few seconds off the parallel build if
someone wants to try it on a 32-bit machine. Resolving this issue though.

Status: Verified

@derekbruening
Copy link
Contributor Author

From [email protected] on April 16, 2009 06:47:09

Update: msys 1.0.11 (tech preview: still in beta) fixes the bug on xp64 and I was
able to build in the msys shell, but only after replacing all the / delimiters with -.
I filed a CMake bug on supporting the msys+cl combination: http://www.cmake.org/Bug/view.php?id=8817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant