summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/machine-learning/shogun/default.nix51
-rw-r--r--pkgs/applications/science/math/colpack/default.nix31
-rw-r--r--pkgs/applications/science/math/pari/default.nix27
3 files changed, 100 insertions, 9 deletions
diff --git a/pkgs/applications/science/machine-learning/shogun/default.nix b/pkgs/applications/science/machine-learning/shogun/default.nix
new file mode 100644
index 000000000000..9d736694cbdc
--- /dev/null
+++ b/pkgs/applications/science/machine-learning/shogun/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, lib, fetchFromGitHub, ccache, cmake, ctags, swig
+# data, compression
+, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
+# maths
+, blas, eigen, nlopt, lp_solve, colpack
+# libraries
+, libarchive, liblapack, libxml2
+# extra support
+, pythonSupport ? true, pythonPackages ? null
+, opencvSupport ? false, opencv ? null
+}:
+
+assert pythonSupport -> pythonPackages != null;
+assert opencvSupport -> opencv != null;
+
+stdenv.mkDerivation rec {
+
+  pname = "shogun";
+  version = "6.0.0";
+  name = pname + "-" + version;
+
+  src = fetchFromGitHub {
+    owner = pname + "-toolbox";
+    repo = pname;
+    rev = pname + "_" + version;
+    sha256 = "0f2zwzvn5apvwypkfkq371xp7c5bdb4g1fwqfh8c2d57ysjxhmgf";
+    fetchSubmodules = true;
+  };
+
+  CCACHE_DIR=".ccache";
+
+  buildInputs = with lib; [
+      blas bzip2 ccache cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
+      protobuf nlopt snappy swig (libarchive.dev) liblapack libxml2
+    ]
+    ++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
+    ++ optional  (opencvSupport) opencv;
+
+  cmakeFlags = with lib; []
+    ++ (optional (pythonSupport) "-DPythonModular=ON")
+    ++ (optional (opencvSupport) "-DOpenCV=ON")
+    ;
+
+  meta = with stdenv.lib; {
+    description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
+    homepage = "http://shogun-toolbox.org/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ edwtjo ];
+  };
+
+}
diff --git a/pkgs/applications/science/math/colpack/default.nix b/pkgs/applications/science/math/colpack/default.nix
new file mode 100644
index 000000000000..29785363b048
--- /dev/null
+++ b/pkgs/applications/science/math/colpack/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, gettext }:
+
+stdenv.mkDerivation rec {
+
+  pname = "ColPack";
+  version = "1.0.10";
+  name = pname + "-" + version;
+
+  src = fetchFromGitHub {
+    owner = "CSCsw";
+    repo = pname;
+    rev = "v" + version;
+    sha256 = "1p05vry940mrjp6236c0z83yizmw9pk6ly2lb7d8rpb7j9h03glr";
+  };
+
+  buildInputs = [ autoconf automake gettext libtool ];
+
+  configurePhase = ''
+    autoreconf -vif
+    ./configure --prefix=$out --enable-openmp
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A package comprising of implementations of algorithms for
+    vertex coloring and derivative computation";
+    homepage = "http://cscapes.cs.purdue.edu/coloringpage/software.htm#functionalities";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ edwtjo ];
+  };
+
+}
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index 64784facfb96..86d4d289c2a6 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -14,12 +14,21 @@ stdenv.mkDerivation rec {
   buildInputs = [ gmp readline libX11 libpthreadstubs tex perl ];
 
   configureScript = "./Configure";
-  configureFlags =
-    "--mt=pthread" +
-    "--with-gmp=${gmp.dev} " +
-    "--with-readline=${readline.dev}";
+  configureFlags = [
+    "--mt=pthread"
+    "--with-gmp=${gmp.dev}"
+    "--with-readline=${readline.dev}"
+  ] ++ stdenv.lib.optional stdenv.isDarwin "--host=x86_64-darwin";
 
-  makeFlags = "all";
+  preConfigure = ''
+    export LD=$CC
+  '';
+
+  postConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    echo 'echo x86_64-darwin' > config/arch-osname
+  '';
+
+  makeFlags = [ "all" ];
 
   meta = with stdenv.lib; {
     description = "Computer algebra system for high-performance number theory computations";
@@ -36,12 +45,12 @@ stdenv.mkDerivation rec {
        Bordeaux I, France), PARI is now under the GPL and maintained by Karim
        Belabas with the help of many volunteer contributors.
 
-       - PARI is a C library, allowing fast computations.  
+       - PARI is a C library, allowing fast computations.
        - gp is an easy-to-use interactive shell giving access to the
           PARI functions.
        - GP is the name of gp's scripting language.
-       - gp2c, the GP-to-C compiler, combines the best of both worlds 
-          by compiling GP scripts to the C language and transparently loading 
+       - gp2c, the GP-to-C compiler, combines the best of both worlds
+          by compiling GP scripts to the C language and transparently loading
           the resulting functions into gp. (gp2c-compiled scripts will typically
           run 3 or 4 times faster.) gp2c currently only understands a subset
            of the GP language.
@@ -50,7 +59,7 @@ stdenv.mkDerivation rec {
     downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
     license     = licenses.gpl2Plus;
     maintainers = with maintainers; [ ertes raskin AndersonTorres ];
-    platforms   = platforms.linux;
+    platforms   = platforms.linux ++ platforms.darwin;
     updateWalker = true;
   };
 }