Skip to content

Installation under windows 64 bit

Yihui Xie edited this page Jan 19, 2015 · 10 revisions

Please see http://cranvas.org/download.html instead.

Build qtbase

  1. Install R and Rtools. Add the following to your PATH, in which ... should be substituted by the directory that installed R and Rtools.
...\Rtools\bin;
...\Rtools\gcc-4.6.3\bin;
...\R\bin\x64;
  1. Install cmake 2.8.11 from http://www.cmake.org/files/v2.8/cmake-2.8.11-win32-x86.exe. Add ...\CMake 2.8\bin to the PATH.

  2. Download MinGW from http://sourceforge.net/projects/mingwbuilds/ Install it with settings: Version - 4.8.1; Architecture - x64; Threads - posix; Exception - sjlj; Build revision - rev5. Then add it to PATH. (For example, ...\MinGW\bin) NOTE: No spaces are allowed in the directory.

  3. Install Perl and add its bin to the PATH.

  4. Download Qt from http://download.qt-project.org/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.zip and extract it somewhere, for example, C:\Qt\4.8.4\. Add its bin folder to PATH. (C:\Qt\4.8.4\bin)

  5. Open C:/Qt/4.8.4/mkspecs/win32-g++/qmake.conf and set both QMAKE_CFLAGS and QMAKE_LFLAGS to "-m64". Also, add "-F pe-x86-64" to QMAKE_RC. (i.e., QMAKE_RC = $${CROSS_COMPILE}windres -F pe-x86-64)

  6. Open C:/Qt/4.8.4/qmake/Makefile.win32-g++-sh, add "-m64" to CFLAGS (i.e., CFLAGS = -c -o$@ -O -m64 \) and change LFLAGS to "-s -m64". (i.e., LFLAGS = -s -m64)

  7. Run the following two lines (one by one) in the command prompt under the Qt directory (C:/Qt/4.8.4/). This Qt compiling step may take 3-4 hours.

configure -release -opensource -nomake examples -nomake demos -no-qt3support
mingw32-make
  1. If you get an error like: __cpuid(info, 1) was not declared in this scope, then open C:/Qt/4.8.4/src/corelib/tools/qsimd.cpp, add #include <intrin.h> on top.

  2. Create the CMAKE environment variable and set it to point to your cmake.exe. (for example, ...\CMake 2.8\bin\cmake.exe)

  3. Set QMAKE environment variable to point to qmake.exe. (for example, C:\Qt\4.8.4\bin\qmake.exe)

  4. Set RC_COMPILER environment variable to point to windres.exe from Rtools. Make sure to change the backslash(\) to slash(/) here. (for example, .../Rtools/gcc-4.6.3/bin/windres.exe)

  5. Set QTBASE_QT_PATH to the directory containing qmake.exe. (for example, C:\Qt\4.8.4\bin)

  6. Make sure perl, cmake, Qt, R-64bit, Rtools, Rtools-gcc, MinGW are on your PATH. Example PATH to build qtbase (better to put these before others):

		C:\MinGW\bin;
		C:\Program Files\Rtools\bin;
		C:\Program Files\Rtools\gcc-4.6.3\bin;
		C:\Program Files\R\bin\x64;
		C:\Qt\4.8.4\bin;
		C:\Perl\strawberry\perl\bin\;
		C:\Program Files\CMake 2.8\bin;
		[... other directories ...]
  1. Download qtbase from https://github.com/ggobi/qtbase/archive/master.zip and unzip it. It does not matter where you unzip it. Change the folder name from "qtbase-master" to "qtbase".

  2. (This should be fixed in code) Check qtbase/src/mkdef.sh Change sed -n $1 tmp >> qtbase.def to

	sed -n 's/^.* [BCDRT] / /p' tmp >> qtbase.def
  1. Make a copy of the whole qtbase folder. Put it in another directory, or just rename it. Don't delete this clean copy until you successfully install qtbase after step 17.

  2. Start the command shell, go to the directory containing qtbase (i.e., the parent directory of qtbase). Run:

		R CMD INSTALL --build qtbase
Please make sure the folder qtbase is completely clean (i.e., has never been built).
If not, get the clean copy from step 16.

Build qtpaint

  1. Add the ...\qtbase\local\lib to PATH. where ... is replaced by your R library path. Run ?.libPaths in R to find out it.

  2. Download glext.h from http://www.opengl.org/registry/api/glext.h And copy it to C:\Qt\4.8.4\src\opengl\

    Add a line to C:\Qt\4.8.4\include\QtOpenGL\qgl.h :

#include "../../src/opengl/glext.h"
??? An alternative way is editing `OpenGLPainter.cpp`
	#ifdef Q_OS_WIN
	#include "glext.h"
	#endif
  1. Download qtpaint Start the command shell, go to the directory containing qtpaint. Run:
	R CMD INSTALL --build qtpaint