Skip to content

Installation

Ivan Svetunkov edited this page Apr 9, 2026 · 6 revisions

Installation

R

Installing from CRAN (Stable)

install.packages("smooth")

Installing from GitHub (Development)

if (!require("remotes")) install.packages("remotes")
remotes::install_github("config-i1/smooth")

Dependencies

Depends:

  • R >= 3.0.2
  • greybox >= 2.0.2

Imports:

  • Rcpp, nloptr, zoo, pracma, statmod, MASS, xtable, generics, stats, graphics, methods

LinkingTo:

  • Rcpp >= 0.12.3
  • RcppArmadillo >= 0.8.100.0.0

System Requirements

Linux: No special requirements; BLAS/LAPACK typically pre-installed.

macOS: gfortran is required. Install via:

# Using Homebrew
brew install gcc

# Or download from CRAN
# https://mac.r-project.org/tools/

See thecoatlessprofessor.com for detailed macOS instructions.

Windows: Standard R build tools (Rtools) should be sufficient.

Troubleshooting

Functions Stop Working After Upgrade

Sometimes after upgrading smooth, C++ functions are cached incorrectly. Solutions:

  1. Restart R session
  2. If that doesn't work:
    remove.packages("smooth")
    # Delete the "smooth" folder from R packages directory
    # Restart R
    install.packages("smooth")

macOS Compilation Errors

If you see errors about -lgfortran or -lquadmath:

  1. Install gfortran from CRAN tools or via Homebrew
  2. Ensure gfortran is in your PATH
  3. Restart R and retry installation

Verifying Installation

library(smooth)
packageVersion("smooth")

# Test basic functionality
data <- rnorm(100)
model <- adam(data, model="ANN")
print(model)

Python

Installing from PyPI (Stable)

pip install smooth

Installing from Source (Development)

Important: This package includes C++ extensions that require compilation. You must have a C++ compiler, CMake, and Armadillo installed before running pip install. See System Requirements below.

pip install "git+https://github.com/config-i1/smooth.git@master#subdirectory=python"

Dependencies

Python Version:

  • Python >= 3.10

Runtime Dependencies:

  • numpy
  • pandas
  • scipy
  • nlopt
  • statsmodels
  • pybind11

Build Dependencies:

  • cmake >= 3.25
  • scikit-build-core
  • ninja

C++ Compiler:

  • Linux: g++ (usually pre-installed, or sudo apt install g++)
  • macOS: Xcode Command Line Tools (xcode-select --install)
  • Windows: Visual Studio Build Tools with C++ workload

System Requirements

Linux (Debian/Ubuntu):

sudo apt update
sudo apt install libblas-dev liblapack-dev libarmadillo-dev cmake ninja-build

Linux (Fedora/RHEL):

sudo dnf install blas-devel lapack-devel armadillo-devel cmake ninja-build

macOS:

brew install armadillo cmake ninja

Windows: Install Visual Studio Build Tools with C++ workload.

Troubleshooting

Missing nlopt

If you get import errors about nlopt:

pip install nlopt

On some systems, you may need the system nlopt library:

# Debian/Ubuntu
sudo apt install libnlopt-dev

# macOS
brew install nlopt

Armadillo Not Found

If compilation fails with Armadillo errors:

  1. Install Armadillo development headers (see System Requirements)
  2. Ensure CMake can find Armadillo:
    pkg-config --cflags --libs armadillo

Verifying Installation

import smooth
print(smooth.__version__)

# Test basic functionality
import numpy as np
from smooth import ADAM

data = np.random.randn(100)
model = ADAM(model="ANN")
model.fit(data)
print(model.summary())

Clone this wiki locally