Build Instructions

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Requirements)
(Older Versions)
 
(144 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Quicklinks}}
+
{{Quicklinks|Build_Instructions}}
  
 
This page covers building OpenSimulator from source code on multiple platforms.  Please help us keep this page up to date as the project progresses. If you just want to run OpenSimulator, [[Download]] and [[Configuration|run]] the binary build instead. In the most cases, you should be fine with binaries.
 
This page covers building OpenSimulator from source code on multiple platforms.  Please help us keep this page up to date as the project progresses. If you just want to run OpenSimulator, [[Download]] and [[Configuration|run]] the binary build instead. In the most cases, you should be fine with binaries.
Line 12: Line 12:
 
Although this page is long, building is generally quite simple.  See the BUILDING.txt file in the distribution itself for simplified instructions.
 
Although this page is long, building is generally quite simple.  See the BUILDING.txt file in the distribution itself for simplified instructions.
  
== Requirements ==
+
== Version 0.9.3.0 and above ==
 +
Microsoft stopped the development of .Net Framework and Mono, replacing them by new dotnet
 +
This is a significant breaking change that we try to follow on 0.9.3.0.
  
OpenSimulator 0.8.x and 0.9.0.x requires either
+
=== Get source code ===
* [http://msdn.microsoft.com/en-us/netframework/cc378097 .NET Framework 4.0] on Windows
+
* [https://www.mono-project.com/download/stable/ Mono] on Linux or Mac.  Mono 2.10.8 is the minimum version.
+
  
 +
get or update source from git
  
OpenSimulator 0.9.1 requires either
+
git clone git://opensimulator.org/git/opensim
* [http://msdn.microsoft.com/en-us/netframework/cc378097 .NET Framework 4.6] on Windows
+
* [https://www.mono-project.com/download/stable/ Mono] on Linux or Mac.  Mono 5.12 is the minimum recommended version.
+
  
Other platforms may require compile mono on them.
+
=== Building on Windows ===
 +
To building under Windows, the following is required:
  
Other libraries used by OpenSimulator can be found at our opensim-libs git repo.
+
* [https://dotnet.microsoft.com/en-us/download/dotnet/6.0 dotnet 6.0 SDK and Desktop Runtime]
git clone git://opensimulator.org/git/opensim-libs
+
  
You may need to compile them for your platform, in particular the unmanaged ones like Bullet or ODE native code libraries
+
optionally also
  
== MS Windows ==
+
* Visual Studio .NET, version 2022 or later
  
=== Supported Compilers ===
 
* [https://visualstudio.microsoft.com/downloads/ Visual Studio Community 2017]
 
Any version that does support the .Net version can be used. For example for opensimulator versions prior to 0.9.1 VS2010 can be used.
 
  
=== Compiling in an IDE ===
+
Create the project files running:
# Run "runprebuild.bat"
+
# Open the resulting "OpenSim.sln" in any Visual Studio IDE.
+
# Build (or Debug) -> Build Solution.
+
  
===Compiling at the Command Prompt ===
+
runprebuild.bat
# Run "runprebuild.bat".
+
# Run the resulting "compile.bat" file.
+
  
== Mac OS X ==
+
Load the generated OpenSim.sln into Visual Studio and build the solution, or just run
 +
compile.bat
  
=== Mac OS X 10.5 and later, Intel ===
+
to run you may also need
 +
* to install the [https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 run time files for vc++]
 +
* to authorize the install of older .NetFramework 3.5
  
Only you have to do is to get :
 
* Mono SDK from [http://www.go-mono.com/mono-downloads/download.html Mono Download Page]
 
* MonoDevelop package from [http://monodevelop.com/Download MonoDevelop Download Page]  ** MonoDevelop redirects to Xamarin Studio for Mc OS X downloads
 
and then install them - now no need to install XCode nor MacPort (you can still install mono dev libraries and nant with MacPort though).
 
  
When you run nano to build OpenSimulator, it may show an error like "Unable to locate 'mono' module using pkg-config. Download the Mono
+
Configure, See [[Configuration]].
development packages". I suspect XCode or MacPort causes something wrong (since it worked fine after I removed both), but I'm not sure. Anyway, insert a line into '''/usr/bin/nant''' script file to manage this problem :
+
<pre>
+
#!/bin/sh
+
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Libraries/pkgconfig    # add this!
+
exec /Library/Frameworks/Mono.framework/Versions/2.10.2/bin/mono \
+
    /Library/Frameworks/Mono.framework/Versions/2.10.2/share/NAnt/bin/NAnt.exe "$@"
+
</pre>
+
  
You can even compile and debug OpenSimulator with MonoDevelop IDE after running "runprebuild.sh". Open the solution file(*.sln) with MonoDevelop IDE then select Build -> Build All from the menu.
 
  
=== Building from the command line (Mono 3.x) ===
+
Now just run OpenSim.exe from the bin folder, and set up the region.
  
* Get Mono MDK from [http://www.mono-project.com/download/ Mono Download Page]
+
=== Building on Linux / Mac ===
Use xbuild instead of nant:
+
<pre>
+
./runprebuild.sh
+
xbuild
+
</pre>
+
  
=== Mac OS X 10.4/10.5 on PowerPC ===
+
you will need
OpenSimulator can run on PowerPC Macs (such as G4, G5). These instructions were tested on 10.5.8.  Note that two libraries must also be built from source. Caveat: the OpenSimulator app was only briefly tested in self-contained mode. There may well be issues with this build. Feel free to note any issues you find below (or in a new wiki page? discussion?).  
+
* [https://dotnet.microsoft.com/en-us/download/dotnet/6.0 dotnet 6.0 SDK and Runtime]
 +
* libgdiplus
 +
**if you have mono 6.x complete, you already have libgdiplus, otherwise you need to install it using a package manager for your operating system, like apt, brew, macports, etc. For example on debian:
 +
*** apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev
  
Unfortunately, the OpenSimulator version used here must be compiled on one version of Mono (2.6.7) and run on another (2.8.2). This means either upgrading Mono after the build, or having both versions installed and accessing the older version when you want to build. These instructions let you have both versions installed.
 
  
* Install Xcode 3.1.4 Developer Tools from from http://developer.apple.com/. You must have a free Apple developer account to access the downloads. 3.1.4 was the last PowerPC Xcode.
+
Create the project files, run:
  
* (10.4 only) Install X11 from the Optional Install (or see if it's a Customize option when you install Xcode). 10.5 gets X11 by default (''from OS X or dev tools?'').
 
* Install Mono 2.6.7 PowerPC Framework from here: http://www.go-mono.com/mono-downloads/download.html (binary OS X Framework, no need to build from source)
 
* Then install Mono 2.8.2 PowerPC framework. For these instructions to work, you must first install 2.6.7, THEN 2.8.2. (The old framework is not deleted, but "Current" symlinks are updated).
 
* Download OpenSimulator 0.7.0.2 source tarball: http://dist.opensimulator.org/opensim-0.7.0.2-source.tar.gz Expand to a suitable folder for development and running.
 
** Feel free to try a newer version of OpenSimulator (the repository is on git now).
 
** If you used a newer OpenSimulator version, check BUILDING.txt for any changes to build instructions (we fall under "Linux")
 
* Edit or create .profile or .bash_profile in your OS X home folder, with the following lines:
 
# remember real PATH
 
export OSIM_HACK_ORIG_PATH=$PATH
 
 
# normal path for running OpenSimulator
 
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/local/mysql/bin
 
 
# Just for nant:
 
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/pkgconfig
 
alias oldpath="export PATH=$OSIM_HACK_ORIG_PATH:/Library/Frameworks/Mono.framework/Versions/2.6.7/bin"
 
 
* Open a new Terminal window, and cd to your uncompressed OpenSimulator source folder (shortcut: type "cd " then drag the folder to the Terminal window). The enter these commands:
 
oldpath
 
 
  ./runprebuild.sh
 
  ./runprebuild.sh
nant
 
  
* nant should take around 10 minutes to compile your OpenSimulator. If you get through that without errors, you're halfway there! (I did get 234 warnings).
+
then run
* *Important* Before we forget, open a new Terminal window (necessary to avoid the effects of "oldpath").
+
  dotnet build --configuration Release OpenSim.sln
* Now we need PowerPC versions of two libraries. Build each one and replace the compiled .dylib files in the opensim/bin folder.
+
** libode.dylib http://cdnetworks-us-1.dl.sourceforge.net/project/opende/ODE/0.11.1/ode-0.11.1.zip
+
** libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib (checked out with svn:)
+
  svn co http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk/openjpeg-dotnet libopenmetaverse-read-only
+
cd libopenmetaverse-read-only
+
** To build, remove the Makefile file, which is for Linux, and rename Makefile.osx to just Makefile, then give the command: make )
+
** Remove the other versions of the two libraries (similar names, different extensions, like "libode-x86_64.so". Two libode's and three libopenjpeg's).
+
* Configure your sim: Copy OpenSim.ini.example to OpenSim.ini and customize it per its comments.
+
* Likewise copy and customize StandaloneCommon.ini in bin/config-include
+
* Note that the comments say that the current SQLite plugin doesn't work on OS X. Either solve that, or install MySQL, which requires no compiling and is relatively easy to set up:
+
** From http://downloads.mysql.com/archives.php?p=mysql-5.1&v=5.1.40, download MySQL 5.1.40 for 10.5 PowerPC (installer, not 64-bit)
+
** Run the installer. (which installs to /usr/local)
+
** Install MySQL.prefPane into System Preferences by double-clicking it.
+
** Open the pref pane and start MySQL.
+
** (Optional:) For unattended startup, install MySQLStartupItem (doesn't always work for me).
+
** (Recommended:) In Terminal, do the one-time setup of MySQL with this command: mysql_secure_installation
+
** In MySQL, create the opensim user per the comments in OpenSim.ini. Give it all the create privileges.
+
*** Since this is a Mac, you could use Sequel Pro (donationware) to do that in a nice GUI. Standard connection, host: 127.0.0.1 (if on the same Mac)
+
* You're ready to run OpenSimulator. In that new Terminal window, cd to your OpenSim-source/bin folder.
+
mono OpenSim.exe
+
* If all is well, you will be prompted "New region name []: "
+
* Turn to "Running OpenSimulator for the first time" on wiki page [[Configuration]]
+
* When fully up and running, the prompt is "Region (<region-name>) #"
+
  
== Linux ==
+
or just
 +
./compile.sh
  
=== Ubuntu ===
 
  
For Ubuntu users on older distributions (7.10, 8.04, 9.10 etc.) '''you need''' to upgrade your version of mono to at least 2.4.3 for OpenSimulator 0.7.6 and 2.10.8 for the next OpenSimulator release.  We recommend updating to at least Mono 2.10.8 in any case for performance reasons. For anyone who needs to upgrade their Mono, see [[Update Mono on Ubuntu]].
+
Configure. See [[Configuration]].
  
Ubuntu Karmic (9.10) includes mono 2.4.2.3 packages.
 
  
Ubuntu Lucid (10.04) includes mono 2.4.4 packages.
+
run ./opensim.sh from the bin folder, and set up the region
  
Ubuntu Maverick (10.10) includes mono 2.6.7 packages.
+
== Older Versions ==
 +
  Source for old .Net Framework 4.x and Mono is in branch Mono-Net4X
 +
  This is mostly same code as 0.9.2.2 release.
  
Ubuntu Natty (11.04) includes mono 2.6.7 packages.
+
== Requirements ==
  
Ubuntu Oneirc (11.10) to Salamander (13.10) include the mono 2.10.8.1 packages.
+
OpenSimulator 0.9.0.x requires either
 +
* [http://msdn.microsoft.com/en-us/netframework/cc378097 .NET Framework 4.0] on Windows
 +
* [https://www.mono-project.com/download/stable/ Mono] on Linux or Mac.  Mono 2.10.8 is the minimum version.
 +
You may also need nant tool.
  
Ubuntu Trusty (14.04) to Ubuntu Vivid (15.04) include the mono 3.2.8 packages.
 
  
==== Ubuntu 10.04 and later ====
+
OpenSimulator >= 0.9.1 (including current master) requires
 +
* [http://msdn.microsoft.com/en-us/netframework/cc378097 .NET Framework 4.6] on Windows
 +
* [https://www.mono-project.com/download/stable/ Mono] on Linux or Mac. Mono 5.12 is the minimum recommended version.<br>'''Note:''' rather than using your Linux distro's Mono packages, which may be missing required components, please [https://www.mono-project.com/download/stable/ install from the official Mono repo for your distro].
 +
recommend compiling with msbuild.
  
In this version, one only needs to install mono-complete - this will pull down all the other required packages as dependencies. Thus, to build:
+
Other platforms may have own mono distributions, or may need to compile mono on them.
  
sudo apt-get install mono-complete
+
Other libraries used by OpenSimulator can be found at our opensim-libs git repo:
# [[Download]] opensim
+
cd opensim
+
./runprebuild.sh
+
xbuild
+
  
As of mono 2.6 series, xbuild works well enough to drive a complete build of OpenSimulator. Since xbuild is included within the '''mono-complete''' package on Ubuntu, you don't have to install any additional packages if you don't have any particular reason to prefer nant over xbuild. They are just two different build systems that invoke the same C# compiler based on two different build script formats.
+
git clone git://opensimulator.org/git/opensim-libs
  
If you do want to build using nant, then you will need to install the '''nant''' apt-get package and execute
+
libOpenMetaVerse used can be found at https://bitbucket.org/opensimulator/
  
sudo apt-get install nant
+
You may need to compile them for your platform, in particular the unmanaged ones like Bullet or ODE native code libraries
nant
+
  
instead of
+
== MS Windows ==
  
xbuild
+
=== Supported Compilers ===
 +
* [https://visualstudio.microsoft.com/downloads/ Visual Studio Community 2017]
 +
* Or any version that does support the .Net version. At least VS2010 for versions prior to 0.91, VS2015 for 0.91 and after.
 +
* OpenSimulator >=0.9.2.0 can compile for .Net Framework 4.8 using runprebuild48.bat instead of runprebuild.bat below and with VS2017/19/22
  
after ./runprebuild.sh
+
=== Compiling in an IDE ===
 +
# Run "runprebuild.bat"
 +
# Open the resulting "OpenSim.sln" in Visual Studio IDE.
 +
# Select Debug or Release configuration
 +
# Menu Build -> Build Solution.
  
'''OPTIONAL (for developers):''' To run the regression test suite, you will also need to install nunit-console, like so
+
===Compiling at the Command Prompt ===
 +
# Run "runprebuild.bat".
 +
# Run the resulting "compile.bat" file.
  
sudo apt-get install nunit-console
+
== Linux and Other Mono Platforms ==
nant test
+
  
{{anchor|CentOS}}{{anchor|RedHat}}{{anchor|RHEL}}{{anchor|Fedora}}
+
=== Prepare to compile ===
 +
To create the several project files run on the folder opensim:
  
=== Debian ===
+
  ./runprebuild.sh
  
Debian 4 (Etch) is no longer supported by debian.org. Update at least to 5 (Lenny) before running OpenSimulator. See [http://www.debian.org/releases/lenny/i386/release-notes/ch-upgrading.html Upgrades from previous release@debian.org] for detail.
+
==== Compile with Nant ====
 +
On some mono versions, in particular old ones may need the use of nant to proper compile OpenSimulator, in that case just run:
  
For Debian 5 (Lenny) or later, just type:
+
  nant
<pre>
+
sudo aptitude install nant
+
</pre>
+
before run runprebuild.sh and nant. You can even use apt-get instead of aptitude. They both will also install dependent packages.
+
  
Tested on Debian 5 "Lenny" ''oldstable'', Debian 6 "Squeeze" ''stable'' and Debian 7 "Wheezy" ''testing''.
+
==== Compile with xbuild ====
  
===  Fedora ===
+
On mono versions you can just use xbuild. ''(msbuild is recommended for 0.9.1.0.0+)''
  
After getting run your OpenSimulator binary distributions, you'll need to get mono development library and install nant to build OpenSimulator from the source. See both sections below.
+
  xbuild
  
==== Getting Mono Libraries ====
+
xbuild is no longer recommended on mono 5.x, but currently still works (5.12)
  
If you have installed mono packages from the core repository for your distributions [[Dependencies#RedHat|when you run OpenSim.exe binary distribusion]], just type:
+
''>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<''
<pre>
+
sudo yum install mono-devel
+
</pre>
+
  
If not, just type (given that [[Dependencies#Installing from Mono Repository|you have already set up yum repository for mono]]) :
+
On more recent mono versions Release configuration may give some performance gain, but you do lose some debug capabilities.
<pre>
+
to compile Release configuration:
sudo yum install mono-addon-devel
+
  xbuild /p:Configuration=Release
</pre>
+
  
Both command will install its dependencies as well.
+
==== Compile with msbuild ====
 +
For Opensim 0.9.1 you can still use xbuild but Mono recommends the use of msbuild. You might need to install the package msbuild in addition to mono-complete for that. (Currently msbuild is included if you install mono-complete, on Ubuntu, from the official mono repositories. https://www.mono-project.com/download/stable/#download-lin )
  
==== Installing NAnt ====
+
Use xbuild on the other cases as a last resort.
  
Run "yum info nant" to check the version of nant package. If you find the package, then just type:
+
Recent improvements, specially on JIT runtime, justify compiling in Release configuration, but you do lose some debug capabilities.
<pre>
+
sudo yum install nant
+
</pre>
+
You can now run nant out-of-the-box.
+
  
 +
to compile with Debug configuration:
 +
  msbuild
  
If you can't find nant package in yum repository, or you feel its version is too early for building OpenSimulator, obtain NAnt from [http://nant.sourceforge.net/ NAnt Project Site]. See User Manual there for detailed instruction. As of 0.90, you will need to create startup script like that (given you have expanded NAnt to /usr/local/nant) :
+
to compile with Release configuration:
<pre>
+
  msbuild /p:Configuration=Release
sudo vi /usr/bin/nant
+
</pre>
+
Then inside this file :
+
<pre>
+
#!/bin/sh
+
exec mono /usr/local/nant/bin/NAnt.exe "$@"
+
</pre>
+
After that, make it executable :
+
<pre>
+
sudo chmod +x /usr/bin/nant
+
</pre>
+
  
You can now run runprebuild.sh and nant to compile OpenSimulator.
+
to compile with the debug configuration and detailed opensim.log file can then be read with a text editor:
 +
  msbuild /p:Configuration=Debug /fileLogger /flp:logfile=opensim.log /v:d
  
 +
you can specify the following values for the level of detail of the opensim.log file:
 +
  q [quiet], m [minimal], n [normal], d [detailed] and diag [diagnostic].
  
===  CentOS, Redhat ===
+
To compile for .Net Framework 4.8 with mono >=6.12. you can run runprebuild48.sh instead of runprebuild.sh above. Not much gain doing that, if any.
  
==== Install EPEL Repo ====
+
== Ahead of Time compilation (AOT)==
 +
As you all know the files *.exe and .dll created by the compiling process above do no contain native code for the machine.<br>
 +
With those files, the native code required by the cpu is created at runtime, as needed, in a process known as Just in Time (JIT)<br>
 +
It is possible to do another compile stage on those files to create native code, that will ready when the program starts. This is the Ahead of time process (AOT).<br>
 +
Since JIT is done at runtime, it has limited time to do extensive code optimizations, AOT on the other hand can do all.<br>
 +
AOT should this way be faster to load, save some the memory needed by JIT work, and reduce latency due to code generation when a new code section is needed.<br>
 +
This way AOT helps reduce the huge performance gap between C# and a more proper language like C++, even considering JIT can do some optimization dependent on current code execution state, that AOT can't. (if you think c# is as fast as competent c++ code, better change what you are smoking...)<br>
 +
In fact both .net and mono do AOT on their components during install<br>
 +
JIT will still be active, compiling some other code at run time. OpenSim and used .net/mono framework parts depend on it.<br>
  
<pre>
+
For Linux, 0.9.2.0 now includes scripts makeaot.sh and cleanaot.sh to help testing AOT.<br>
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
+
Run makeaot.sh after the compile stage above, to generate the native code files. The option -O=all must be added to mono when executing opensim.exe, ex:<br>
rpm -Uvh epel-release-6-8.noarch.rpm
+
mono --desktop -O=all OpenSim.exe
</pre>
+
Script cleanaot.sh removes the binary files used by AOT. You must run it if you recompile the code (to be safe even if running makeaot).<br>
 +
<b>DO NOT FORGET to run makeaot.sh or cleanaot.sh after recompile!</b><br>
 +
The generated files are specific for that machine. <b>Do not copy the native code files to other machine, unless it is absolutely identical</b><br>
 +
The original .exe and .dll are still needed<br>
  
==== Pre-required Package for Mono and GID+ ====
+
AOT is also possible in windows, but using different tools, and those add things to central repository on the machine, harder to isolate and maintain. see [https://docs.microsoft.com/en-us/dotnet/framework/tools/ngen-exe-native-image-generator ngen]<br>
 
+
<pre>
+
yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 \
+
libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts \
+
unzip gcc gcc-c++ automake autoconf \
+
libtool make bzip2 wget  pixman-devel \
+
fontconfig-devel freetype-devel libexif-devel \
+
libjpeg-devel libtiff-devel  giflib-devel
+
</pre>
+
 
+
==== Mono compilation ====
+
 
+
ps: -j 2 equal number of processor (or core)
+
 
+
<pre>
+
cd /usr/local/src
+
wget http://download.mono-project.com/sources/mono/mono-3.0.4.tar.bz2
+
tar -jxvf mono-3.0.4.tar.bz2
+
cd mono-3.0.4
+
./configure --libdir=/usr/lib64
+
make -j 2
+
make install
+
</pre>
+
 
+
==== Install GID+ ====
+
ps: -j 2 equal number of processor (or core)
+
 
+
<pre>
+
cd /usr/local/src
+
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
+
tar -xvjf libgdiplus-2.10.9.tar.bz2
+
cd libgdiplus-2.10.9
+
./configure
+
make -j2
+
make install
+
</pre>
+
 
+
=== openSUSE ===
+
 
+
Just type:
+
<pre>
+
sudo zypper install nant
+
</pre>
+
before run runprebuild.sh and nant. It will also install dependent packages.
+
 
+
== FreeBSD ==
+
 
+
FreeBSD is not currently a supported platform for OpenSimulator.  However, it is possible to get OpenSimulator running on FreeBSD.
+
 
+
On FreeBSD 6.2 and later
+
 
+
su
+
cd /usr/ports/devel/subversion/ && make install clean (you may also need to rebuild apr-svn if this step fails)
+
cd /usr/ports/lang/mono/ && make install clean
+
cd /usr/ports/devel/nant/ && make install clean
+
cd /usr/ports/databases/sqlite3/ && make install clean
+
cd /usr/ports/x11-toolkits/libgdiplus/ && make install clean
+
cd /opensim/installation/directory/
+
[[Download]] opensim
+
cd opensim
+
./runprebuild.sh
+
nant
+
  
If you get "System.DllNotFoundException: libopenjpeg" errors, follow one of these fixes (depending of the lib appearing in the error message):
+
Macs are.. Macs.. Future models may totally forbid JIT, like Apple mobile products do. Mono AOT on current Macs may work as on Linux<br>
* [[Troubleshooting#System.DllNotFoundException:_lib32.2Flibopenjpeg-dotnet-2.1.3.0-dotnet-1-i686|libopenjpeg-mono]]
+
* [[Troubleshooting#System.DllNotFoundException:_..2Flibopenjpeg-libsl-2.1.2.0.so|libopenjpeg-libsl]]
+
  
For ODE Physics you must do the following:
+
In practical use, don't expect much more than a bit faster loading.<br>
cd /usr/ports/graphics/libGL/ && make install clean
+
Additionally, since compilation is different, it may add new issues. So test with care<br>
cd /usr/ports/graphics/libGLU/ && make install clean
+
Opensim performance issues are mostly on its own code, terrible bad communications protocols, use of bad .net/mono framework code (demo quality in same cases), etc.<br>
cd /opensim/installation/directory/
+
And of course eternally broken GC<br>
git clone git://opensimulator.org/git/opensim-libs
+
But... well every ns counts..<br>
cd opensim-libs/trunk/unmanaged/OpenDynamicsEngine-r1755
+
sh autogen.sh
+
./configure --enable-shared --enable-release --disable-demos --without-x --enable-old-trimesh
+
make
+
cp ./ode/src/.libs/libode.so /opensim/installation/directory/opensim/bin/libode.so (32 bit)
+
cp ./ode/src/.libs/libode.so /opensim/installation/directory/opensim/bin/libode-x86_64.so (64 bit)
+
  
 
= Configuration =
 
= Configuration =

Latest revision as of 07:59, 27 November 2023

This page covers building OpenSimulator from source code on multiple platforms. Please help us keep this page up to date as the project progresses. If you just want to run OpenSimulator, Download and run the binary build instead. In the most cases, you should be fine with binaries.

Contents

[edit] Obtaining the Source Code

Check out the Download page for instructions on obtaining an OpenSimulator source release. If you want the current development code (i.e. the Git master branch) see Developer_Documentation#Source_Code_Repository_Access.

[edit] Building

Although this page is long, building is generally quite simple. See the BUILDING.txt file in the distribution itself for simplified instructions.

[edit] Version 0.9.3.0 and above

Microsoft stopped the development of .Net Framework and Mono, replacing them by new dotnet This is a significant breaking change that we try to follow on 0.9.3.0.

[edit] Get source code

get or update source from git

git clone git://opensimulator.org/git/opensim

[edit] Building on Windows

To building under Windows, the following is required:

optionally also

  • Visual Studio .NET, version 2022 or later


Create the project files running:

runprebuild.bat

Load the generated OpenSim.sln into Visual Studio and build the solution, or just run

compile.bat

to run you may also need


Configure, See Configuration.


Now just run OpenSim.exe from the bin folder, and set up the region.

[edit] Building on Linux / Mac

you will need

  • dotnet 6.0 SDK and Runtime
  • libgdiplus
    • if you have mono 6.x complete, you already have libgdiplus, otherwise you need to install it using a package manager for your operating system, like apt, brew, macports, etc. For example on debian:
      • apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev


Create the project files, run:

./runprebuild.sh

then run

dotnet build --configuration Release OpenSim.sln

or just

./compile.sh


Configure. See Configuration.


run ./opensim.sh from the bin folder, and set up the region

[edit] Older Versions

  Source for old .Net Framework 4.x and Mono is in branch Mono-Net4X 
  This is mostly same code as 0.9.2.2 release.

[edit] Requirements

OpenSimulator 0.9.0.x requires either

You may also need nant tool.


OpenSimulator >= 0.9.1 (including current master) requires

recommend compiling with msbuild.

Other platforms may have own mono distributions, or may need to compile mono on them.

Other libraries used by OpenSimulator can be found at our opensim-libs git repo:

git clone git://opensimulator.org/git/opensim-libs

libOpenMetaVerse used can be found at https://bitbucket.org/opensimulator/

You may need to compile them for your platform, in particular the unmanaged ones like Bullet or ODE native code libraries

[edit] MS Windows

[edit] Supported Compilers

  • Visual Studio Community 2017
  • Or any version that does support the .Net version. At least VS2010 for versions prior to 0.91, VS2015 for 0.91 and after.
  • OpenSimulator >=0.9.2.0 can compile for .Net Framework 4.8 using runprebuild48.bat instead of runprebuild.bat below and with VS2017/19/22

[edit] Compiling in an IDE

  1. Run "runprebuild.bat"
  2. Open the resulting "OpenSim.sln" in Visual Studio IDE.
  3. Select Debug or Release configuration
  4. Menu Build -> Build Solution.

[edit] Compiling at the Command Prompt

  1. Run "runprebuild.bat".
  2. Run the resulting "compile.bat" file.

[edit] Linux and Other Mono Platforms

[edit] Prepare to compile

To create the several project files run on the folder opensim:

 ./runprebuild.sh

[edit] Compile with Nant

On some mono versions, in particular old ones may need the use of nant to proper compile OpenSimulator, in that case just run:

 nant

[edit] Compile with xbuild

On mono versions you can just use xbuild. (msbuild is recommended for 0.9.1.0.0+)

 xbuild

xbuild is no longer recommended on mono 5.x, but currently still works (5.12)

>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

On more recent mono versions Release configuration may give some performance gain, but you do lose some debug capabilities. to compile Release configuration:

 xbuild /p:Configuration=Release

[edit] Compile with msbuild

For Opensim 0.9.1 you can still use xbuild but Mono recommends the use of msbuild. You might need to install the package msbuild in addition to mono-complete for that. (Currently msbuild is included if you install mono-complete, on Ubuntu, from the official mono repositories. https://www.mono-project.com/download/stable/#download-lin )

Use xbuild on the other cases as a last resort.

Recent improvements, specially on JIT runtime, justify compiling in Release configuration, but you do lose some debug capabilities.

to compile with Debug configuration:

  msbuild

to compile with Release configuration:

  msbuild /p:Configuration=Release

to compile with the debug configuration and detailed opensim.log file can then be read with a text editor:

  msbuild /p:Configuration=Debug /fileLogger /flp:logfile=opensim.log /v:d

you can specify the following values for the level of detail of the opensim.log file:

  q [quiet], m [minimal], n [normal], d [detailed] and diag [diagnostic].

To compile for .Net Framework 4.8 with mono >=6.12. you can run runprebuild48.sh instead of runprebuild.sh above. Not much gain doing that, if any.

[edit] Ahead of Time compilation (AOT)

As you all know the files *.exe and .dll created by the compiling process above do no contain native code for the machine.
With those files, the native code required by the cpu is created at runtime, as needed, in a process known as Just in Time (JIT)
It is possible to do another compile stage on those files to create native code, that will ready when the program starts. This is the Ahead of time process (AOT).
Since JIT is done at runtime, it has limited time to do extensive code optimizations, AOT on the other hand can do all.
AOT should this way be faster to load, save some the memory needed by JIT work, and reduce latency due to code generation when a new code section is needed.
This way AOT helps reduce the huge performance gap between C# and a more proper language like C++, even considering JIT can do some optimization dependent on current code execution state, that AOT can't. (if you think c# is as fast as competent c++ code, better change what you are smoking...)
In fact both .net and mono do AOT on their components during install
JIT will still be active, compiling some other code at run time. OpenSim and used .net/mono framework parts depend on it.

For Linux, 0.9.2.0 now includes scripts makeaot.sh and cleanaot.sh to help testing AOT.
Run makeaot.sh after the compile stage above, to generate the native code files. The option -O=all must be added to mono when executing opensim.exe, ex:

mono --desktop -O=all OpenSim.exe

Script cleanaot.sh removes the binary files used by AOT. You must run it if you recompile the code (to be safe even if running makeaot).
DO NOT FORGET to run makeaot.sh or cleanaot.sh after recompile!
The generated files are specific for that machine. Do not copy the native code files to other machine, unless it is absolutely identical
The original .exe and .dll are still needed

AOT is also possible in windows, but using different tools, and those add things to central repository on the machine, harder to isolate and maintain. see ngen

Macs are.. Macs.. Future models may totally forbid JIT, like Apple mobile products do. Mono AOT on current Macs may work as on Linux

In practical use, don't expect much more than a bit faster loading.
Additionally, since compilation is different, it may add new issues. So test with care
Opensim performance issues are mostly on its own code, terrible bad communications protocols, use of bad .net/mono framework code (demo quality in same cases), etc.
And of course eternally broken GC
But... well every ns counts..

[edit] Configuration

See Configuration.

Personal tools
General
About This Wiki