Difference between revisions of "Compiling EiffelStudio"

(Checking out from SVN)
(Updated to 15.01)
 
(106 intermediate revisions by 17 users not shown)
Line 4: Line 4:
 
== Installing EiffelStudio ==
 
== Installing EiffelStudio ==
  
To compile EiffelStudio, you need an already working EiffelStudio compiler on your machine. The current source tree '''requires at least version 5.7''' of EiffelStudio. You can download it from http://eiffelsoftware.origo.ethz.ch/downloads/builds/. This version still requires a registration (we missed to remove the registration cluster while compiling). You need to '''activate''' EiffelStudio (see below), because in some cases the compiler won't work correctly if not activated. [[Installing EiffelStudio]] is covered in its own article.
+
To compile EiffelStudio, you need an already working EiffelStudio compiler on your machine. The current source tree '''requires at least version 15.01''' of EiffelStudio. You can download it from [[Downloads]]. Read the [http://docs.eiffel.com/eiffelstudio/installation/ existing documentation] to install EiffelStudio.
  
'''Note:''' on Windows you will need the Microsoft C compiler to compile Eiffel Studio. How to install the free version of the Microsoft C compiler: [[Installing Microsoft C compiler]]
+
'''Note:''' on Windows you will need the Microsoft C compiler to compile Eiffel Studio. How to install the free version of the Microsoft C compiler: [[Installing Microsoft C compiler]]. It is not possible to compile EiffelStudio with the MinGW C compiler (GCC).
  
 
===Compilation methods===
 
===Compilation methods===
 
Currently there are two compilation methods.  
 
Currently there are two compilation methods.  
* You can either compile EiffelStudio from scratch following the instructions in this document. This is the only method on Windows.
+
* You can compile EiffelStudio from scratch following the instructions in this document ('''This is the recommended approach''').
* Alternatively (on Linux/UNIX) you can use a compilation script that Bernd Schoeller has kindly posted to the developer mailinglist: [http://origo.ethz.ch/pipermail/es-devel/2006-April/000016.html Linux compilation script]
+
* You can use one of the [[Automatic Build Scripts]], and if you encounter any errors please report them to the [http://forums.eiffel.com EiffelStudio Development forum].
If possible, use the compilation script and report any errors to the developer mailing list.
+
  
 
==Extracting source code==
 
==Extracting source code==
 +
 +
Before checking out the source code, make sure to configure subversion properly using the [[Subversion_Settings|following instructions]].
  
 
===Checking out from SVN===
 
===Checking out from SVN===
#Point an environment variable called '''EIFFEL_SRC''' to the directory where you want to compile EiffelStudio<br>Usually we use the '''XXdev''' convention for this directory name - where XX is the version number from the current developped version of the compiler.
+
#Point the environment variables called '''EIFFEL_SRC''' and '''ISE_LIBRARY''' to the directory where you want to compile EiffelStudio.<br>Usually we use the '''XXdev''' convention for this directory name - where XX is the version number of the currently developed version of the compiler.
#Make sure that '''ISE_EIFFEL''', '''ISE_PLATFORM''' and '''ISE_C_COMPILER''' (on windows only) are properly defined
+
#Make sure that '''ISE_EIFFEL''', '''ISE_PLATFORM''' and '''ISE_C_COMPILER''' (on Windows only) are properly defined. '''ISE_EIFFEL''' should point to the directory where you installed EiffelStudio, '''ISE_PLATFORM''' is the name of your platform (see [http://docs.eiffel.com/book/eiffelstudio/software-installation-eiffelstudio our documentation website for more details]) and '''ISE_C_COMPILER''' is only for the Windows platforms and it has to be msc (Visual Studio). At this time we do not support mingw (GCC) on Windows due to Microsoft specific dependencies.
 
#Perform the following checkout procedures:
 
#Perform the following checkout procedures:
  
  
'''Windows'''
+
'''DOS'''
 
<pre>
 
<pre>
set SVNURL=https://eiffelsoftware.origo.ethz.ch/svn/es
+
set SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
svn co %SVNURL%/trunk/Src -N 57dev
+
svn co %SVNURL%/Src 15.01_dev
svn co %SVNURL%/trunk/Src/bench/C 57dev/C
+
svn co %SVNURL%/free_add_ons 15.01_dev/free_add_ons
svn co %SVNURL%/trunk/Src/bench/Eiffel 57dev/Eiffel
+
svn co %SVNURL%/trunk/Delivery -N 57dev/Delivery
+
svn co %SVNURL%/trunk/free_add_ons 57dev/free_add_ons
+
 
+
cd 57dev
+
svn up C_library
+
svn up dotnet
+
svn up library
+
svn up library.net
+
svn up tools
+
 
</pre>
 
</pre>
  
 
'''Bash'''
 
'''Bash'''
 
<pre>
 
<pre>
export SVNURL=https://eiffelsoftware.origo.ethz.ch/svn/es
+
export SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
svn co $SVNURL/trunk/Src -N 57dev
+
svn co $SVNURL/Src 15.01_dev
svn co $SVNURL/trunk/Src/bench/C 57dev/C
+
svn co $SVNURL/free_add_ons 15.01_dev/free_add_ons
svn co $SVNURL/trunk/Src/bench/Eiffel 57dev/Eiffel
+
svn co $SVNURL/trunk/Delivery -N 57dev/Delivery
+
svn co $SVNURL/trunk/free_add_ons 57dev/free_add_ons
+
 
+
cd 57dev
+
svn up C_library
+
svn up dotnet
+
svn up library
+
svn up library.net
+
svn up tools
+
 
</pre>
 
</pre>
  
  
To update the sourcefiles to the latest revision, perform the following steps:
+
To update the source files to the latest revision, perform the following steps:
  
'''Bash and Windows'''
+
'''Bash and DOS'''
 
<pre>
 
<pre>
cd 57dev
+
cd 15.01_dev
svn up C
+
svn up
svn up Eiffel
+
 
svn up free_add_ons
 
svn up free_add_ons
svn up C_library
 
svn up dotnet
 
svn up library
 
svn up library.net
 
svn up tools
 
</pre>
 
 
==Installing gobo==
 
 
Please make sure to use the version provided or the very latest version from CVS. All other versions (including the official 3.4 release) will not work because of name clashes in the UC_STRING class between GOBO and EiffelStudio.<br/>
 
As the anonymous CVS on sourceforge is currently broken, use the following link from the gobo newsgroup to get the [http://www.gobosoft.com/download/gobo-cvs-060418.zip CVS-checkout of 18.April].
 
 
 
===Windows specific===
 
 
You have to unzip the gobo distribution from $EIFFEL_SRC/free_add_ons/gobo/gobo_34_win.tgz and extract it into $EIFFEL_SRC/library.
 
 
===Unix specific===
 
 
You have to unzip the gobo distribution from $EIFFEL_SRC/free_add_ons/gobo/gobo_34_unix.tgz and extract it into $EIFFEL_SRC/library. Here is the list of commands to do this:
 
<pre>cd $EIFFEL_SRC/library
 
tar -xvzf $EIFFEL_SRC/free_add_ons/gobo/gobo_34_unix.tgz
 
 
</pre>
 
</pre>
  
Line 93: Line 51:
 
===Compiling run-time on Windows===
 
===Compiling run-time on Windows===
  
Before being able to compile the run-time, you need to ensure that '''bash''' is in your '''PATH'''. You can download it from [http://www.cygwin.com http://www.cygwin.com]. Also make sure, that the path to the binaries of your c compiler is placed before the path to cygwin or else the wrong linker will be used. Once done you can do:
+
'''DOS'''
 +
<pre>cd %EIFFEL_SRC%/C
 +
configure [win32|win64] [b|g|m|m6]</pre>
  
 +
'''Bash'''
 
<pre>cd $EIFFEL_SRC/C
 
<pre>cd $EIFFEL_SRC/C
configure [win32|win64] [b|m]</pre>
+
./configure.bat [win32|win64] [b|g|m|m6]</pre>
  
The first argument indicated whether you are compiling the run-time for 32 or 64 bits. The second one is to tell which C compiler will be used. For now only `b' (Borland) and `m' (Microsoft) are officially supported. We also informally support `g' (GCC) and `l' (LCC).
+
The first argument indicated whether you are compiling the run-time for 32 or 64 bits. The second one is to tell which C compiler will be used. For now only `b' (Borland), `g' (MinGW), `m' (Microsoft) and `m6' (for those forced to use Microsoft VC++ 6.0) are officially supported.
  
On Windows 32 bits to clean up all the generated files you do:
+
On Windows 32 bits to clean up all the generated files '''(including the library files needed by EiffelStudio)''' it suffices to do:
<pre>configure clean</pre>
+
  
On Windows 64 bits, you do:
+
'''DOS'''
<pre>configure cleand</pre>
+
<pre>configure clean</pre>
 +
'''Bash'''
 +
<pre>./configure.bat clean</pre>
  
 
===Compiling run-time on Unix===
 
===Compiling run-time on Unix===
Line 112: Line 74:
 
./quick_configure</pre>
 
./quick_configure</pre>
 
This requires that '''ISE_PLATFORM''' is properly defined. The `quick_configure' script will look for the file CONFIGS/$ISE_PLATFORM and use it to extract the platform specific information to compile the run-time. If not found then an error will be reported.
 
This requires that '''ISE_PLATFORM''' is properly defined. The `quick_configure' script will look for the file CONFIGS/$ISE_PLATFORM and use it to extract the platform specific information to compile the run-time. If not found then an error will be reported.
 +
 +
To clean up the generated files '''including the library files needed by EiffelStudio''':
 +
<pre>make clobber</pre>
  
 
===Compiling C code from libraries===
 
===Compiling C code from libraries===
Line 117: Line 82:
 
Here is the list of commands to compile all required C libraries on Windows:
 
Here is the list of commands to compile all required C libraries on Windows:
  
 +
'''DOS'''
 +
<pre>cd %EIFFEL_SRC%\library\net\Clib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%\library\vision2\Clib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%\library\wel\Clib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%\library\cURL\Clib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%\library\web_browser\Clib
 +
finish_freezing -library</pre>
 +
'''Bash'''
 
<pre>cd $EIFFEL_SRC/library/net/Clib
 
<pre>cd $EIFFEL_SRC/library/net/Clib
make_msc.bat
+
finish_freezing -library
 
cd $EIFFEL_SRC/library/vision2/Clib
 
cd $EIFFEL_SRC/library/vision2/Clib
make_msc.bat
+
finish_freezing -library
 
cd $EIFFEL_SRC/library/wel/Clib
 
cd $EIFFEL_SRC/library/wel/Clib
make_msc.bat</pre>
+
finish_freezing -library
 +
cd $EIFFEL_SRC/library/cURL/Clib
 +
finish_freezing -library
 +
cd $EIFFEL_SRC/library/web_browser/Clib
 +
finish_freezing -library</pre>
  
 
On Unix it is slightly different:
 
On Unix it is slightly different:
<pre>cd $EIFFEL_SRC/library/event/Clib
+
<pre>cd $EIFFEL_SRC/library/net/Clib
finish_freezing -library
+
cd $EIFFEL_SRC/library/net/Clib
+
 
finish_freezing -library
 
finish_freezing -library
 
cd $EIFFEL_SRC/library/vision2/Clib
 
cd $EIFFEL_SRC/library/vision2/Clib
 
finish_freezing -library
 
finish_freezing -library
 
cd $EIFFEL_SRC/library/vision2/implementation/gtk/Clib
 
cd $EIFFEL_SRC/library/vision2/implementation/gtk/Clib
 +
finish_freezing -library
 +
cd $EIFFEL_SRC/library/cURL/Clib
 
finish_freezing -library</pre>
 
finish_freezing -library</pre>
  
Line 138: Line 119:
 
===Compiling C code from C_library===
 
===Compiling C code from C_library===
  
This is only required on Windows to read PNG file. On Unix, this is not required because it is included in GTK+2.4. Simply do the following:
+
This is only required on Windows to read PNG file. On Unix, this is not required because it is included in GTK+2.4. So on Windows, simply do the following:
 +
 
 +
'''DOS'''
 +
<pre>cd %EIFFEL_SRC%/C_library/zlib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%/C_library/libpng
 +
finish_freezing -library</pre>
 +
'''Bash'''
 
<pre>cd $EIFFEL_SRC/C_library/zlib
 
<pre>cd $EIFFEL_SRC/C_library/zlib
make_msc.bat
+
finish_freezing -library
 
cd $EIFFEL_SRC/C_library/libpng
 
cd $EIFFEL_SRC/C_library/libpng
make_msc.bat</pre>
+
finish_freezing -library</pre>
  
 
===Compiling C code from compiler===
 
===Compiling C code from compiler===
Line 153: Line 141:
  
 
Once properly installed, you can do:
 
Once properly installed, you can do:
<pre>cd $EIFFEL_SRC/Eiffel/library/cli_writer/Clib
+
 
nmake</pre>
+
'''DOS'''
 +
<pre>cd %EIFFEL_SRC%/framework/cli_writer/Clib
 +
finish_freezing -library
 +
cd %EIFFEL_SRC%/framework/cli_debugger/Clib
 +
finish_freezing -library</pre>
 +
'''Bash'''
 +
<pre>cd $EIFFEL_SRC/framework/cli_writer/Clib
 +
finish_freezing -library
 +
cd $EIFFEL_SRC/framework/cli_debugger/Clib
 +
finish_freezing -library</pre>
  
 
==Compiling EiffelStudio==
 
==Compiling EiffelStudio==
  
Now that we have taken care of the C code compilation we can compile the compiler. There are four ace files in $EIFFEL_SRC/Eiffel/Ace:
+
Now that we have taken care of the C code compilation we can compile the compiler. We assume that '''ec''' is in your path.
* batch.mswin.ace
+
* newbench.mswin.ace
+
* batch.unix.ace
+
* newbench.linux.ace
+
The first two are for windows, the last two for unix (even if the last one says `linux').
+
  
To compile simply do:
+
The configuration file of the compiler contains two active targets:
<pre>ec -ace <chosen_ace_file> -c_compile</pre>
+
* '''batch''': for the command line compiler.
 +
* '''bench''': for the graphical compiler, aka EiffelStudio.
  
Please note: the 'ec' binary produced by the newbench .ace file contains the full Eiffel compiler, including the batch version. 'estudio' is just a wrapper (available in Src/bench/C/ipc/daemon). So, you need either the one or the other.
+
Go to $EIFFEL_SRC/Eiffel/Ace and type the following command and replace ''target_name'' with either '''batch''' or '''bench'''.
  
===Windows specific===
+
<pre>ec -config ec.ecf -target target_name -c_compile</pre>
  
At the end of the compilation for the workbench version, the C compilation will fail reporting an undefined reference to `nbref'. This is because the ace file has been built for the finalized version of EiffelStudio not the workbench version. To fix this problem do the following:
+
===Mac OS X specific===
<pre>copy ec.lnk h</pre>
+
Then edit the file `h' and replace '''mtcompiler.lib''' by '''mtwcompiler.lib'''.
+
Once this is done you can complete you do:
+
<pre>link @h</pre>
+
In order to update to the new version of metadata consumer tool, follow the instructions described [[Compiling Metadata Consumer|here]].
+
 
+
===Unix specific===
+
 
+
Like the windows version the C compilation, it will fail, but this time for two reasons:
+
* nbref
+
* linking order causing many errors to be reported
+
 
+
Here is the recommended way, make a copy of the generated Makefile and put it at the same level as your EIFGEN directory. Edit it and replace '''libmtcompiler.a''' by '''libmtwcompiler.a''', then search for "$(EXTERNALS) $(EIFLIB)" and replace it by "$(EIFLIB) $(EXTERNALS)". Once this is done, you can do:
+
<pre>make -f ../../Makefile</pre>
+
  
A little script that does the necessary changes: Place it at the same level as the EIFGEN directory is.
+
Get a mac binary from [[EiffelOnMac|here]], then follow the instructions for unix.
  
<code>[bash,N]
+
==Launching the Compiler==
#!/bin/bash
+
 
+
cp EIFGEN/W_code/Makefile .
+
sed 's/libmtcompiler\.a/libmtwcompiler\.a/g' Makefile > tmp
+
sed 's/\$(EXTERNALS) \$(EIFLIB)/\$\(EIFLIB\) \$\(EXTERNALS\)/g' tmp > Makefile
+
cd EIFGEN/W_code
+
make -f ../../Makefile
+
</code>
+
 
+
'''Note:''' These changes are not required if you try to compile a finalized version of EiffelStudio, but only if you want to create a workbench version of EiffelStudio for development and debugging.
+
 
+
Also, if you encounter problems with your self-compiled version of EiffelStudio, you might try to compile it with GCC 3.x. Version 4 of GCC has a slight change in semantics and EiffelStudio has not been updated. You can see the change in behavior in the following code:
+
 
+
<code>[C,N]
+
#include <stdio.h>
+
 
+
int a;
+
int b;
+
int *pointer;
+
 
+
int foo()
+
{
+
  pointer = &b;
+
  return 4;
+
}
+
 
+
int main (int argc, char** argv)
+
{
+
  a = 3;
+
  b = 0;
+
 
+
  pointer = &a;
+
 
+
  *pointer = foo();
+
 
+
  printf ("You are using GCC %d.%d\n",a,b);
+
  return 0; 
+
}
+
</code>
+
 
+
===Mac OS X specific===
+
  
The basic steps are:
+
There are two ways of launching the compiler:
* compile it under linux
+
# Command line compiler: add the following arguments '''-config path_to_config_file.ecf'''. This will compile the project represented by `path_to_config_file.ecf'
* copy the F_Code directory to the mac
+
# Graphical compiler (aka EiffelStudio): add the following argument '''-gui'''.
* compile it there using make
+
* fix whatever problems appear
+

Latest revision as of 09:08, 19 February 2015


Installing EiffelStudio

To compile EiffelStudio, you need an already working EiffelStudio compiler on your machine. The current source tree requires at least version 15.01 of EiffelStudio. You can download it from Downloads. Read the existing documentation to install EiffelStudio.

Note: on Windows you will need the Microsoft C compiler to compile Eiffel Studio. How to install the free version of the Microsoft C compiler: Installing Microsoft C compiler. It is not possible to compile EiffelStudio with the MinGW C compiler (GCC).

Compilation methods

Currently there are two compilation methods.

Extracting source code

Before checking out the source code, make sure to configure subversion properly using the following instructions.

Checking out from SVN

  1. Point the environment variables called EIFFEL_SRC and ISE_LIBRARY to the directory where you want to compile EiffelStudio.
    Usually we use the XXdev convention for this directory name - where XX is the version number of the currently developed version of the compiler.
  2. Make sure that ISE_EIFFEL, ISE_PLATFORM and ISE_C_COMPILER (on Windows only) are properly defined. ISE_EIFFEL should point to the directory where you installed EiffelStudio, ISE_PLATFORM is the name of your platform (see our documentation website for more details) and ISE_C_COMPILER is only for the Windows platforms and it has to be msc (Visual Studio). At this time we do not support mingw (GCC) on Windows due to Microsoft specific dependencies.
  3. Perform the following checkout procedures:


DOS

set SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
svn co %SVNURL%/Src 15.01_dev
svn co %SVNURL%/free_add_ons 15.01_dev/free_add_ons

Bash

export SVNURL=https://svn.eiffel.com/eiffelstudio/trunk
svn co $SVNURL/Src 15.01_dev
svn co $SVNURL/free_add_ons 15.01_dev/free_add_ons


To update the source files to the latest revision, perform the following steps:

Bash and DOS

cd 15.01_dev
svn up
svn up free_add_ons

Compiling C libraries

Compiling run-time on Windows

DOS

cd %EIFFEL_SRC%/C
configure [win32|win64] [b|g|m|m6]

Bash

cd $EIFFEL_SRC/C
./configure.bat [win32|win64] [b|g|m|m6]

The first argument indicated whether you are compiling the run-time for 32 or 64 bits. The second one is to tell which C compiler will be used. For now only `b' (Borland), `g' (MinGW), `m' (Microsoft) and `m6' (for those forced to use Microsoft VC++ 6.0) are officially supported.

On Windows 32 bits to clean up all the generated files (including the library files needed by EiffelStudio) it suffices to do:

DOS

configure clean

Bash

./configure.bat clean

Compiling run-time on Unix

The command is simply:

cd $EIFFEL_SRC/C
./quick_configure

This requires that ISE_PLATFORM is properly defined. The `quick_configure' script will look for the file CONFIGS/$ISE_PLATFORM and use it to extract the platform specific information to compile the run-time. If not found then an error will be reported.

To clean up the generated files including the library files needed by EiffelStudio:

make clobber

Compiling C code from libraries

Here is the list of commands to compile all required C libraries on Windows:

DOS

cd %EIFFEL_SRC%\library\net\Clib
finish_freezing -library
cd %EIFFEL_SRC%\library\vision2\Clib
finish_freezing -library
cd %EIFFEL_SRC%\library\wel\Clib
finish_freezing -library
cd %EIFFEL_SRC%\library\cURL\Clib
finish_freezing -library
cd %EIFFEL_SRC%\library\web_browser\Clib
finish_freezing -library

Bash

cd $EIFFEL_SRC/library/net/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/vision2/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/wel/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/cURL/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/web_browser/Clib
finish_freezing -library

On Unix it is slightly different:

cd $EIFFEL_SRC/library/net/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/vision2/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/vision2/implementation/gtk/Clib
finish_freezing -library
cd $EIFFEL_SRC/library/cURL/Clib
finish_freezing -library

Make sure that ISE_EIFFEL is set correctly to your current "EiffelStudio" installation!

Compiling C code from C_library

This is only required on Windows to read PNG file. On Unix, this is not required because it is included in GTK+2.4. So on Windows, simply do the following:

DOS

cd %EIFFEL_SRC%/C_library/zlib
finish_freezing -library
cd %EIFFEL_SRC%/C_library/libpng
finish_freezing -library

Bash

cd $EIFFEL_SRC/C_library/zlib
finish_freezing -library
cd $EIFFEL_SRC/C_library/libpng
finish_freezing -library

Compiling C code from compiler

This is only required on Windows as this C code is a tiny wrapper around the Microsoft C++ API to generate and to debug .NET code.

To compile it, you first need to install the Microsoft .NET SDK. You can download it from their website.

After installing it, you need to update your LIB and INCLUDE environment variable to include the path the lib and include directory of the .NET Framework SDK.

Once properly installed, you can do:

DOS

cd %EIFFEL_SRC%/framework/cli_writer/Clib
finish_freezing -library
cd %EIFFEL_SRC%/framework/cli_debugger/Clib
finish_freezing -library

Bash

cd $EIFFEL_SRC/framework/cli_writer/Clib
finish_freezing -library
cd $EIFFEL_SRC/framework/cli_debugger/Clib
finish_freezing -library

Compiling EiffelStudio

Now that we have taken care of the C code compilation we can compile the compiler. We assume that ec is in your path.

The configuration file of the compiler contains two active targets:

  • batch: for the command line compiler.
  • bench: for the graphical compiler, aka EiffelStudio.

Go to $EIFFEL_SRC/Eiffel/Ace and type the following command and replace target_name with either batch or bench.

ec -config ec.ecf -target target_name -c_compile

Mac OS X specific

Get a mac binary from here, then follow the instructions for unix.

Launching the Compiler

There are two ways of launching the compiler:

  1. Command line compiler: add the following arguments -config path_to_config_file.ecf. This will compile the project represented by `path_to_config_file.ecf'
  2. Graphical compiler (aka EiffelStudio): add the following argument -gui.