Compiling

sunderme edited this page May 5, 2018 · 5 revisions

This page contains some information on how to compile TeXstudio on different platforms.

General dependencies

You need the following libraries to compile TeXstudio:

  • Qt (Qt 5.9.x version is recommended,latest is 5.10.x, but it contains bugs in the structure view). However it should work with Qt >= 4.4.
  • Poppler, if you want to use the internal pdf viewer
  • Phonon, if you want to watch movies in the internal pdf viewer

You can set the path to the libraries by passing INCLUDEPATH=<your path> LIBS=<your path> to qmake

Windows

Prerequisites

  • Recent Qt SDK available from qt.io (Qt 5.9.x recommended. However older versions should work, too.)
  • If you want to compile the most recent code, you need to clone from the github repository. For this you need a git client, e.g. TortoiseGit. Then create an empty directory and clone https://github.com/texstudio-org/texstudio.git into this directory.
  • You need to copy all dll files from a 2.12.6 texstudio installation into your build directory (This is the directory in which texstudio.exe will be created. It depends on your setting in QtCreator.) You may skip this step and perfrom it later after setting up the build in QtCreator. If the dlls are not in the correct directory, the build will fail with a message on missing dlls.

Newer builds by us are generated via mxe.cc on linux. poppler is statically linked into the binary thus no newer dll is available.

Setting up

When you open texstudio.pro for the first time in QtCreator, it will ask you for the targets. The default settings are fine. This creates a debug and a relase target.

Debug Version

No further settings are required to build and run the application. However this is not suited for distribution, because the application will depend on the debug versions of the Qt dlls. For a distributable version you should build a relase version.

Recent QtCreator documentation suggests that debugging now works out of the box (I have not tested this so far. Please confirm if you tried it).

Release Version

Release settings To build a release version, make needs a relase command line argument. This is done in Build Settings -> Make -> Make arguments (see image to the right).

Compile

  • Start QtCreator.
  • Open texstudio.pro
  • Optionally change the target (debug/release).
  • Build texstudio. (Strg+B in Qt Creator)
  • if "libzlib.dll" is not found by the linker (in the build step), try to set an aboslute reference. Change in texstudio.pro "LIBS += -lzlib \" to "LIBS += C:\yourPath\libzlib1.dll \"

Start

  • Start texstudio.exe (Strg+R in Qt Creator)

Building on multiple cores

To speed up the compilation process by running it on multiple cores, you may optionally use jom instead of mingw-make. See 1.

Linux

Compiling on Linux is very easy, because you can find all needed libraries in your package manager.

After installing the development versions of Qt, Poppler and Phonon (latter two optionally), there are various ways to compile it:

  • You can call "qmake; make" and "make install" to install it
  • Or you can call "./BUILD.sh"
  • Or you can open texstudio.pro in Qt Creator and build it there
  • Or you can use a compile tool of your distribution, if it provides one

Ubuntu

The following was reported to download and compile the TXS 2.6.6 Version under Ubuntu 12.04 (when newer versions of TXS are released this will probably also work when exchanging the version numbers below with the most recent ones):

apt-get install build-essential debhelper devscripts libpoppler-qt5-dev
wget 'https://github.com/texstudio-org/texstudio/archive/2.12.8.tar.gz' --output-document=texstudio-2.12.8.tar.gz
cp texstudio-2.12.8.tar.gz texstudio_2.12.8.orig.tar.gz
tar -xf texstudio-2.12.8.tar.gz
cd texstudio*
debuild

Mac

Overview

On Mac you need to install homebrew.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then install some essential packages in the terminal:

`brew install qt5`
`brew install poppler --with-qt5`

Next go to the TeXstudio source folder in the terminal:

`/usr/local/opt/qt5/bin/qmake texstudio.pro`
`make -j 4`

Alternatively you can use the ./BUILD.sh script (if the $PATH is set correctly, not by default). Now the texstudio.app should be in your source folder.

Optional (if you want a DMG file to use on other computers running OSX 10.8)

     `/usr/local/opt/qt5/bin/macdeployqt texstudio.app -dmg`
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.