Code Monkey home page Code Monkey logo

libkriging's Introduction

Build and tests Code Analysis Coverage Status License

Table of contents

If you want to contribute read Contribution guide.

Installation from pre-built packages

For the most common target {Python, R, Octave} x {Linux, macOS, Windows} x { x86-64 }, you can use released binaries.

pylibkriging for Python

pip3 install pylibkriging

or for pre-release packages (according to your OS and Python version)

pip3 install https://github.com/libKriging/libKriging/releases/download/v0.5.0-alpha/pylibkriging-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Usage example here

👆The sample code below should give you a taste. Please refer to the reference file linked above for a CI certified example.
import numpy as np

X = [0.0, 0.25, 0.5, 0.75, 1.0]
f = lambda x: (1 - 1 / 2 * (np.sin(12 * x) / (1 + x) + 2 * np.cos(7 * x) * x ** 5 + 0.7))
y = [f(xi) for xi in X]

import pylibkriging as lk

k_py = lk.Kriging(y, X, "gauss")
print(k_py.summary())
# you can also check logLikelhood using:
# def ll(t): return k_py.logLikelihoodFun(t,False,False)[0]
# t = np.arange(0,1,1/99); pyplot.figure(1); pyplot.plot(t, [ll(ti) for ti in t]); pyplot.show()

x = np.arange(0, 1, 1 / 99)
p = k_py.predict(x, True, False)
p = {"mean": p[0], "stdev": p[1], "cov": p[2]}  # This should be done by predict

import matplotlib.pyplot as pyplot

pyplot.figure(1)
pyplot.plot(x, [f(xi) for xi in x])
pyplot.scatter(X, [f(xi) for xi in X])

pyplot.plot(x, p['mean'], color='blue')
pyplot.fill(np.concatenate((x, np.flip(x))),
            np.concatenate((p['mean'] - 2 * p['stdev'], np.flip(p['mean'] + 2 * p['stdev']))), color='blue',
            alpha=0.2)
pyplot.show()

s = k_py.simulate(10, 123, x)

pyplot.figure(2)
pyplot.plot(x, [f(xi) for xi in x])
pyplot.scatter(X, [f(xi) for xi in X])
for i in range(10):
    pyplot.plot(x, s[:, i], color='blue', alpha=0.2)
pyplot.show()
Note for older versions (< 0.5) NB: On Windows, it should require [extra DLL](https://github.com/libKriging/libKriging/releases/download/v0.4.2/extra_dlls_for_python_on_windows.zip) not (yet) embedded in the python package. To load them into Python's search PATH, use: ```python import os os.environ['PATH'] = 'c:\\Users\\User\\Path\\to\\dlls' + os.pathsep + os.environ['PATH'] import pylibkriging as lk ```

Download the archive from libKriging releases

# in R
install.packages("https://github.com/libKriging/rlibkriging/releases/download/0.8-0.1/rlibkriging_0.8-0_R_x86_64-pc-linux-gnu.tar.gz", repos=NULL)

Usage example here

👆The sample code below should give you a taste. Please refer to the reference file linked above for a CI certified example.
X <- as.matrix(c(0.0, 0.25, 0.5, 0.75, 1.0))
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
y <- f(X)

library(rlibkriging)
k_R <- Kriging(y, X, "gauss")
print(k_R)
# you can also check logLikelhood using:
# ll = function(t) logLikelihoodFun(k_R,t)$logLikelihood; plot(ll)
x <- as.matrix(seq(0, 1, , 100))
p <- predict(k_R, x, TRUE, FALSE)

plot(f)
points(X, y)
lines(x, p$mean, col = 'blue')
polygon(c(x, rev(x)), c(p$mean - 2 * p$stdev, rev(p$mean + 2 * p$stdev)), border = NA, col = rgb(0, 0, 1, 0.2))

s <- simulate(k_R,nsim = 10, seed = 123, x=x)

plot(f)
points(X,y)
matplot(x,s,col=rgb(0,0,1,0.2),type='l',lty=1,add=T)

mlibkriging for Octave and MATLAB

⚠️ Matlab binary package are done on request (GitHub Action does not support all required Operating Systems)

Download and uncompress the Octave archive from libKriging releases

# example
curl -LO https://github.com/libKriging/libKriging/releases/download/v0.5.1/mLibKriging_0.5.1_Linux-x86_64.tgz

Then

octave --path /path/to/mLibKriging/installation

or inside Octave or Matlab

addpath("path/to/mLibKriging")

Usage example here

👆The sample code below should give you a taste. Please refer to the reference file linked above for a CI certified example.
X = [0.0;0.25;0.5;0.75;1.0];
f = @(x) 1-1/2.*(sin(12*x)./(1+x)+2*cos(7.*x).*x.^5+0.7)
y = f(X);
k_m = Kriging(y, X, "gauss");
disp(k_m.summary());
% you can also check logLikelhood using:
% function llt = ll (tt) global k_m; llt=k_m.logLikelihoodFun(tt); endfunction; t=0:(1/99):1; plot(t,arrayfun(@ll,t))
x = reshape(0:(1/99):1,100,1);
[p_mean, p_stdev] = k_m.predict(x, true, false);

h = figure(1)
hold on;
plot(x,f(x));
scatter(X,f(X));
plot(x,p_mean,'b')
poly = fill([x; flip(x)], [(p_mean-2*p_stdev); flip(p_mean+2*p_stdev)],'b');
set( poly, 'facealpha', 0.2);
hold off;

s = k_m.simulate(int32(10),int32(123), x);

h = figure(2)
hold on;
plot(x,f(x));
scatter(X,f(X));
for i=1:10
   plot(x,s(:,i),'b');
end
hold off;

Expected demo results

Using the previous linked examples (in Python, R, Octave or Matlab), you should obtain the following results

predict plot simulate plot

Tested installation

with libKriging 0.6.0

Linux Ubuntu:20 macOS 11 & 12 (x86-64) macOS 12 (ARM) Windows 10
Python 3.6-3.10 3.6-3.10 3.9** 3.6-3.9
R 4.2 4.2 ?** 4.2
Octave 7.2 7.2 7.1** 6.2
Matlab ️✔ R2022a R2022** R2022 R2022**
  • * : requires extra DLLs. See python installation

  • ** : no pre-built package nor CI

  • ? : requires manual verification (not updated since previous release)

Compilation

Requirements (more details)

  • CMake ≥ 3.13

  • C++ Compiler with C++17 support

  • Linear algebra packages providing blas and lapack functions.

    You can use standard blas and lapack, OpenBlas, MKL.

  • Python ≥ 3.6 (optional)

  • Octave ≥ 6.0 (optional)

  • Matlab ≥ R2021 (optional)

  • R ≥ 3.6 (optional)

Get the code

Just clone it with its submodules:

git clone --recurse-submodules https://github.com/libKriging/libKriging.git

Helper scripts for CI

Note: calling these scripts "by hand" should produce the same results as following "Compilation and unit tests" instructions (and it should be also easier). They use the preset of options also used in CI workflow.

To configure it, you can define following environment variables (more details):

Variable name Default value Useful values Comment
MODE Debug Debug, Release
ENABLE_OCTAVE_BINDING AUTO ON, OFF, AUTO (if available) Exclusive with Matlab binding build
ENABLE_MATLAB_BINDING AUTO ON, OFF, AUTO (if available) Exclusive with Octave binding build
ENABLE_PYTHON_BINDING AUTO ON, OFF, AUTO (if available)

Then choose your BUILD_NAME using the following rule (stops a rule matches)

BUILD_NAME when you want to build available bindings
r-windows a R binding for windows C++, rlibkriging
r-linux-macos a R binding for Linux or macOS C++, rlibkriging
octave-windows an Octave for windows C++, mlibkriging
windows for windows C++, mlibkriging, pylibkriging
linux-macos for Linux or macOS C++, mlibkriging, pylibkriging

Then:

  • Go into libKriging root directory

    cd libKriging
  • Prepare your environment (Once, for your first compilation)

    .travis-ci/${BUILD_NAME}/install.sh
  • Build

    .travis-ci/${BUILD_NAME}/build.sh

    NB: It will create a build directory.

  • Test

    .travis-ci/${BUILD_NAME}/test.sh

Compilation and tests manually

Preamble

We assume that:

  • libKriging code is available locally in directory ${LIBKRIGING} (could be a relative path like ..)
  • you have built a fresh new directory ${BUILD} (should be an absolute path)
  • following commands are executed in ${BUILD} directory

PS: ${NAME} syntax represents a word or an absolute path of your choice

Select your compilation ${MODE} between:

  • Release : produce an optimized code
  • Debug (default) : produce a debug code
  • Coverage : for code coverage analysis (not yet tested with Windows)

Following commands are made for Unix shell. To use them with Windows use git-bash or Mingw environments.

Compilation for Linux and macOS

👆 expand the details
  • Configure
    cmake -DCMAKE_BUILD_TYPE=${MODE} ${LIBKRIGING}
  • Build
    cmake --build .
  • Run tests
    ctest
  • Build documentation (requires doxygen)
    cmake --build . --target doc
  • if you have selected MODE=Coverage mode, you can generate code coverage analysis over all tests using
    cmake --build . --target coverage --config Coverage
    or
    cmake --build . --target coverage-report --config Coverage
    to produce a html report located in ${BUILD}/coverage/index.html

Compilation for Windows 64bits with Visual Studio

👆 expand the details
  • Configure
    cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DEXTRA_SYSTEM_LIBRARY_PATH=${EXTRA_SYSTEM_LIBRARY_PATH} ${LIBKRIGING}
    where EXTRA_SYSTEM_LIBRARY_PATH is an extra path where libraries (e.g. OpenBLAS) can be found.
  • Build
    cmake --build . --target ALL_BUILD --config ${MODE}
  • Run tests
    export PATH=${BUILD}/src/lib/${MODE}:$PATH
    ctest -C ${MODE}

Compilation for Linux/Mac/Windows using R toolchain

👆 expand the details

With this method, you need R ( and R-tools if you are on Windows).

We assume you have previous requirements and also make command available in your PATH.

  • Configure
    CC=$(R CMD config CC) CXX=$(R CMD config CXX) cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${MODE} ${LIBKRIGING}
  • Build
    cmake --build .
  • Run tests
    ctest

Deployment

To deploy libKriging as an installed library, you have to add -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX} option to first cmake configuration command.

If CMAKE_INSTALL_PREFIX variable is not set with CMake, default installation directory is ${BUILD}/installed.

For Linux and macOS

👆 expand the details
cmake -DCMAKE_BUILD_TYPE=${MODE} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX} ${LIBKRIGING}

and then

cmake --build . --target install

aka with classical makefiles

make install

For Windows 64bits with Visual Studio

👆 expand the details
cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DEXTRA_SYSTEM_LIBRARY_PATH=${EXTRA_SYSTEM_LIBRARY_PATH} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX} ${LIBKRIGING} 

and then

cmake --build . --target install --config ${MODE}

Assisted compilation and installation

Using pip install from GitHub

You don't need to download libKriging. pip install will do everything. To do that, you need the Compilation requirements.

python3 -m pip install "git+https://github.com/libKriging/libKriging.git"

will download, compile and install pylibkriging from master branch.

Example of build process output (~2mn)
Collecting git+https://github.com/libKriging/libKriging.git
  Cloning https://github.com/libKriging/libKriging.git to /private/var/folders/g0/56fnffpn6tjd5kplh140ysrh0000gn/T/pip-req-build-2xhzyw9g
  Running command git clone --filter=blob:none -q https://github.com/libKriging/libKriging.git /private/var/folders/g0/56fnffpn6tjd5kplh140ysrh0000gn/T/pip-req-build-2xhzyw9g
  Resolved https://github.com/libKriging/libKriging.git to commit 1a86dd69cf1f60b6dcd2b5e5b876cafc97d616e9
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pylibkriging
  Building wheel for pylibkriging (setup.py) ... done
  Created wheel for pylibkriging: filename=pylibkriging-0.4.8-cp39-cp39-macosx_12_0_x86_64.whl size=712572 sha256=7963a78f16628c5a7d877b368fdd73452e5acf01784cd6931d48dcdc08e62a5b
  Stored in directory: /private/var/folders/g0/56fnffpn6tjd5kplh140ysrh0000gn/T/pip-ephem-wheel-cache-o7kxij3t/wheels/52/71/b0/e534f2249e9180c596a5b785cf0bfa5471fcfd38d2987318f8
Successfully built pylibkriging
Installing collected packages: pylibkriging
Successfully installed pylibkriging-0.4.8

To get a particular version (branch or tag ≥v0.4.9), you can use:

python3 -m pip install "git+https://github.com/libKriging/libKriging.git@tag"

libkriging's People

Contributors

e-freiman avatar hpwxf avatar richetyann avatar sebastiendaveiga avatar yannrichet avatar yannrichet-irsn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libkriging's Issues

Windows compilation with Python 3.8 and 3.9

Using Python 3.7 process:

export ENABLE_PYTHON_BINDING=on
.travis-ci/windows/install.sh
.travis-ci/windows/build.sh
# -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
# -- The C compiler identification is MSVC 19.28.29335.0
.travis-ci/windows/test.sh

is Ok

but using python 3.8 or 3.9, test.shscript gives:

      Start  2: Python/loading
 2/17 Test  #2: Python/loading ....................................................................................***Failed    0.31 sec

============================= test session starts =============================
platform win32 -- Python 3.8.0, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: C:\Users\User\libKriging\bindings\Python
collected 0 items / 1 error

=================================== ERRORS ====================================
___________________ ERROR collecting tests/loading_test.py ____________________
ImportError while importing test module 'C:\Users\User\libKriging\bindings\Python\tests\loading_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Python38\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
..\..\..\..\bindings\Python\tests\loading_test.py:1: in <module>
    import pylibkriging as m
E   ImportError: DLL load failed while importing pylibkriging: The specified module could not be found.
=========================== short test summary info ===========================
ERROR ..\..\..\..\bindings\Python\tests\loading_test.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 0.10s ===============================

Add persistent object with R binding

R function calls could lead to the creation of objects in C++ world.

To minimize computations, these objects should not be rebuilt and destroyed at each call.

Hence, we need an object sharing. First thoughts lead to two options:

  • a true object mapping between C++ and R (is it also possible with next bindings)
  • a proxy object sharing which is only an identifier to a memory in C++ world (this could be the most portable way).

First API for kriging algorithms

A kriging algorithm should be:

  • an object built (fit) from (y, x, ker)
    • y: a vector
    • x: a set of column (matrix or dataframe)
    • ker: a kernel (details below)
  • prediction function (predict) from (xtest, [options])->ans
    • xtest: a set of column (matrix or dataframe)
    • options: options explaining wanted answers (configure optional computations)
    • ans: a structure made from a vector and enabled optional computations (stddev, cor/cov...)
  • each function requires error management (explicit from function signature and unavoidable by the caller)
  • 'y' and 'x' could be extended (updated) after object construction.

A kernel is (x, theta)->(x1, x2)->mat parametrized function.
First kernels come from a catalog of known kernels. Later kernels could be analytic compositions of existing kernels.

Dimensional comments:

  • dataframe x : n (~ 2000) x d (~150)
  • theta : ~ d
  • dataframe x1: n1 x d
  • dataframe x2: n2 x d
  • mat : n1x n2

Installation test workflow for binary packages

Current tested environment (manually)

OS Language Behavior
Ubuntu 20 R 4.1 OK
Ubuntu 20 Octave 5.2 OK
Ubuntu 20 Python 3.8.5 OK
macOS 11 R 4.1 OK ✔︎
macOS 11 Octave 6.2 OK
macOS 11 Python 3.9.5 OK
Windows R 4.1 ??? (Rcpp not available for R 4.1)
Windows Octave 6.2 OK
Windows Python 3.6-3.7 #109 requires additional DLLs
Windows Python 3.8-3.9 #103 ImportError: DLL load failed

✔︎ : positive feedback from external users

Requested by users

OS Language Behavior vs 0.4.2
Ubuntu 18 R 4.0.5 `GLIBC_2.29' not found
macOS 11 4.0.3 R 4.1 libs not found

Code cleanup (reminder)

This is a reminder for later code cleanup after satisfying results (compared to DiceKriging)

In OrdinaryKriging, without any priority order:

  • Re-enable Parameters
  • Remplace predict's output tuples with a user-friendly structure (more usable than get<>)
  • Check all « unused paramters » and « unused variable »
  • Replacing arma::cout with a true log system ?
  • Kernel Factory (up to now, only a hardcoded « gauss »)

GitHub CI does not publish coverage report to coveralls.io

cf https://github.com/haveneer/libKriging-GHA/runs/1633411701?check_suite_focus=true#step:13:65

Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[/home/runner/work/libKriging-GHA/libKriging-GHA/]
bindings/Octave/LinearRegression_binding.cpp   | 100%    26| 100%   6|    -    0
bindings/Octave/mLibKriging.cpp                |82.8%    29|75.0%   4|    -    0
bindings/Octave/tests/manage_test_crash.c      |71.4%    14| 100%   1|    -    0
bindings/Octave/tools/MxException.hpp          | 100%     3|33.3%   6|    -    0
bindings/Octave/tools/MxMapper.cpp             | 100%    12| 100%   4|    -    0
bindings/Octave/tools/MxMapper.hpp             |82.6%    23| 100%  10|    -    0
bindings/Octave/tools/ObjectAccessor.cpp       |63.6%    11| 100%   2|    -    0
bindings/Octave/tools/ObjectAccessor.hpp       | 100%     2| 100%   1|    -    0
bindings/Octave/tools/ObjectCollector.cpp      | 100%    19| 100%   7|    -    0
bindings/Octave/tools/ObjectCollector.hpp      |91.3%    23|66.7%   6|    -    0
bindings/Octave/tools/RequiresArg.cpp          |76.9%    13| 100%   2|    -    0
bindings/Octave/tools/formatString.hpp         | 100%     5|27.3%  11|    -    0
bindings/Octave/tools/mx_accessor.hpp          |83.3%    36| 100%   6|    -    0
bindings/Octave/tools/relative_error.cpp       | 0.0%     7| 0.0%   2|    -    0
bindings/Octave/tools/string_hash.hpp          |83.3%     6| 0.0%   1|    -    0
bindings/Python/src/AddDemo.cpp                | 100%     2| 100%   1|    -    0
bindings/Python/src/Kriging_binding.cpp        | 100%    12| 100%   6|    -    0
bindings/Python/src/Li...Regression_binding.cpp| 100%    12| 100%   6|    -    0
bindings/Python/src/NumPyDemo.cpp              |85.7%    14| 100%   1|    -    0
bindings/Python/src/RandomGenerator.cpp        | 100%     7| 100%   5|    -    0
bindings/Python/src/pylibkirging.cpp           | 100%    25| 100%   5|    -    0
src/lib/Bench.cpp                              | 0.0%    35| 0.0%   9|    -    0
src/lib/Kriging.cpp                            |37.0%   521|41.0%  39|    -    0
src/lib/LinearRegression.cpp                   | 100%    13| 100%   4|    -    0
src/lib/LinearRegressionOptim.cpp              | 0.0%    39| 0.0%   7|    -    0
src/lib/demo/DemoArmadilloClass.cpp            | 100%    73| 100%   6|    -    0
src/lib/demo/DemoClass.cpp                     | 100%     4| 100%   2|    -    0
src/lib/demo/DemoFunction.cpp                  | 100%     2| 100%   1|    -    0
src/lib/include/libKriging/Kriging.hpp         | 100%     3| 100%   3|    -    0
src/lib/include/libKriging/LinearRegression.hpp| 100%     1| 100%   2|    -    0
src/lib/include/libKriging/demo/DemoClass.hpp  | 100%     1| 100%   1|    -    0
tests/KrigingTest.cpp                          |55.6%    63|31.8%  22|    -    0
tests/catch2_unit_test.cpp                     | 100%    29| 100%   4|    -    0
tests/demo/armadillo_example.cpp               | 100%     9| 100%   3|    -    0
tests/demo/class_unit_test.cpp                 | 100%     6| 100%   3|    -    0
tests/demo/function_unit_test.cpp              | 100%     5| 100%   3|    -    0
tests/regression_unit_test.cpp                 | 100%    35| 100%   7|    -    0
================================================================================
                                         Total:|58.9%  1140|65.6% 209|    -    0
/var/lib/gems/2.5.0/gems/coveralls-lcov-1.6.0/lib/coveralls/lcov/converter.rb:92: warning: Insecure world writable dir /home/linuxbrew/.linuxbrew/bin in PATH, mode 040777
#<Net::HTTPUnprocessableEntity 422 Unprocessable Entity readbody=true>
{"message":"Couldn't find a repository matching this job.","error":true}
#<Net::HTTPUnprocessableEntity 422 Unprocessable Entity readbody=true>
{"message":"Couldn't find a repository matching this job.","error":true}
#<Net::HTTPUnprocessableEntity 422 Unprocessable Entity readbody=true>
{"message":"Couldn't find a repository matching this job.","error":true}

pylibkriging import fails on Windows

on: Python 3.9.5

$ pip install pylibkriging
Collecting pylibkriging
  Downloading pylibkriging-0.4.1-cp39-cp39-win_amd64.whl (252 kB)
     |████████████████████████████████| 252 kB ...
Installing collected packages: pylibkriging
Successfully installed pylibkriging-0.4.1

But

ImportError: DLL load failed while importing pylibkriging: The specified module could not be found.

API & Binding improvements

Octave:

  • Parameters

Python:

  • typed returned values for Python (as expected in Python notebook demo) using named attributes

C++:

  • Replace weak type (string) with stronger type (like Requirements in Octave binding using std::variant)
    Should be useful for:
    • const std::string& optim = "BFGS"
    • const std::string& objective = "LL"
  • rename _grad, _hess parameters as want_X or with_X
  • In Parameters, data pairs like "has_X", "X" (ex: X=beta) should be unified using one "std::optional"

Compilation errors in Amadillo 9.600 with HDF5 v1.12

Using HDF5 v1.12 with current embedded armillo version (9.600.x) causes following error:

libKriging/dependencies/armadillo-code/src/wrapper1.cpp:1537:14: error: no matching function for call to 'H5Ovisit3'
      return H5Ovisit(object_id, index_type, order, op, op_data);
             ^~~~~~~~
/usr/local/Cellar/hdf5/1.12.0/include/H5version.h:785:20: note: expanded from macro 'H5Ovisit'
  #define H5Ovisit H5Ovisit3
                   ^~~~~~~~~
/usr/local/Cellar/hdf5/1.12.0/include/H5Opublic.h:211:15: note: candidate function not viable: requires 6 arguments, but 5 were provided
H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
              ^
1 error generated.

This error does not occur using HDF5 v1.10.

If use of HDF5 is causing problems rerun cmake with HDF5 detection:
cmake -D DETECT_HDF5=false .

NB:

  • Octave v5.2 requires HDF5 v1.12 on macOS (cf brew)
  • Octave v5.1 requires HDF5 v1.10 on macOS (cf brew)
    force installation of v5.1 using
brew uninstall [email protected]
brew link --force [email protected]
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/193c6138d5860abb48c3e534362163b6670176b2/Formula/suite-sparse.rb
...

Create a project template

Create a project template to help similar projects with multiple bindings and OS support.

The initial template will be named libLinearModel
The first instances of this template should be:

  • libDesignExperiments (la partie algebre linéaire sera faite par des matheux)
  • libKrigingAlgs (EGO, criteres SUR, .. idem les matheux font l'algebre)

Issue triage

This issue is a TODO collection (mixing French and English wording).
All these TODOs must be prioritized and moved into dedicated issue.

  • fix error with R binding on macOS
  • Add logMargPost binding
  • Add predict, simulate, update and logMargPost in consistency tests.
  • Python binding
    • read_csv for numpy array cannot read properly column vector (need manual transpose)
  • Update carma to unstable version
  • CI -> rename .travis-ci as tools/build
  • Ajouter un auto test dans les packages pour vérifier le fonctionnement après installation
  • Mispelling in lib name : mLibKrging_macOS10.15.7-x86_64_v0.3.2.tgz
  • Check/update naming scheme for binary packages
  • Octave default example is too light
  • CRAN release for R package
  • Conan package for C++
  • Rename _grad, _hess parameters as want_X or with_X
  • Memoization
    • Cf Kriging.cpp (1029) bool bfgs_ok = optim::lbfgs(
    • Quels paramètres faut-il suivre ?
  • /8\ API de Parameters en Octave
  • Mettre sous forme typée objet/enum les paramètres « string »:
    • const std::string& optim = "BFGS"
    • const std::string& objective = "LL"
  • Custom output type to bind as an object in bindings (e.g. as Python object with named attributes)
  • Dans le contenu de Parameters il y a des couples: "has_X", "X" (ex: X=beta) ne pourrait-on pas les unifier en un seul truc du genre "optional" ?
  • Etudier tous les chemins entre les appels (Builder Pattern ?) via un graphe connectant les successions possibles
  • Memcheck analysis fails
  • Mettre Memcheck et d’autres sanitizers dans un workflow spécifiques
  • Add CMake package for using C++ lib (https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html)
  • Replug coverage report
  • Check with Ralph about unset CMAKE_INSTALL_PREFIX + patched armadillo
  • Update Compatibility table in README (add workflow to check it)
  • Check compatibility with Python 3.10(b)
  • Run release pipeline weekly to check workflow
  • Update dependencies
    • Do not mix submodules and subrepos
    • Carma (to unstable ?)
    • Pybind11
    • Armadillo
    • Catch2
    • OptimLib
  • Disable Performance Benchmark when not necessary
  • Explore automatic differentiation

Shared lib compilation fails on Windows

Armadillo embedded dependency causes an error while compiling with cmake option BUILD_SHARED_LIBS=TRUE .

This issue does not occur on Linux or MacOS.

Configuration output

cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=TRUE ..
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl                                   .exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl                                   .exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/                                   cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/                                   cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at dependencies/armadillo-code/CMakeLists.txt:21 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    PROJECT_VERSION
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring Armadillo 9.500.3
--
-- *** WARNING: automatic installation is experimental for this platform.
-- *** WARNING: if anything breaks, you get to keep all the pieces.
-- *** WARNING: manual installation is described in the README file.
--
--
-- *** WARNING: building shared library with MSVC is not supported.
-- *** WARNING: if anything breaks, you get to keep all the pieces.
--
-- CMAKE_SYSTEM_NAME          = Windows
-- CMAKE_CXX_COMPILER_ID      = MSVC
-- CMAKE_CXX_COMPILER_VERSION = 19.0.24215.1
-- CMAKE_COMPILER_IS_GNUCXX   =
-- BUILD_SHARED_LIBS          = TRUE
-- DETECT_HDF5                = ON
CMake Warning (dev) at dependencies/armadillo-code/cmake_aux/Modules/ARMA_FindMKL.cmake:27 (set):
  implicitly converting 'TYPE' to 'STRING' type.
Call Stack (most recent call first):
  dependencies/armadillo-code/CMakeLists.txt:176 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenBLAS: C:/Users/Pascal/Miniconda3/Library/lib/openblas.lib
--      MKL_FOUND = NO
--   ACMLMP_FOUND = NO
--     ACML_FOUND = NO
-- OpenBLAS_FOUND = YES
--    ATLAS_FOUND = NO
--     BLAS_FOUND = NO
--   LAPACK_FOUND = NO
--
-- *** If the OpenBLAS library is installed in
-- *** /usr/local/lib or /usr/local/lib64
-- *** make sure the run-time linker can find it.
-- *** On Linux systems this can be done by editing /etc/ld.so.conf
-- *** or modifying the LD_LIBRARY_PATH environment variable.
--
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- HDF5_FOUND = FALSE
-- ARPACK_FOUND = NO
-- Looking for SuperLU version 5
-- Could not find SuperLU
-- SuperLU_FOUND = NO
--
-- *** Armadillo wrapper library will use the following libraries:
-- *** ARMA_LIBS = C:/Users/Pascal/Miniconda3/Library/lib/openblas.lib
--
-- Copying C:/Users/Pascal/libKriging/dependencies/armadillo-code/include/ to C:/Users/Pascal/libKriging                                   /build3/dependencies/armadillo-code/tmp/include/
-- Generating C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/tmp/include/config.hpp
-- Generating C:/Users/Pascal/libKriging/dependencies/armadillo-code/examples/Makefile
-- CMAKE_CXX_FLAGS           = /DWIN32 /D_WINDOWS /W3 /GR /EHsc
-- CMAKE_SHARED_LINKER_FLAGS = /machine:x64
-- CMAKE_REQUIRED_INCLUDES   =
--
-- CMAKE_INSTALL_PREFIX     = C:/Users/Pascal/libKriging/build3/installed
-- CMAKE_INSTALL_LIBDIR     = lib
-- CMAKE_INSTALL_INCLUDEDIR = include
-- CMAKE_INSTALL_DATADIR    = share
-- CMAKE_INSTALL_BINDIR     = bin
-- Generating 'C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/ArmadilloConfig.cmake'
-- Generating 'C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/ArmadilloConfigVersion.cmak                                   e'
-- Generating 'C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/InstallFiles/ArmadilloConfi                                   g.cmake'
-- Generating 'C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/InstallFiles/ArmadilloConfi                                   gVersion.cmake'
-- Copying C:/Users/Pascal/libKriging/dependencies/armadillo-code/misc/ to C:/Users/Pascal/libKriging/bu                                   ild3/dependencies/armadillo-code/tmp/misc/
-- Generating 'C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/tmp/misc/armadillo.pc'
-- Build shared library
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Success
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Pascal/libKriging/build3

Compilation output:

$ cmake --build . --target ALL_BUILD --config Release
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/lib/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/tests/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/tests/CMakeFiles/generate.stamp is up-to-date.
  Building Custom Rule C:/Users/Pascal/libKriging/src/lib/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/lib/CMakeFiles/generate.stamp is up-to-date.
  TestClass.cpp
  TestFunction.cpp
  Generating Code...
     Creating library C:/Users/Pascal/libKriging/build3/src/lib/Release/Kriging.lib and object C:/Users/Pascal/libKriging/build3/src/lib/Release/Kriging.exp
  Kriging.vcxproj -> C:\Users\Pascal\libKriging\build3\src\lib\Release\Kriging.dll
  Building Custom Rule C:/Users/Pascal/libKriging/dependencies/armadillo-code/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/dependencies/armadillo-code/CMakeFiles/generate.stamp is up-to-date.
  wrapper1.cpp
  wrapper2.cpp
  Generating Code...
  armadillo.vcxproj -> C:\Users\Pascal\libKriging\build3\dependencies\armadillo-code\Release\armadillo.dll
  Building Custom Rule C:/Users/Pascal/libKriging/src/tests/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/tests/CMakeFiles/generate.stamp is up-to-date.
  armadillo_example.cpp
LINK : fatal error LNK1181: cannot open input file '..\..\dependencies\armadillo-code\Release\armadillo.lib' [C:\Users\Pascal\libKriging\build3\src\tests\armadillo_example.vcxproj]
  Building Custom Rule C:/Users/Pascal/libKriging/src/tests/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/tests/CMakeFiles/generate.stamp is up-to-date.
  class_unit_test.cpp
  class_unit_test.vcxproj -> C:\Users\Pascal\libKriging\build3\src\tests\Release\class_unit_test.exe
  Building Custom Rule C:/Users/Pascal/libKriging/src/tests/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Pascal/libKriging/build3/src/tests/CMakeFiles/generate.stamp is up-to-date.
  function_unit_test.cpp
  function_unit_test.vcxproj -> C:\Users\Pascal\libKriging\build3\src\tests\Release\function_unit_test.exe

Better support of a range of versions for R in GHA

Up to now, only R 4.0.3 is tested and packaged in GHA (old Travis workflow can to it for R 3.6)

As an interesting idea, there is the following configuration:

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

name: R

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: macOS-latest
    strategy:
      matrix:
        r-version: [3.5, 3.6]

    steps:
      - uses: actions/checkout@v2
      - name: Set up R ${{ matrix.r-version }}
        uses: r-lib/actions/setup-r@ffe45a39586f073cc2e9af79c4ba563b657dc6e3
        with:
          r-version: ${{ matrix.r-version }}
      - name: Install dependencies
        run: |
          install.packages(c("remotes", "rcmdcheck"))
          remotes::install_deps(dependencies = TRUE)
        shell: Rscript {0}
      - name: Check
        run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
        shell: Rscript {0}

Matlab binding

  • requires a Matlab license or a VM including Matlab : using a free trial license
  • should start with a local POC (without CI) : done
  • supporting CI will be a challenge since it requires a Matlab license : available in GHA but only for Linux

Progression update:

  • : Linux support
  • : macOS support
  • : Windows support

Fix OrdinaryKriging::predict default output

Using nullptr as in https://github.com/MASCOTNUM/libKriging/blob/97d709368a6fe904416c863097c001d77fa745d8/src/lib/OrdinaryKriging.cpp#L337
is an silent compile-time error and a runtime crash

It could be like

  if (withStd)
    if (withCov)
      return std::make_tuple(std::move(mean), std::move(stdev), std::move(cov));
    else
      return std::make_tuple(std::move(mean), std::move(stdev), arma::mat{});
  else if (withCov)
    return std::make_tuple(std::move(mean), arma::colvec{}, std::move(cov));
  else
    return std::make_tuple(std::move(mean), arma::colvec{}, arma::mat{});

or using std::optional (really a better solution, may be even better using a dedicated struct and not a tuple)

fit_ofn optimisation on consecutive calls

cf Yann: « conserver la chol de la dernière eval de fit_ofn, car si l'eval suivante consiste a estimer le gradient, il est probable que l'eval précédente était le point en question (le vérifier). DiceKriging fait cette hypothèse. »

Crazy hack for R job on Windows

Using GCC toolchain on Windows to build R pakage, the final link fails with the error:

g++  -shared -s -o testBinding.dll tmp.def test_binding.o -Linstalled/lib -lKriging -LC:/Users/Pascal/Miniconda3/lib/R/../../Library/mingw-w64/lib/x64 -LC:/Users/Pascal/Miniconda3/lib/R/../../Library/mingw-w64/lib -LC:/Users/Pascal/Miniconda3/lib/R/bin/x64 -lR
/usr/bin/sh: line 8: g++ : command not found

As shown in following strace report, the problem is that the called compiler as a space in its name. This compiler is set by R environment.

   15   10427 [main] sh 3648 win_env::add_cache: native SHELL=C:\Program Files\Git\usr\bin\bash.exe
   17   10444 [main] sh 3648 posify_maybe: env var converted to SHELL=/usr/bin/bash.exe
   39   10483 [main] sh 3648 win32env_to_cygenv: 0x60003ADA0: SHELL=/usr/bin/bash.exe
   27   10510 [main] sh 3648 win32env_to_cygenv: 0x60003AD00: SHLIB=testBinding.dll
   29   10539 [main] sh 3648 win32env_to_cygenv: 0x60003AD20: SHLIB_LD='g++ '
   30   10569 [main] sh 3648 win32env_to_cygenv: 0x60003ADC0: SHLIB_LDFLAGS='-shared'
   30   10599 [main] sh 3648 win32env_to_cygenv: 0x60003ADE0: SHLVL=1
   33   10632 [main] sh 3648 win32env_to_cygenv: 0x60003AE00: SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
   47   10679 [main] sh 3648 win32env_to_cygenv: 0x60003AE40: SYSTEMDRIVE=C:

Commit d08be8e fix that using a hack which consists in creating a compiler called g++ (with a space in the name).

It may be useful to investigate a better fix using other version of R/Rtools or by setting a right value for SHLIB_LDvariable.

Cannot build on Ubuntu 20.04

On Ubutnu 20.04 (with python3-dev installed),
.travis-ci/r-linux-macos/build.sh will return
`
-- Build shared library
-- Static analysis not available.
-- Octave binding not available.
CMake Error at CMakeLists.txt:303 (add_subdirectory):
The source directory

/home/richet/Sync/Open/libKriging/github/libKriging/zzz/libKriging/dependencies/pybind11

does not contain a CMakeLists.txt file.

-- Python requirement failure:
python3 interpreter not found
-- Python binding not available.
-- Benchmark tests are disabled; to enable them use -DLIBKRIGING_BENCHMARK_TESTS=ON option
-- clang-format target for updating code format is available
CMake Warning at CMakeLists.txt:507 (message):
doxygen no found; doc target is not available.

-- Configuring incomplete, errors occurred!
See also "/home/richet/Sync/Open/libKriging/github/libKriging/zzz/libKriging/build/CMakeFiles/CMakeOutput.log".
`

Add a Dataframe object

In addition to matrices (arma::mat) and vectors (arma::colvec), it will be useful to add a dataframe structure which is a set of column vectors where each vector has a specific datatype (integer, floating point number, string).

This new structure requires an efficient mapping with R.

Add version number in binary

To follow versions of published releases, add version number inside the code

May use:

  • git describe --all --long
  • git rev-parse --verify HEAD

Disabled tests

Following R tests have been disabled for GHA migration (the were in failure before migration)

  • notest-KrigingFit.R
  • notest-LinearRegression.R
  • notest-LinearRegressionOptim.R

Once fixed, they could be re-enabled (by renaming them using test- prefix and not notest- prefix)

There is also a test in bindings/Python/tests/Kriging_test.py which is marked as @pytest.mark.skip since it fails due to a runtime error chol(): decomposition failed.

They should be re-enabled once new dev R-methods will be ok.

macOS 11 compilation errors

Using ENABLE_PYTHON_BINDING=on .travis-ci/r-linux-macos/build.sh leads to the followings warnins and errors:
(NB: everything is ok using ENABLE_PYTHON_BINDING=on .travis-ci/linux-macos/build.sh i.e. without R support)

R --version: R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
uname -smr: Darwin 20.2.0 x86_64 (aka macOS Big Sur Version 11.1 - 20C69)

-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *** set cmake policy CMP0025 to NEW
-- CMAKE_CXX_STANDARD = 11
-- Configuring Armadillo 10.1.2
-- Detected Clang 6.0 or later
-- ARMA_USE_EXTERN_RNG = true
-- CMAKE_SYSTEM_NAME          = Darwin
-- CMAKE_CXX_COMPILER_ID      = Clang
-- CMAKE_CXX_COMPILER_VERSION = 11.0.0
-- CMAKE_COMPILER_IS_GNUCXX   = 
-- BUILD_SHARED_LIBS          = on
-- DETECT_HDF5                = false
-- ALLOW_FLEXIBLAS_LINUX      = OFF
-- ALLOW_OPENBLAS_MACOS       = OFF
-- ALLOW_BLAS_LAPACK_MACOS    = OFF
-- BUILD_SMOKE_TEST           = OFF
-- 
-- *** Looking for external libraries
-- Detected macOS
-- Added '-framework Accelerate' to compiler flags
-- Detected Clang compiler on macOS. Added '-stdlib=libc++' to compiler flags
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Found ARPACK: /usr/local/lib/libarpack.dylib
-- ARPACK_FOUND = YES
-- Looking for SuperLU version 5
-- Found SuperLU: /usr/local/lib/libsuperlu.a
-- SuperLU_FOUND = YES
-- SuperLU_INCLUDE_DIR = /usr/local/include
-- 
-- *** Armadillo wrapper library will use the following libraries:
-- *** ARMA_LIBS = -framework Accelerate;/usr/local/lib/libarpack.dylib;/usr/local/lib/libsuperlu.a
-- 
-- Copying /Users/pascal/haveneer/libKriging.perso/dependencies/armadillo-code/include/ to /Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/tmp/include/
-- Generating /Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/tmp/include/config.hpp
-- CMAKE_CXX_FLAGS           =  -stdlib=libc++ -O2
-- CMAKE_SHARED_LINKER_FLAGS = 
-- CMAKE_REQUIRED_INCLUDES   = /usr/local/include
-- 
-- CMAKE_INSTALL_PREFIX     = /Users/pascal/haveneer/libKriging.perso/build/installed
-- CMAKE_INSTALL_LIBDIR     = lib
-- CMAKE_INSTALL_INCLUDEDIR = include
-- CMAKE_INSTALL_DATADIR    = share
-- CMAKE_INSTALL_BINDIR     = bin
-- Generating '/Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/ArmadilloConfig.cmake'
-- Generating '/Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/ArmadilloConfigVersion.cmake'
-- Generating '/Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/InstallFiles/ArmadilloConfig.cmake'
-- Generating '/Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/InstallFiles/ArmadilloConfigVersion.cmake'
-- Copying /Users/pascal/haveneer/libKriging.perso/dependencies/armadillo-code/misc/ to /Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/tmp/misc/
-- Generating '/Users/pascal/haveneer/libKriging.perso/build/dependencies/armadillo-code/tmp/misc/armadillo.pc'
-- Build shared library
-- Static analysis available but disabled in Release mode.
-- Octave binding disabled since it requires static library mode
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.9.1", minimum required is "3.6") 
-- Found PythonLibs: /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib
-- pybind11 v2.4.3
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Python binding enabled
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Benchmark tests are disabled; to enable them use -DLIBKRIGING_BENCHMARK_TESTS=ON option
-- clang-format target for updating code format is available
-- doc target for documentation generation is available
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pascal/haveneer/libKriging.perso/build
Scanning dependencies of target armadillo
[  6%] Building CXX object dependencies/armadillo-code/CMakeFiles/armadillo.dir/src/wrapper1.cpp.o
[ 12%] Building CXX object dependencies/armadillo-code/CMakeFiles/armadillo.dir/src/wrapper2.cpp.o
[ 18%] Linking CXX shared library libarmadillo.dylib
ld: warning: dylib (/usr/local/lib/libarpack.dylib) was built for newer macOS version (10.15) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(util.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgssv.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgssvx.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgstrf.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgstrs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgssv.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgssvx.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgstrf.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgstrs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(get_perm_c.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgssv.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgssvx.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgstrf.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgstrs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sp_ienv.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sp_preorder.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(memory.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgssv.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgssvx.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgstrf.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgstrs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(superlu_timer.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sp_coletree.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cutil.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cmemory.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cpivotgrowth.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(scomplex.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ccolumn_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ccolumn_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ccopy_to_ucol.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgscon.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgsequ.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cgsrfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(clangs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(claqgs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(colamd.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cpanel_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cpanel_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cpivotL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(cpruneL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(csnode_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(csnode_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dutil.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dmemory.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dpivotgrowth.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dcolumn_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dcolumn_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dcopy_to_ucol.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgscon.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgsequ.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dgsrfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dlangs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dlaqgs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dmach.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zmemory.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dpanel_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dpanel_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dpivotL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dpruneL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dsnode_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dsnode_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(smemory.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(mmd.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(heap_relax_snode.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(input_error.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(relax_snode.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sutil.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(spivotgrowth.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(scolumn_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(scolumn_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(scopy_to_ucol.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgscon.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgsequ.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(sgsrfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(slangs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(slaqgs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(smach.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(csp_blas2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dsp_blas2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ssp_blas2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zsp_blas2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(spanel_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(spanel_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(spivotL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(spruneL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ssnode_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ssnode_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zutil.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zpivotgrowth.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dcomplex.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zcolumn_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zcolumn_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zcopy_to_ucol.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgscon.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgsequ.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zgsrfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zlangs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zlaqgs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zpanel_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zpanel_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zpivotL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zpruneL.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zsnode_bmod.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zsnode_dfs.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(clacon2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dlacon2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(slacon2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(csp_blas3.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dsp_blas3.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(ssp_blas3.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zsp_blas3.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(zlacon2.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(dzsum1.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(icmax1.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(izmax1.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: object file (/usr/local/lib/libsuperlu.a(scsum1.c.o)) was built for newer macOS version (11.0) than being linked (10.13)
[ 18%] Built target armadillo
Scanning dependencies of target Kriging
[ 25%] Building CXX object src/lib/CMakeFiles/Kriging.dir/demo/DemoClass.cpp.o
[ 31%] Building CXX object src/lib/CMakeFiles/Kriging.dir/demo/DemoFunction.cpp.o
[ 37%] Building CXX object src/lib/CMakeFiles/Kriging.dir/demo/DemoArmadilloClass.cpp.o
[ 43%] Building CXX object src/lib/CMakeFiles/Kriging.dir/LinearRegression.cpp.o
[ 50%] Building CXX object src/lib/CMakeFiles/Kriging.dir/LinearRegressionOptim.cpp.o
[ 56%] Building CXX object src/lib/CMakeFiles/Kriging.dir/Kriging.cpp.o
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:448:10: warning: unused variable 'll' [-Wunused-variable]
  double ll = logLikelihood(_theta, &grad, nullptr, &okm_data);
         ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:461:10: warning: unused variable 'll' [-Wunused-variable]
  double ll = logLikelihood(_theta, &grad, &hess, &okm_data);
         ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:607:10: warning: unused variable 'loo' [-Wunused-variable]
  double loo = leaveOneOut(_theta, &grad, &okm_data);
         ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:670:23: warning: comparison of integers of different signs: 'int' and 'const arma::uword' (aka 'const unsigned int') [-Wsign-compare]
    for (int j = 0; j < x_next.n_elem; j++) {
                    ~ ^ ~~~~~~~~~~~~~
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:734:79: warning: unused parameter 'hess_out' [-Wunused-parameter]
    fit_ofn = [this](const arma::vec& _theta, arma::vec* grad_out, arma::mat* hess_out, Kriging::OKModel* okm_data) {
                                                                              ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:796:12: warning: unused variable 'minus_ll_tmp' [-Wunused-variable]
    double minus_ll_tmp = fit_ofn(m_theta, nullptr, nullptr, &okm_data);
           ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:830:23: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
          [&okm_data, this, fit_ofn](const arma::vec& vals_inp, arma::vec* grad_out, void*) -> double {
                    ~~^~~~
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:828:12: warning: unused variable 'bfgs_ok' [-Wunused-variable]
      bool bfgs_ok = optim::lbfgs(
           ^
/Users/pascal/haveneer/libKriging.perso/src/lib/Kriging.cpp:873:23: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
          [&okm_data, this, fit_ofn](const arma::vec& vals_inp, arma::vec* grad_out, arma::mat* hess_out) -> double {
                    ~~^~~~
9 warnings generated.
[ 62%] Building CXX object src/lib/CMakeFiles/Kriging.dir/Bench.cpp.o
[ 68%] Linking CXX shared library libKriging.dylib
ld: warning: dylib (/usr/local/lib/libarpack.dylib) was built for newer macOS version (10.15) than being linked (10.13)
[ 68%] Built target Kriging
Scanning dependencies of target pylibkriging
[ 75%] Building CXX object bindings/Python/CMakeFiles/pylibkriging.dir/src/pylibkirging.cpp.o
In file included from /Users/pascal/haveneer/libKriging.perso/bindings/Python/src/pylibkirging.cpp:1:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:44:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/attr.h:13:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/cast.h:16:
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/detail/internals.h:263:9: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
        PyEval_InitThreads();
        ^
/usr/local/Cellar/[email protected]/3.9.1_1/Frameworks/Python.framework/Versions/3.9/include/python3.9/ceval.h:130:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^
/usr/local/Cellar/[email protected]/3.9.1_1/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
In file included from /Users/pascal/haveneer/libKriging.perso/bindings/Python/src/pylibkirging.cpp:1:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:44:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/attr.h:13:
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/cast.h:579:34: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.14 or newer
                        vptr = ::operator new(type->type_size,
                                 ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/cast.h:579:34: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
In file included from /Users/pascal/haveneer/libKriging.perso/bindings/Python/src/pylibkirging.cpp:9:
In file included from /Users/pascal/haveneer/libKriging.perso/bindings/Python/src/RandomGenerator.hpp:9:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma.h:1:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/arraystore.h:1:
In file included from /Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/converters.h:30:
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/utils.h:161:39: warning: unused parameter 'f' [-Wunused-parameter]
    return py::capsule(data, [](void* f) {
                                      ^
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/utils.h:147:20: warning: unused variable 'data' [-Wunused-variable]
                T* data = reinterpret_cast<T*>(f);
                   ^
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/converters.h:325:24: note: in instantiation of function template specialization 'carma::create_capsule<double>' requested here
    py::capsule base = create_capsule(data);
                       ^
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/converters.h:512:12: note: in instantiation of function template specialization 'carma::_col_to_arr<double>' requested here
    return _col_to_arr<T>(src, copy);
           ^
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/converters.h:590:31: note: in instantiation of function template specialization 'carma::to_numpy<double>' requested here
                return carma::to_numpy<T>(src).release();
                              ^
/Users/pascal/haveneer/libKriging.perso/dependencies/carma/include/carma/carma/converters.h:605:16: note: in instantiation of function template specialization 'pybind11::detail::type_caster<arma::Col<double>, void>::cast_impl<arma::Col<double>>' requested here
        return cast_impl(&src, policy, parent);
               ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/cast.h:1408:56: note: in instantiation of member function 'pybind11::detail::type_caster<arma::Col<double>, void>::cast' requested here
            reinterpret_steal<object>(make_caster<Ts>::cast(std::get<Is>(std::forward<T>(src)), policy, parent))...
                                                       ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/cast.h:1378:16: note: in instantiation of function template specialization 'pybind11::detail::tuple_caster<std::tuple, arma::Col<double>, arma::Col<double>>::cast_impl<std::__1::tuple<arma::Col<double>, arma::Col<double>>, 0, 1>' requested here
        return cast_impl(std::forward<T>(src), policy, parent, indices{});
               ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:159:39: note: in instantiation of function template specialization 'pybind11::detail::tuple_caster<std::tuple, arma::Col<double>, arma::Col<double>>::cast<std::__1::tuple<arma::Col<double>, arma::Col<double>>>' requested here
            handle result = cast_out::cast(
                                      ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:78:9: note: in instantiation of function template specialization 'pybind11::cpp_function::initialize<(lambda at /Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:78:20), std::__1::tuple<arma::Col<double>, arma::Col<double>>, LinearRegression *, const arma::Mat<double> &, pybind11::name, pybind11::is_method, pybind11::sibling>' requested here
        initialize([f](Class *c, Arg... args) -> Return { return (c->*f)(args...); },
        ^
/Users/pascal/haveneer/libKriging.perso/dependencies/pybind11/include/pybind11/pybind11.h:1111:22: note: in instantiation of function template specialization 'pybind11::cpp_function::cpp_function<std::__1::tuple<arma::Col<double>, arma::Col<double>>, LinearRegression, const arma::Mat<double> &, pybind11::name, pybind11::is_method, pybind11::sibling>' requested here
        cpp_function cf(method_adaptor<type>(std::forward<Func>(f)), name(name_), is_method(*this),
                     ^
/Users/pascal/haveneer/libKriging.perso/bindings/Python/src/pylibkirging.cpp:67:8: note: in instantiation of function template specialization 'pybind11::class_<LinearRegression>::def<std::__1::tuple<arma::Col<double>, arma::Col<double>> (LinearRegression::*)(const arma::Mat<double> &)>' requested here
      .def("predict", &LinearRegression::predict);
       ^
3 warnings and 1 error generated.
make[3]: *** [bindings/Python/CMakeFiles/pylibkriging.dir/src/pylibkirging.cpp.o] Error 1
make[2]: *** [bindings/Python/CMakeFiles/pylibkriging.dir/all] Error 2
make[1]: *** [CMakeFiles/install.lib.dir/rule] Error 2
make: *** [install.lib] Error 2

and ok on Darwin 19.6.0 x86_64 (aka macOS Catalina Version 10.15.7 - 19H2); cf joined log file.
log.txt

R 4.0.3 Ubuntu 20.04 : 'memory not mapped'

My conf:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3

What fails:

> library(rlibkriging)

Attachement du package : ‘rlibkriging’

The following object is masked from ‘package:stats’:

    predict

Warning messages:
1: impossible d'assigner RegisteredNativeSymbol pour demo_binding1 à demo_binding1 parce que demo_binding1 est déjà défini dans l'espace de noms ‘rlibkriging’ 
2: impossible d'assigner RegisteredNativeSymbol pour demo_binding2 à demo_binding2 parce que demo_binding2 est déjà défini dans l'espace de noms ‘rlibkriging’ 
> library(testthat)
> library(testthat)
> 
> f <- function(X) apply(X, 1, function(x) sum(x^2))
> n <- 100
> set.seed(123)
> X <- cbind(runif(n),runif(n),runif(n))
> y <- f(X)
> 
> xx <- seq(0.01, 1,, 11)
> times <- list(R_ll=rep(NA, length(xx)), R_gll=rep(NA, length(xx)), cpp_ll=rep(NA, length(xx)), cpp_gll=rep(NA, length(xx)))
> 
> 
> k <- DiceKriging::km(design=X, response=y, covtype = "gauss")

optimisation start
------------------
* estimation method   : MLE 
* optimisation method : BFGS 
* analytical gradient : used
* trend model : ~1
* covariance model : 
  - type :  gauss 
  - nugget : NO
  - parameters lower bounds :  1e-10 1e-10 1e-10 
  - parameters upper bounds :  1.98729 1.950348 1.951679 
  - best initial criterion value(s) :  653.4981 

N = 3, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate     0  f=       -653.5  |proj g|=      0.75139
At iterate     1  f =      -768.47  |proj g|=             0

iterations 1
function evaluations 2
segments explored during Cauchy searches 3
BFGS updates skipped 0
active bounds at final generalized Cauchy point 3
norm of the final projected gradient 0
final function value -768.466

F = -768.466
final  value -768.466404 
converged
> i <- 1
> for (x in xx){
+   envx <- new.env()
+   times$R_ll[i]=system.time(llx <- DiceKriging::logLikFun(rep(x,3),k,envx))
+   times$R_gll[i]=system.time(gllx <- DiceKriging::logLikGrad(rep(x,3),k,envx))
+   i <- i+1
+ }
There were 22 warnings (use warnings() to see them)
> 
> r <- ordinary_kriging(y, X, "gauss")

 *** caught segfault ***
address 0x7f4e00000000, cause 'memory not mapped'

Traceback:
 1: ordinary_kriging(y, X, "gauss")

Missing DLLs inside Python (≤3.7) package for Windows

3 missing DLLs must be shipped in addition to the python package, cf:

NB: On windows, it should require extra DLL not (yet) embedded in the python package.
To load them into Python's search PATH, use:

import os
os.environ['PATH'] = 'c:\\Users\\User\\Path\\to\\dlls' + os.pathsep + os.environ['PATH']
import pylibkriging as lk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.