Build from Source

This file is autogenerated from README in DataSailrToolchain Github

This file describes the toolchain to build DataSailr from source. The toolchain can be obtained from DataSailrToolchain Github.

The following command clones the git repository, which provides build instructions, create_datasailr_pkg.sh and create_package.sh.

git clone https://github.com/niceume/datasailr_toolchain.git

Purpose

  1. This datasailr_toolchain repository provides toolchain for building a developing version of datasailr CRAN package by yourself.
  2. If you need to modify or develop DataSailr package, it is recommended to work in this repository's framework
    • Modifying DataSailr package usually means modifying DataSailr part (mapping R data to C and converting the result of libsailr calculation to R data ) and/or modifying libsailr part (Sailr script parsing and its execution for values of each row that come from R)
    • These two codes are placed under base/ directory (once after executing "./create_datasailr_pkg.sh"), and they are simply managed under git.
      • You can freely track changes using git.
      • You can also manage them on your remote repositoriy. (In this case, please change the default remote repositories hard coded in ./create_datasailr_pkg.sh )
    • (Note) Source codes are to be combined under tmp/datasailr_pkg, but I do not recommend code modification there. Even if you modify codes there, the changes are easily discarded when you re-run ./create_datasailr_pkg.sh. Please modify source codes under base/ direcotry.
      • If you do not like what you have changed, reset using git or delete directories under base/ and re-run ./create_datasailr_pkg.sh.

How to use

There are two main shell scripts, './craete_datasailr_pkg.sh' and './create_package.sh', for building the package.

Some more scripts

Details of source modification

To publish an R package on CRAN, you need to follow strict CRAN rules. For this purpose, some additional modifications are needed.

Examples

Case 1 (Build latest package by yourself)

# git clone(pull) under base/ directory
# Put datasailr code and other library codes together under tmp/datasailr_pkg/ directory with some modification.
./create_datasailr_pkg.sh

# From tmp/datasailr_pkg, create packages under build directory (build/src_pkg and build/binary_pkg)
# Note that if building binary package succeeds, the current package is installed to your system.
./create_package.sh

Enjoy DataSailr!

Case2 (Develop or modify DataSailr by yourself)

# git clone(pull) under base/ directory
# Put datasailr code and other library codes together under tmp/datasailr_pkg/ directory with some modification.
./create_datasailr_pkg.sh
# Update tmp/datasailr_pkg without git pull under base/
./create_datasailr_pkg.sh no-git

# Try to build
./create_package.sh

If build succeeds,

  1. Make sure that tests pass
    • In R, 'datasailr::test_sail()'
  2. Make sure that Rhub does not raise warnings
    • './rhub_check cran'
    • Rhub builder provides more platforms.
  3. Make sure that valgrind does not complain
    • './valgrind_check'

Thank you very much for contributing to DataSailr package!