<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Building_PLplot_with_a_cross-compiler</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>Recent changes to Building_PLplot_with_a_cross-compiler</description><atom:link href="https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 14 May 2021 08:26:49 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/feed" rel="self" type="application/rss+xml"/><item><title>Building_PLplot_with_a_cross-compiler modified by Arjen Markus</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -10,7 +10,7 @@
 paste.
 --&amp;gt;

-From version 2.6.0 cmake includes support for cross-compiling. The [CMake wiki](http://www.cmake.org/Wiki/CMake_Cross_Compiling) provides a useful source of background information here.
+From version 2.6.0 cmake includes support for cross-compiling. The [CMake manual](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html) provides a useful source of background information here.

 Cross-compiling plplot is complicated because a full build involves lots of external libraries for different drivers and multiple different compilers /interpreters for the language bindings. However, it is possible to build a cut-down version of PLplot using cmake. PLplot compiles and runs several executables to create source files / data for the project at build time. Obviously it is not generally possible to run the cross-compiled versions and so access is also required to a native build tree in which to find the native versions of the build-time executables. Support for this was only added to PLplot on 3rd March 2009 (svn revision 9665).

@@ -24,7 +24,7 @@
 Create a CMake toolchain
 ------------------------

-See the [CMake wiki](http://www.cmake.org/Wiki/CMake_Cross_Compiling) for details of this for individual platforms. The mingw32 example worked fine for me.
+See the [CMake manual](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html) for details of this for individual platforms. The mingw32 example worked fine for me.

 Building a cross-compiled version of PLplot
 -------------------------------------------
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Arjen Markus</dc:creator><pubDate>Fri, 14 May 2021 08:26:49 -0000</pubDate><guid>https://sourceforge.net2865d0856a9ecd7693412957c50b5f790beed0f8</guid></item><item><title>Building_PLplot_with_a_cross-compiler modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,3 +1,15 @@
+
+
 From version 2.6.0 cmake includes support for cross-compiling. The [CMake wiki](http://www.cmake.org/Wiki/CMake_Cross_Compiling) provides a useful source of background information here.

 Cross-compiling plplot is complicated because a full build involves lots of external libraries for different drivers and multiple different compilers /interpreters for the language bindings. However, it is possible to build a cut-down version of PLplot using cmake. PLplot compiles and runs several executables to create source files / data for the project at build time. Obviously it is not generally possible to run the cross-compiled versions and so access is also required to a native build tree in which to find the native versions of the build-time executables. Support for this was only added to PLplot on 3rd March 2009 (svn revision 9665).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Sat, 03 Nov 2018 08:35:41 -0000</pubDate><guid>https://sourceforge.net5237a95bef507d980472662c383ba10e6ce3dda7</guid></item><item><title>Discussion for Building_PLplot_with_a_cross-compiler page</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/?limit=25#36dc</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I had problems trying to follow these steps:&lt;br/&gt;
My CMAKE_TOOLCHAIN_FILE looks like this:&lt;/p&gt;
&lt;p&gt;set(CMAKE_SYSTEM_NAME Windows)&lt;br/&gt;
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)&lt;br/&gt;
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)&lt;br/&gt;
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)&lt;br/&gt;
set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)&lt;br/&gt;
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)&lt;br/&gt;
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)&lt;br/&gt;
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)&lt;/p&gt;
&lt;p&gt;The command I use is:&lt;br/&gt;
/usr/local/bin/cmake-3.6.3/cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DDEFAULT_NO_DEVICES=ON -DPLD_svg=ON -DPKG_CONFIG_EXECUTABLE=Not-Found ../pplot&lt;/p&gt;
&lt;p&gt;The cmake filed with errors:&lt;br/&gt;
fatal error: termios.h: No such file or directory&lt;br/&gt;
fatal error: crt_externs.h: No such file or directory&lt;br/&gt;
fatal error: sys/wait.h: No such file or directory&lt;br/&gt;
error: ld returned 1 exit status&lt;/p&gt;
&lt;p&gt;Can you help?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ruiming Tian</dc:creator><pubDate>Mon, 13 Feb 2017 20:16:34 -0000</pubDate><guid>https://sourceforge.net03c159169c5c28de47fb5af33af56416d62c582e</guid></item><item><title>Building_PLplot_with_a_cross-compiler modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Sun, 05 Oct 2014 19:02:07 -0000</pubDate><guid>https://sourceforge.neta7dad439a2d6d9e4577bf41e637b6a24c4f76289</guid></item><item><title>Building_PLplot_with_a_cross-compiler modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Wed, 01 Oct 2014 22:31:30 -0000</pubDate><guid>https://sourceforge.netc8e225c5379c31a664e77d2f29ef9aabbd72396b</guid></item><item><title>Building_PLplot_with_a_cross-compiler modified by Alan W. Irwin</title><link>https://sourceforge.net/p/plplot/wiki/Building_PLplot_with_a_cross-compiler/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;From version 2.6.0 cmake includes support for cross-compiling. The &lt;a class="" href="http://www.cmake.org/Wiki/CMake_Cross_Compiling" rel="nofollow"&gt;CMake wiki&lt;/a&gt; provides a useful source of background information here.&lt;/p&gt;
&lt;p&gt;Cross-compiling plplot is complicated because a full build involves lots of external libraries for different drivers and multiple different compilers /interpreters for the language bindings. However, it is possible to build a cut-down version of PLplot using cmake. PLplot compiles and runs several executables to create source files / data for the project at build time. Obviously it is not generally possible to run the cross-compiled versions and so access is also required to a native build tree in which to find the native versions of the build-time executables. Support for this was only added to PLplot on 3rd March 2009 (svn revision 9665).&lt;/p&gt;
&lt;p&gt;The following instructions were written and tested on using the mingw32 cross-compiler for Windows running under Linux. Debian and Ubuntu supply packages for this environment so it is simple to install and test.&lt;/p&gt;
&lt;h2 id="build-a-native-version-of-plplot"&gt;Build a native version of PLplot&lt;/h2&gt;
&lt;p&gt;This can just be a normal PLplot build. The only thing to be careful of it to ensure that it uses dynamic drivers if you intend to use them for the cross compiler otherwise get-drv-info will not be built.&lt;/p&gt;
&lt;h2 id="create-a-cmake-toolchain"&gt;Create a CMake toolchain&lt;/h2&gt;
&lt;p&gt;See the &lt;a class="" href="http://www.cmake.org/Wiki/CMake_Cross_Compiling" rel="nofollow"&gt;CMake wiki&lt;/a&gt; for details of this for individual platforms. The mingw32 example worked fine for me.&lt;/p&gt;
&lt;h2 id="building-a-cross-compiled-version-of-plplot"&gt;Building a cross-compiled version of PLplot&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create a new directory for the cross-compile build and change to that directory.&lt;/li&gt;
&lt;li&gt;Run cmake.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ul&gt;
&lt;li&gt;You probably want to disable all languages and drivers by default and then just enable the ones you need. You can achieve this by setting DEFAULT_NO_DEVICES=ON and DEFAULT_NO_BINDINGS=ON. Failure to do this can lead to strange results if cmake picks up native rather than cross-compiler versions of tools, for example the fortran compiler, which are not part of your toolchain.&lt;/li&gt;
&lt;li&gt;You will need to set the following CMake variables.&lt;ul&gt;
&lt;li&gt;CMAKE_TOOLCHAIN_FILE: points to the CMake toolchain file for this cross-compiler.&lt;/li&gt;
&lt;li&gt;CMAKE_NATIVE_BINARY_DIR: points to the top-level directory in the native PLplot build tree.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You will need to disable pkg-config support or ensure that pkg-config is using the correct package information files for the cross-platform. The simplest way of disabling this is by setting PKG_CONFIG_EXECUTABLE to something like NOT-FOUND.&lt;/li&gt;
&lt;li&gt;You will either need to disable support for the CSA library, or explicitly set NanAwareCCompiler (probably to ON) since this uses a build-time executable to check for support. This can't be executed for a cross-compiled environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Run make to build the cross-compiled version of PLplot.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using this method I have successfully cross-compiled the C++ bindings and the ps and svg drivers. Note that neither of these has external dependencies. For reference the cmake command line looked like&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-mingw32.cmake -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON -DPLD_svg=ON -DPKG_CONFIG_EXECUTABLE=Not-Found -DDEFAULT_NO_BINDINGS=ON -DENABLE_cxx=ON -DNaNAwareCCompiler=ON -DCMAKE_NATIVE_BINARY_DIR=/home/andrew/software/plplot/build&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;../plplot&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The content of this page is available under the &lt;a class="" href="http://www.gnu.org/copyleft/fdl.html" rel="nofollow"&gt;GNU Free Documentation License 1.2&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alan W. Irwin</dc:creator><pubDate>Wed, 01 Oct 2014 22:30:43 -0000</pubDate><guid>https://sourceforge.nete34b03d9ff677f5709e947a3d8a8bef8872ac40b</guid></item></channel></rss>