Updated COMPILE.txt file ; the Windows build process now uses a customizable CMake options file.

This commit is contained in:
Hombre
2010-12-19 05:17:51 +01:00
parent 97d376af30
commit 6618a412c7
2 changed files with 173 additions and 99 deletions

View File

@@ -5,135 +5,177 @@ http://www.rawtherapee.com/forum/viewforum.php?f=10
Windows Windows
------- -------
The toolchain:
There is 2 method to compile RawTherapee, and they each rely on different and common packages. They are
now referred to METHOD 1 and METHOD 2.
Of course, you'll have to install the package for the build method explained later in this document.
The rest of this document assumes that you've installed MinGW, MSYS and Gtkmm respectively to "C:\mingw",
"C:\msys" and "C:\Gtkmm".
This tutorial assume that you've installed the packages in a paths THAT DOES NOT CONTAIN SPACES.
METHOD 1:
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
- MSYS (http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe)
If you have some trouble installing MSYS, see here : http://www.mingw.org/wiki/MSYS
- CMake (http://www.cmake.org/cmake/resources/software.html)
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
METHOD 2:
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
- CMake (http://www.cmake.org/cmake/resources/software.html)
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
Additionnal steps:
When all the packages of your preferred method are installed:
- set the GTKMM_BASEPATH user or system environment variable to the installation directory of Gtkmm
(the Gtkmm's installer can do it for you)
- set the MINGW_BASEPATH user or system environment variable to the installation directory of MinGW32
You have to restart the console to take this new variables into account
- Copy the "Win32CMakeOptions-sample.txt" file located in the root directory of RT's source tree, to "cmo.txt" (e.g.)
You can edit that copy to change the compilation flags to your needs, but the default values should be fine.
Dependancies: Dependancies:
This section explain how to build the libraries needed by RawTherapee, and not provided in other packages. RawTherapee rely on libraries that may not be part of the Gtkmm or MinGW package. There is two ways of installing
For your convenience, those libraries has been precompiled and are downloadable at : thoses libraries.
http://www.rawtherapee.com/releases_head/windows/dependancies/ The simple way:
If you don't find a suitable package for your toolchain, build it yourself if you can or ask a developer For your convenience, those libraries has been precompiled and are downloadable at :
to do it for you.
Just unpack the content of this archive to the base installation dir of MinGW, and everything http://www.rawtherapee.com/releases_head/windows/dependancies/
should work fine.
Requirements: If you don't find a suitable package for your toolchain, take the DIY way or ask a developer
- MinGW + MSYS to build them for you.
Let's say that you have intalled them respectively to "C:\mingw" and "C:\msys".
This tutorial assume that you've installed MinGW and MSYS in a path that does not contain spaces
Open an MSYS console and compile the dependancies in that order: Just unpack the content of this archive to the base installation dir of MinGW, and everything
should work fine.
zlib: The "Do It Yourself" way:
If you have Gtkmm2.22 installed, you can skip this section
- download: http://zlib.net/
- how to build:
cd to the unarchiving directory of zlib-1.2.5
make -f win32/Makefile.gcc
Then, manually copy the files as follows: The MSYS package is required to build the libraries. See above for the download link.
cp -iv zlib1.dll /mingw/bin Before building them, look if they are already installed in your Gtkmm and MinGW directories. There should be
cp -iv zconf.h zlib.h /mingw/include two versions of the same library in different place.
cp -iv libz.a /mingw/lib
cp -iv libzdll.a /mingw/lib/libz.dll.a
libpng: Open an MSYS console, that will create a Linux environment, and compile the dependancies in that order:
If you have Gtkmm2.22 installed, you can skip this section
- download: http://sourceforge.net/projects/libpng/files/
(please note that libpng 1.5 has not been tested yet)
- how to build:
cd to the unarchiving directory of lpng144
There's two options to build libpng : zlib:
1. gtkmm doesn't provide zlib so i've compiled it myself If you have Gtkmm2.22 installed, you can skip this section
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_BUILD_TYPE:STRING=Release - download: http://zlib.net/
2. gtkmm provide zlib and i want to reuse it (so we're assuming that you didn't compiled zlib like explained here above) - how to build:
cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_PREFIX_PATH:PATH=C:/gtkmm2.22 -DCMAKE_BUILD_TYPE:STRING=Release cd to the unarchiving directory of zlib-1.2.5
make -f win32/Makefile.gcc
Then build and install: Then, manually copy the files as follows:
make
make install
libjpeg: cp -iv zlib1.dll /mingw/bin
- download: http://www.ijg.org/ cp -iv zconf.h zlib.h /mingw/include
- how to build: cp -iv libz.a /mingw/lib
cd to the unarchiving directory of jpeg-8b cp -iv libzdll.a /mingw/lib/libz.dll.a
./configure --prefix=/mingw
copy the content of jconfig.txt to jconfig.h (overwrite the existing file)
make
make install
libtiff: libpng:
- download: ftp://ftp.remotesensing.org/pub/libtiff/ If you have Gtkmm2.22 installed, you can skip this section
- how to build: - download: http://sourceforge.net/projects/libpng/files/
./configure --prefix=/mingw (please note that libpng 1.5 has not been tested yet)
make - how to build:
cd libtiff cd to the unarchiving directory of lpng144
make install
libiptcdata: There's two options to build libpng :
- download: http://libiptcdata.sourceforge.net/ 1. gtkmm doesn't provide zlib so i've compiled it myself
- how to build: cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_BUILD_TYPE:STRING=Release
./configure --prefix=/mingw 2. gtkmm provide zlib and i want to reuse it (so we're assuming that you didn't compiled zlib like explained here above)
edit iptc\main.c and comment out lines 830 up to 859 (libiptcdata-1.0.4) cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw -DCMAKE_PREFIX_PATH:PATH=C:/gtkmm2.22 -DCMAKE_BUILD_TYPE:STRING=Release
make
make install
lcms: Then build and install:
- download v1.x (2.x is not implemented yet): http://sourceforge.net/projects/lcms/files/ make
- how to build: make install
./configure --prefix=/mingw
make
make install
Rawzor: libjpeg:
provided in RT's source tree (downloaded from http://www.rawzor.com/developers/) - download: http://www.ijg.org/
- how to build:
cd to the unarchiving directory of jpeg-8b
./configure --prefix=/mingw
copy the content of jconfig.txt to jconfig.h (overwrite the existing file)
make
make install
IMPORTANT: libtiff:
1. When all the compilations are done (or even before), don't forget to set the PKG_CONFIG_PATH - download: ftp://ftp.remotesensing.org/pub/libtiff/
environment variable to the location of the pkgconfig dir, usually c:\mingw\lib\pkgconfig - how to build:
2. Make sure that the *.pc files of the dependancies, located in the pkgconfig dir, has the first ./configure --prefix=/mingw
line like this : prefix=/mingw make
cd libtiff
make install
If everything is well installed, you should see the following lines when running the cmake command (see below) : libiptcdata:
-- checking for module 'libiptcdata' - download: http://libiptcdata.sourceforge.net/
-- found libiptcdata, version 1.0.4 - how to build:
-- checking for module 'lcms<=1.99' ./configure --prefix=/mingw
-- found lcms, version 1.19
-- Found JPEG: C:/mingw/lib/libjpeg.dll.a Edit the "Makefile" file from the root dir of libiptcdata, and search for "DIST_SUBDIRS ="
-- Found ZLIB: C:/gtkmm2.22/lib/libz.dll.a and "SUBDIRS =". You should only find one line for each search. From those lines, remove "iptc", then
-- Found PNG: C:/gtkmm2.22/lib/libpng.lib
-- Found TIFF: C:/mingw/lib/libtiff.dll.a make
make install
lcms:
- download v1.x (v2.x is not supported yet): http://sourceforge.net/projects/lcms/files/
- how to build:
./configure --prefix=/mingw
make
make install
Rawzor:
provided in RT's source tree (downloaded from http://www.rawzor.com/developers/)
IMPORTANT:
1. When all the compilations are done (or even before), don't forget to set the PKG_CONFIG_PATH
user or system environment variable to the location of the pkgconfig dir, usually c:\mingw\lib\pkgconfig
You have to restart the console to take this new variable into account
2. Make sure that the *.pc files of the dependancies, located in the pkgconfig dir, has the first
line like this : prefix=/mingw
If everything is well installed, you should see the following lines when running the cmake command (see "Building RT" below) :
-- checking for module 'libiptcdata'
-- found libiptcdata, version 1.0.4
-- checking for module 'lcms<=1.99'
-- found lcms, version 1.19
-- Found JPEG: C:/mingw/lib/libjpeg.dll.a
-- Found ZLIB: C:/gtkmm2.22/lib/libz.dll.a
-- Found PNG: C:/gtkmm2.22/lib/libpng.lib
-- Found TIFF: C:/mingw/lib/libtiff.dll.a
Building RT: Building RT:
METHOD 1: METHOD 1:
Requirements: Requirements:
- MinGW + MSYS - MinGW + MSYS (FIXME: Do we talk
- CMake - CMake
- GTK and GTKMM development environments - GTK and GTKMM development environments
Compile: Compile:
- Start MSYS - Start an MSYS command line interface
- Enter the root directory of the RawTherapee source tree - Enter the root directory of the RawTherapee source tree (type: cd "/C/Absolute/Path/To/RawTherapee_sourceTree")
- Type: cmake -G "MSYS Makefiles" . - Type: cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt .
- Type: make install - Type: make install
- You find the compiled program in the release directory - You'll find the compiled program in the subdirectory named like the value of CMAKE_BUILD_TYPE ("Release" in this example)
METHOD 2: METHOD 2:
Requirements: Requirements:
- tdm-gcc (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download) - MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download)
- cmake (http://www.cmake.org/cmake/resources/software.html) - CMake (http://www.cmake.org/cmake/resources/software.html)
- mercurial (http://mercurial.selenic.com/wiki/WindowsInstall) - Mercurial (http://mercurial.selenic.com/wiki/WindowsInstall)
- gtkmm (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/) - Gtkmm (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/)
Compile: Compile:
- Enter the root directory of the RawTherapee source tree - Start a standard DOS command line interface (WIN + "R" -> "cmd")
- Type: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./release -DBINDIR=. -DDATADIR=. -DLIBDIR=. - Enter the root directory of the RawTherapee source tree (type: cd C:\Absolute\Path\To\RawTherapee_sourceTree)
- Type: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -Ccmo.txt .
- Type: mingw32-make.exe install - Type: mingw32-make.exe install
- You find the compiled program in the "release" directory - You'll find the compiled program in the subdirectory named like the value of CMAKE_BUILD_TYPE ("Release" in this example)
Linux Linux
----- -----
@@ -145,7 +187,7 @@ Linux
- ...did I forget something? - ...did I forget something?
On Ubuntu/Debian the requirements can be installed by running: On Ubuntu/Debian the requirements can be installed by running:
sudo apt-get install build-essential cmake libgtk2.0-dev libgtkmm-2.4-dev libtiff-dev libpng-dev libjpeg-dev liblcms-dev libiptcdata-dev merciurial sudo apt-get install build-essential cmake libgtk2.0-dev libgtkmm-2.4-dev libtiff-dev libpng-dev libjpeg-dev liblcms-dev libiptcdata-dev mercurial
Compile: Compile:
- Enter the root directory of the RawTherapee source tree - Enter the root directory of the RawTherapee source tree

View File

@@ -0,0 +1,32 @@
#set (CMAKE_BUILD_TYPE Release CACHE STRING "Between: None Debug Release RelWithDebInfo MinSizeRel.")
set(CMAKE_PREFIX_PATH ./Builds/${CMAKE_BUILD_TYPE} CACHE PATH "Libraries installation path")
set(DATADIR . CACHE PATH "Datas installation path")
set(BINDIR . CACHE PATH "Binaries installation path")
set(LIBDIR . CACHE PATH "Libraries installation path")
set(CMAKE_PREFIX_PATH $ENV{GTKMM_BASEPATH} $ENV{MINGW_BASEPATH} CACHE STRING "Additional search paths")
set (BUILD_SHARED OFF CACHE BOOL "Should RT generate shared libraries")
set (WITH_RAWZOR ON CACHE BOOL "With Rawzor")
set (OPTION_OMP ON CACHE BOOL "Use OpenMP to speedup the preview and batch processing")
# set WITH_MYFILE_MMAP to OFF if you experience crash whith thumbnail creation (it should be slower, but more reliable)
set (WITH_MYFILE_MMAP ON CACHE BOOL "Use the MMAP mechanism to speedup thumbnail creations")
# Tune the build to your CPU and its instruction set
set(CMAKE_CXX_FLAGS "-mwindows -mwin32 -mthreads -march=native" CACHE STRING "Compiler options for C++ source files")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g2" CACHE STRING "Compiler options for C++ source files and Debug target")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2" CACHE STRING "Compiler options for C++ source files and Release target")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os" CACHE STRING "Compiler options for C++ source files and MinSizeRel target")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Compiler options for C++ source files and RelWithDebInfo target")
set(CMAKE_C_FLAGS "-mwindows -mwin32 -mthreads -march=native" CACHE STRING "Compiler options for C source files")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g2" CACHE STRING "Compiler options for C source files and Debug target")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2" CACHE STRING "Compiler options for C source files and Release target")
set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os" CACHE STRING "Compiler options for C source files and MinSizeRel target")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Compiler options for C source files and RelWithDebInfo target")
set(CMAKE_EXE_LINKER_FLAGS "-mwindows -mwin32 -mthreads -mthread -march=native -static-libgcc -static-libstdc++" CACHE STRING "Linker options")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-O0" CACHE STRING "Linkage options for the Debug target")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -O2" CACHE STRING "Linkage options for the Release target")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-s -Os" CACHE STRING "Linkage options for the MinSizeRel target")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "Linkage options for the RelWithDebInfo target")