Talk:Compile and Install: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
m (Remove AIX info from Discussion? Please move compilation material to trac.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
__TOC__
* Can we remove the "AIX" related info below?
* Please, if taking time to update the compilation related sections, why not move over to somewhere under https://trac.osgeo.org/grass/wiki/BuildHints?
--Nikos Alexandris 00:07, 31 March 2017 (PDT)
=== Ubuntu compilation hints ===
''feedback on following the same directions under Ubuntu 8.10 amd64''
''feedback on following the same directions under Ubuntu 8.10 amd64''


Line 4: Line 12:
: ''HB: try "apt-cache search bpng*-dev". Probably they bumped the version number.
: ''HB: try "apt-cache search bpng*-dev". Probably they bumped the version number.


=== AIX 7.x compilation hints ===
Hints: [http://www.ibm.com/developerworks/aix/library/au-gnu.html Using the GNU C/C++ compiler on AIX]


=== AIX compilation hints ===
* conf_proj_AIX.sh:
sh configure --prefix=$HOME/bin --without-mutex


* conf_sqlite3.sh:
sh configure --prefix=$HOME/bin \
  --disable-shared --disable-threadsafe --disable-tcl
* conf_gdal.sh:
<pre>
export LIBICONV=/opt/freeware
export CC="gcc"
export CXX="g++"
PREFIX=$HOME/bin
CFLAGS='-DHAVE_INTTYPES_H=0' ./configure \
--prefix=$PREFIX --with-libz=internal --with-threads=no --with-geotiff=internal --with-libtiff=internal
echo "Now manually edit:  vim port/cpl_config.h and disable use of AIX's <inttypes.h> header file"
echo "#define HAVE_INTTYPES_H 0"
echo "See bug http://trac.osgeo.org/gdal/ticket/4809"
</pre>
* Fix $HOME/bin/gdal-config issue (bug in GRASS GIS 7 or GDAL?): add to the 'CONFIG_LIBS' line the entry
  -lstdc++
* If you want r.terraflow, patch the source code for a workaround of a [http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01957.html gcc bug on AIX]:
<pre>
r.terraflow_AIX_gcc_fix.diff
Index: raster/r.terraflow/stats.h
===================================================================
--- raster/r.terraflow/stats.h  (revision 56936)
+++ raster/r.terraflow/stats.h  (working copy)
@@ -22,6 +22,16 @@
#include <sys/types.h>
+/* http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01957.html */
+#if defined(_AIX) && defined(_LARGE_FILES)
+#include <fcntl.h>
+#undef open
+/* Alias the symbols using asm */
+extern "C" {
+extern int open(const char *, int, ...) __asm__("open64");
+}
+#endif
+
#include <fstream>
#include <iostream>
using namespace std;
</pre>
=== AIX 5.x compilation hints ===


* conf_wget_AIX.sh:
* conf_wget_AIX.sh:
Line 18: Line 79:
  export CC="gcc"
  export CC="gcc"
  export CXX="g++"
  export CXX="g++"
  PREFIX=/afs/cluster/grid/user/private/bin
  PREFIX=/afs/cluster/grid/user/private/bin
  sh configure \
  sh configure \
Line 86: Line 146:
PREFIX=$HOME/private/bin
PREFIX=$HOME/private/bin


./configure \
CFLAGS='-ansi -D_ALL_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=200809L -Dinline=' ./configure \
   --prefix=$PREFIX \
   --prefix=$PREFIX \
   --disable-shared \
   --disable-shared \

Latest revision as of 07:07, 31 March 2017

--Nikos Alexandris 00:07, 31 March 2017 (PDT)

Ubuntu compilation hints

feedback on following the same directions under Ubuntu 8.10 amd64

  • apt-get says "Couldn't find package bpng12-dev"
HB: try "apt-cache search bpng*-dev". Probably they bumped the version number.

AIX 7.x compilation hints

Hints: Using the GNU C/C++ compiler on AIX

  • conf_proj_AIX.sh:
sh configure --prefix=$HOME/bin --without-mutex
  • conf_sqlite3.sh:
sh configure --prefix=$HOME/bin \
 --disable-shared --disable-threadsafe --disable-tcl
  • conf_gdal.sh:
export LIBICONV=/opt/freeware
export CC="gcc"
export CXX="g++"

PREFIX=$HOME/bin
CFLAGS='-DHAVE_INTTYPES_H=0' ./configure \
 --prefix=$PREFIX --with-libz=internal --with-threads=no --with-geotiff=internal --with-libtiff=internal

echo "Now manually edit:  vim port/cpl_config.h and disable use of AIX's <inttypes.h> header file"
echo "#define HAVE_INTTYPES_H 0"
echo "See bug http://trac.osgeo.org/gdal/ticket/4809"
  • Fix $HOME/bin/gdal-config issue (bug in GRASS GIS 7 or GDAL?): add to the 'CONFIG_LIBS' line the entry
 -lstdc++
  • If you want r.terraflow, patch the source code for a workaround of a gcc bug on AIX:
r.terraflow_AIX_gcc_fix.diff
Index: raster/r.terraflow/stats.h
===================================================================
--- raster/r.terraflow/stats.h  (revision 56936)
+++ raster/r.terraflow/stats.h  (working copy)
@@ -22,6 +22,16 @@
 
 #include <sys/types.h>
 
+/* http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01957.html */
+#if defined(_AIX) && defined(_LARGE_FILES)
+#include <fcntl.h>
+#undef open
+/* Alias the symbols using asm */
+extern "C" {
+extern int open(const char *, int, ...) __asm__("open64");
+}
+#endif
+
 #include <fstream>
 #include <iostream>
 using namespace std;

AIX 5.x compilation hints

  • conf_wget_AIX.sh:
sh configure --prefix=/afs/cluster/grid/user/private/bin/ --disable-nls
  • conf_proj_AIX.sh:
sh configure --prefix=/afs/cluster/grid/user/private/bin --without-mutex
  • conf_gdal_AIX.sh:
export LIBICONV=/opt/freeware
export CC="gcc"
export CXX="g++"
PREFIX=/afs/cluster/grid/user/private/bin
sh configure \
   --prefix=$PREFIX \
   --with-libz=internal \
   --with-threads=no \
   --with-geotiff=internal --with-libtiff=internal
  • conf_grass6_AIX.sh
#!/bin/sh                                          

# optimization
# http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
MYCFLAGS="-O2 $XEON"                              
MYCXXFLAGS="-O2"                                  

# debug
#MYCFLAGS="-g"
#MYCXXFLAGS="-g"

########
MYBIN=$HOME/private/bin
MYNAD2BIN=$MYBIN/bin/nad2bin

# 64bit:
CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCXXFLAGS" NAD2BIN=$MYNAD2BIN ./configure \
  --prefix=$MYBIN \
  --with-cxx \
  --enable-largefile \
  --with-gdal=$MYBIN/bin/gdal-config \
  --with-includes=$MYBIN/include \
  --with-proj \
  --with-proj-includes=$MYBIN/include \
  --with-proj-libs=$MYBIN/lib \
  --with-proj-share=$MYBIN/share/proj \
  --with-png=yes \
  --with-tiff=yes \
  --with-tcltk=yes \
  --with-sqlite=yes \
  --with-opengl=yes \
  --with-x=yes \
  --with-nls=no \
  --with-freetype=no \
  --with-jpeg=no \
  --with-postgres=no \
  --with-mysql=no \
  --with-ffmpeg=no \
  --with-odbc=no \
  --with-fftw=no \
  --with-blas=no \
  --with-lapack=no \
  --with-motif=no \
  --with-glw=no \
  --with-readline=no \
  --with-opendwg=no \
  --with-python=no
  • conf_grass7_AIX.sh:
export LIBICONV=/opt/freeware
# comment next two lines for using the IBM xlc compiler:
export CC="gcc"
export CXX="g++"

PREFIX=$HOME/private/bin

CFLAGS='-ansi -D_ALL_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=200809L -Dinline=' ./configure \
  --prefix=$PREFIX \
  --disable-shared \
  --enable-largefile \
  --with-cxx \
  --with-proj-includes=$PREFIX/include/ \
  --with-proj-libs=$PREFIX/lib/ \
  --with-proj-share=$PREFIX/share/proj/ \
  --with-sqlite \
  --with-sqlite-includes=$PREFIX/include/ \
  --with-sqlite-libs=$PREFIX/lib/ \
  --with-tiff=no \
  --with-png=no \
  --with-fftw=no \
  --with-cairo=no \
  --with-freetype=no