diff options
Diffstat (limited to 'HOWTO')
-rw-r--r-- | HOWTO/DTRACE.md | 6 | ||||
-rw-r--r-- | HOWTO/INSTALL-ANDROID.md | 52 | ||||
-rw-r--r-- | HOWTO/INSTALL-CROSS.md | 41 | ||||
-rw-r--r-- | HOWTO/INSTALL.md | 122 | ||||
-rw-r--r-- | HOWTO/MARKDOWN.md | 7 |
5 files changed, 148 insertions, 80 deletions
diff --git a/HOWTO/DTRACE.md b/HOWTO/DTRACE.md index 8fa2fd9d50..90f4addefd 100644 --- a/HOWTO/DTRACE.md +++ b/HOWTO/DTRACE.md @@ -27,12 +27,10 @@ Goals Supported platforms ------------------- -* OS X 10.6.x / Snow Leopard. It should also work for 10.7 / Lion, - but I haven't personally tested it. +* OS X 10.6.x / Snow Leopard, OS X 10.7.x / Lion and probably newer versions. * Solaris 10. I have done limited testing on Solaris 11 and OpenIndiana release 151a, and both appear to work. -* FreeBSD 9.0, though please see the "FreeBSD 9.0 Release Notes" - section below! +* FreeBSD 9.0 and 10.0. * Linux via SystemTap compatibility. Please see [$ERL_TOP/HOWTO/SYSTEMTAP.md][] for more details. diff --git a/HOWTO/INSTALL-ANDROID.md b/HOWTO/INSTALL-ANDROID.md new file mode 100644 index 0000000000..31698d4ce3 --- /dev/null +++ b/HOWTO/INSTALL-ANDROID.md @@ -0,0 +1,52 @@ +Cross Compiling Erlang/OTP - ANDROID +==================================== + +Introduction +------------ + +This document describes how to cross compile Erlang OTP to Android/Rasberry Pi platforms. + +### Download and Install Android NDK ### + +https://developer.android.com/tools/sdk/ndk/index.html + +### Define System Variables ### + +export NDK_ROOT=/usr/local/android +export NDK_PLAT=android-9 +export PATH=$NDK_ROOT/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin:$PATH + +### Configure OTP ### + +./otp_build configure \ + --xcomp-conf=./xcomp/erl-xcomp-arm-android.conf \ + --without-ssl + +### Compile OTP ### + +make noboot [-j4] + +### Make Release ### + +./otp_build release -a /usr/local/otp_R16B03_arm + +### Target Deployment ### + +Make a tarball out of /usr/local/otp_R16B03_arm and copy it to target device +(e.g. Raspberry Pi). Extract it and install + +./Install /usr/local/otp_R16B03_arm + +Android SDK (adb tool) is used to deploy OTP/Erlang to target device for +evaluation purpose only. + +adb push /usr/local/otp_R16B03_arm /mnt/sdcard/otp_R16B03_arm +adb shell + +### Known Issues ### + + * native inet:gethostbyname/1 return {error, nxdomain} on Raspberry PI. Use dns resolver to by-pass the issue (see http://www.erlang.org/doc/apps/erts/inet_cfg.html) + +### References ### + + The port derives some solutions from https://code.google.com/p/erlang4android/ diff --git a/HOWTO/INSTALL-CROSS.md b/HOWTO/INSTALL-CROSS.md index 03ea4c6e76..10f463c06d 100644 --- a/HOWTO/INSTALL-CROSS.md +++ b/HOWTO/INSTALL-CROSS.md @@ -103,14 +103,6 @@ has to be provided in the `$PATH`. The Erlang/OTP for the target system will be built using this Erlang system, together with the cross compilation tools provided. -If you want to build the documentation out of the same source tree as you are -cross compiling in, you currently need a full Erlang/OTP system of the same -release as the one being built for the build machine. If this is the case, -build and install one for the build machine (or use one already built) and add -it to the `$PATH` before cross building, and building the documentation. See -the [How to Build the Documentation][] section in the [$ERL_TOP/HOWTO/INSTALL.md][] -document for information on how to build the documentation. - If you want to build using a compatible Erlang/OTP system in the `$PATH`, jump to (3). @@ -284,6 +276,14 @@ and then do the cross build of the system. `otp_build release -a` will do the same as (5), and you will after this have to do a manual install either by doing (6), or (7). +Building and Installing the Documentation +----------------------------------------- + +After the system has been cross built you can build and install the +documentation the same way as after a native build of the system. See the +[How to Build the Documentation][] section in the [$ERL_TOP/HOWTO/INSTALL.md][] +document for information on how to build the documentation. + Testing the cross compiled system --------------------------------- Some of the tests that come with erlang use native code to test. This means @@ -520,12 +520,35 @@ When a variable has been set, no warning will be issued. `posix_memalign` implementation that accepts larger than page size alignment. +* `erl_xcomp_ose_ldflags_pass1` - Linker flags for the OSE module (pass 1) + +* `erl_xcomp_ose_ldflags_pass2` - Linker flags for the OSE module (pass 2) + +* `erl_xcomp_ose_OSEROOT` - OSE installation root directory + +* `erl_xcomp_ose_STRIP` - Strip utility shipped with the OSE distribution + +* `erl_xcomp_ose_LM_POST_LINK` - OSE postlink tool + +* `erl_xcomp_ose_LM_SET_CONF` - Sets the configuration for an OSE load module + +* `erl_xcomp_ose_LM_ELF_SIZE` - Prints the section size information for an + OSE load module + +* `erl_xcomp_ose_LM_LCF` - OSE load module linker configuration file + +* `erl_xcomp_ose_BEAM_LM_CONF` - Beam OSE load module configuration file + +* `erl_xcomp_ose_EPMD_LM_CONF` - EPMD OSE load module configuration file + +* `erl_xcomp_ose_RUN_ERL_LM_CONF` - run_erl_lm OSE load module configuration file + Copyright and License --------------------- %CopyrightBegin% -Copyright Ericsson AB 2009-2013. All Rights Reserved. +Copyright Ericsson AB 2009-2014. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md index 07a8db1a53..368947b36c 100644 --- a/HOWTO/INSTALL.md +++ b/HOWTO/INSTALL.md @@ -63,7 +63,7 @@ At Ericsson we have a "Daily Build and Test" that runs on: * x86 * OpenBSD 5.0 * x86\_64 -* Mac OS X 10.5.8 (Leopard), 10.6.0 (Snow Leopard), 10.7.3 (Lion) +* Mac OS X 10.5.8 (Leopard), 10.7.3 (Lion), 10.9 (Mavericks) * x86 * Windows XP SP3, 2003, Vista, 7 * x86 @@ -189,16 +189,16 @@ section below before proceeding. Step 1: Start by unpacking the Erlang/OTP distribution file with your GNU compatible TAR program. - $ gunzip -c otp_src_%OTP-REL%.tar.gz | tar xf - + $ gunzip -c otp_src_%OTP-VSN%.tar.gz | tar xf - alternatively: - $ zcat otp_src_%OTP-REL%.tar.gz | tar xf - + $ zcat otp_src_%OTP-VSN%.tar.gz | tar xf - Step 2: Now cd into the base directory (`$ERL_TOP`). - $ cd otp_src_%OTP-REL% + $ cd otp_src_%OTP-VSN% ### Configuring ### @@ -217,7 +217,7 @@ Step 4: Run the following commands to configure the build: $ ./configure [ options ] -If you are building it from git you will need to run `autoconf` to generate configure file. +If you are building it from git you will need to run `./otp_build autoconf` to generate configure file. By default, Erlang/OTP will be installed in `/usr/local/{bin,lib/erlang}`. To instead install in `<BaseDir>/{bin,lib/erlang}`, use the `--prefix=<BaseDir>` option. @@ -268,12 +268,22 @@ Some of the available `configure` options are: default if possible) * `--{enable,disable}-hipe` - HiPE support (enabled by default on supported platforms) +* `--{enable,disable}-fp-exceptions` - Floating point exceptions (an + optimization for floating point operations). The default differs + depending on operating system and hardware platform. Note that by + enabling this you might get a seemingly working system that sometimes + fail on floating point operations. * `--enable-darwin-universal` - Build universal binaries on darwin i386. * `--enable-darwin-64bit` - Build 64-bit binaries on darwin * `--enable-m64-build` - Build 64-bit binaries using the `-m64` flag to `(g)cc` * `--enable-m32-build` - Build 32-bit binaries using the `-m32` flag to `(g)cc` +* `--with-assumed-cache-line-size=SIZE` - Set assumed cache-line size in + bytes. Default is 64. Valid values are powers of two between and + including 16 and 8192. The runtime system use this value in order to + try to avoid false sharing. A too large value wastes memory. A to + small value will increase the amount of false sharing. * `--{with,without}-termcap` - termcap (without implies that only the old Erlang shell can be used) * `--with-javac=JAVAC` - Specify Java compiler to use @@ -288,7 +298,7 @@ Some of the available `configure` options are: memory accesses. If `configure` should inform you about no native atomic implementation available, you typically want to try using the `libatomic_ops` library. It can be downloaded from - <http://www.hpl.hp.com/research/linux/atomic_ops/>. + <https://github.com/ivmai/libatomic_ops/>. * `--disable-smp-require-native-atomics` - By default `configure` will fail if an SMP runtime system is about to be built, and no implementation for native atomic memory accesses can be found. If this happens, you are @@ -297,12 +307,29 @@ Some of the available `configure` options are: you can build using a fallback implementation based on mutexes or spinlocks. Performance of the SMP runtime system will however suffer immensely without an implementation for native atomic memory accesses. +* `--enable-static-{nifs,drivers}` - To allow usage of nifs and drivers on OSs + that do not support dynamic linking of libraries it is possible to statically + link nifs and drivers with the main Erlang VM binary. This is done by passing + a comma seperated list to the archives that you want to statically link. e.g. + `--enable-static-nifs=/home/$USER/my_nif.a`. The path has to be absolute and the + name of the archive has to be the same as the module, i.e. `my_nif` in the + example above. This is also true for drivers, but then it is the driver name + that has to be the same as the filename. You also have to define + `STATIC_ERLANG_{NIF,DRIVER}` when compiling the .o files for the nif/driver. + If your nif/driver depends on some other dynamic library, you now have to link + that to the Erlang VM binary. This is easily achived by passing `LIBS=-llibname` + to configure. * `--without-$app` - By default all applications in Erlang/OTP will be included in a release. If this is not wanted it is possible to specify that Erlang/OTP should be compiled without that applications, i.e. `--without-wx`. There is no automatic dependency handling inbetween applications. So if you disable an application that another depends on, you also have to disable the dependant application. +* `--enable-dirty-schedulers` - Enable the **experimental** dirty schedulers + functionality. Note that the dirty schedulers functionality is experimental, + and **not supported**. This functionality **will** be subject to backward + incompatible changes. Note that you should **not** enable the dirty scheduler + functionality on production systems. It is only provided for testing. If you or your system has special requirements please read the `Makefile` for additional configuration information. @@ -315,7 +342,7 @@ Erlang/OTP system which you can try by typing `bin/erl`. This should start up Erlang/OTP and give you a prompt: $ bin/erl - Erlang %OTP-REL% (erts-%ERTS-VSN%) [source] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] + Erlang/OTP %OTP-REL% [erts-%ERTS-VSN%] [source] [smp:4:4] [async-threads:0] [kernel-poll:false] Eshell V%ERTS-VSN% (abort with ^G) 1> _ @@ -483,21 +510,11 @@ The Erlang/OTP Documentation ### How to Build the Documentation ### - $ cd $ERL_TOP - -If you have just built Erlang/OTP in the current source tree, you have -already ran `configure` and do not need to do this again; otherwise, run -`configure`. - - $ ./configure [Configure Args] - -When building the documentation you need a full Erlang/OTP-%OTP-REL% system in -the `$PATH`. - - $ export PATH=<Erlang/OTP-%OTP-REL% bin dir>:$PATH # Assuming bash/sh - -Build the documentation. +Before you can build the documentation you need to either [native build][] +or [cross build][] the Erlang/OTP system. After this you can build the +documentation as follows. + $ cd $ERL_TOP $ make docs The documentation can be installed either using the `install-docs` target, @@ -536,13 +553,13 @@ For some graphical tools to find the on-line help you have to install the HTML documentation on top of the installed OTP applications, i.e. $ cd <ReleaseDir> - $ gunzip -c otp_html_%OTP-REL%.tar.gz | tar xf - + $ gunzip -c otp_html_%OTP-VSN%.tar.gz | tar xf - For `erl -man <page>` to work the Unix manual pages have to be installed in the same way, i.e. $ cd <ReleaseDir> - $ gunzip -c otp_man_%OTP-REL%.tar.gz | tar xf - + $ gunzip -c otp_man_%OTP-VSN%.tar.gz | tar xf - Where `<ReleaseDir>` is @@ -668,52 +685,26 @@ If you develop linked-in drivers (shared library) you need to link using include `-fno-common` in `CFLAGS` when compiling. Use `.so` as the library suffix. -Use the `--enable-darwin-64bit` configure flag to build a 64-bit -binaries on Mac OS X. - -Building a fast Erlang VM on Mac OS Lion ----------------------------------------- +Install `Xcode` from the `AppStore` if it is not already installed. -Starting with Xcode 4.2, Apple no longer includes a "real" `gcc` -compiler (not based on the LLVM). Building with `llvm-gcc` or `clang` -will work, but the performance of the Erlang run-time system will not -be the best possible. - -Note that if you have `gcc-4.2` installed and included in `PATH` -(from a previous version of Xcode), `configure` will automatically -make sure that `gcc-4.2` will be used to compile `beam_emu.c` -(the source file most in need of `gcc`). - -If you don't have `gcc-4.2.` and want to build a run-time system with -the best possible performance, do like this: - -Install Xcode from the AppStore if it is not already installed. - -If you have Xcode 4.3, or later, you will also need to download +If you have Xcode 4.3, or later, you will also need to download "Command Line Tools" via the Downloads preference pane in Xcode. -Some tools may still be lacking or out-of-date, we recommend using -[Homebrew](https://github.com/mxcl/homebrew/wiki/installation) or -Macports to update those tools. - -Install MacPorts (<http://www.macports.org/>). Then: - - $ sudo port selfupdate - $ sudo port install gcc45 +universal - ### Building with wxErlang ### -If you want to build the `wx` application, you will need to get wxWidgets-2.9.4 (or later) -(`wxWidgets-2.9.4.tar.bz2` from <http://sourceforge.net/projects/wxwindows/files/2.9.4/>) +If you want to build the `wx` application, you will need to get wxWidgets-3.0 (or later) +(`wxWidgets-3.0.0.tar.bz2` from <http://sourceforge.net/projects/wxwindows/files/3.0.0/>) or get it from github: $ git clone [email protected]:wxWidgets/wxWidgets.git -Be aware that the wxWidgets-2.9 branch is a development branch of wxWidgets and the MacOsX -port still lags behind the other ports. +Be aware that the wxWidgets-3.0 is a new release of wxWidgets, it is not as matured +as the old releases and the MacOsX port still lags behind the other ports. -Configure and build wxMac: +Configure and build wxWidgets (on Mavericks - 10.9): $ ./configure --with-cocoa --prefix=/usr/local + or without support for old versions and with static libs + $ ./configure --with-cocoa --prefix=/usr/local --with-macosx-version-min=10.9 --disable-shared $ make $ sudo make install $ export PATH=/usr/local/bin:$PATH @@ -724,12 +715,11 @@ Check that you got the correct wx-config ### Finish up ### -Build Erlang with the MacPorts GCC as the main compiler (using `clang` -for the Objective-C Cocoa code in the `wx` application): +Build Erlang $ export PATH=/usr/local/bin:$PATH $ cd $ERL_TOP - $ CC=/opt/local/bin/gcc-mp-4.5 CXX=/opt/local/bin/g++-mp-4.5 ./configure --enable-darwin-64bit + $ ./configure --enable-shared-zlib $ make $ sudo make install @@ -779,7 +769,7 @@ Copyright and License %CopyrightBegin% -Copyright Ericsson AB 1998-2013. All Rights Reserved. +Copyright Ericsson AB 1998-2014. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in @@ -813,9 +803,11 @@ Before modifying this document you need to have a look at the [Building in Git]: #How-to-Build-and-Install-ErlangOTP_Building-in-Git [Pre-built Source Release]: #How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release [make and $ERL_TOP]: #How-to-Build-and-Install-ErlangOTP_make-and-ERLTOP - [html documentation]: http://www.erlang.org/download/otp_doc_html_%OTP-REL%.tar.gz - [man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-REL%.tar.gz - [the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-REL%.tar.gz + [html documentation]: http://www.erlang.org/download/otp_doc_html_%OTP-VSN%.tar.gz + [man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-VSN%.tar.gz + [the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-VSN%.tar.gz + [native build]: #How-to-Build-and-Install-ErlangOTP + [cross build]: INSTALL-CROSS.md [$ERL_TOP/HOWTO/MARKDOWN.md]: MARKDOWN.md [?TOC]: true diff --git a/HOWTO/MARKDOWN.md b/HOWTO/MARKDOWN.md index c9ad09a1be..8e8a5c02cf 100644 --- a/HOWTO/MARKDOWN.md +++ b/HOWTO/MARKDOWN.md @@ -223,8 +223,11 @@ places. Appropriate attributes to the `X` tag will also be generated. \%CopyrightBegin\% and \%CopyrightEnd\% "tags" will be removed from the output. -* All occurrences of \%OTP-REL% will be replaced by current release number - (e.g. R14A). +* All occurrences of \%OTP-REL% will be replaced by current OTP release number + (e.g. 17). + +* All occurrences of \%OTP-VSN% will be replaced by current OTP version + (e.g. 17.0). * All occurrences of \%ERTS-VSN% will be replaced by current ERTS version (e.g. 5.8). |