RsNLME Installation and Configuration Troubleshooting Guide
troubleshooting.RmdInstallation Errors/Warnings in R
ERROR: compilation failed for package ‘…’
You may also see the additional error:
c:/rtools40/mingw32/bin/g++: No such file or directory
This error can occur when installing a package dependency from source. R will always attempt to install the Windows binaries first (for Windows users), but in some cases, the binaries on CRAN may have version older than the source files.
In such cases, R will prompt you with a message -
“Do you want to install from source the packages which need compilation?”
The correct option is to click No. Clicking
Yes may require the additional installation of RTools to
install the package successfully, if that package dependency must be
compiled from source.
Note: For non-recent R versions CRAN removes binaries from the server and the only way to install the dependent package is to install it from source.
Warning in install.packages:
Warning in install.packages :
package ‘Certara.RSNLME’ is not available for this version of R
If you have confirmed that R >= 4.0 is installed (use
the command R.Version() to check) and still receive this
error, ensure that the name of the package is specified correctly.
Note: Package names are case-sensitive.
Warning in install.packages :
unable to access index for repository https://certara.jfrog.io/artifactory/certara-cran-release-public/bin/windows/contrib/4.4
This warning implies that the R package binaries for the given OS are unavailable and can be ignored. R will subsequently install the packages from source successfully.
WARNING: RTools is required …
RTools is required to build R packages and/or compile libraries from source on Windows, however, the installation of RTools is NOT required to use RsNLME.
If this warning is received, and the packages were not successfully installed:
Option 1: Check R Library Path
Execute the following command to check the location of R libraries:
Note: If your R Library path is located on a network drive e.g., OneDrive, you may experience issues installing R packages. The solution is to create a local folder for your R libraries. Click here to learn more.
Option 2: Install missing package separately
If you’re still unable to install one or more
Certara_Packages, even after confirming that your R library
path isn’t on a network drive, the problem is likely indicated by an
error message in your R console.
Example Error Messages:
or
Troubleshooting Steps:
Restart R: To ensure a clean slate, restart your R session. This will unload all currently loaded packages.
Install the Package Directly: Try installing the problematic package (e.g., “rlang”) on its own using the following command in R:
install.packages("rlang") -
Reboot and Manually Remove: If the direct
installation still fails:
- Reboot your system.
- Find the package’s folder within your R library directory (you can
find this directory using the
.libPaths()command in R). - Delete the package’s folder manually.
- Attempt to reinstall the package.
Note: These troubleshooting steps focus on resolving issues with individual package installations. If you continue to encounter difficulties, please contact Certara support for further assistance.
Then proceed with the installation
of Certara_Packages.
Installation Help for NLME Engine
The NLME Engine installer for Windows will automatically install and configure the following components:
- MS MPI 10.0
- GCC 8.4
- NLME Engine 26.9.1
What if I have some components previously installed?
If you have an existing Phoenix installation, you may receive a message stating that GCC and/or MPI is already installed and configured on your system.
If the installer detects that these components are already installed, you will be prompted to skip the installation of these components.
vcruntime140_1.dll not found
DLLs (Dynamic-Link Libraries) are shared libraries in Microsoft Windows, implemented by Microsoft Corporation, and used by the NLME Engine for model execution. If you receive an error such as “vcruntime140_1.dll Not Found”, the file may be corrupted or missing from your system.
The solution is to download the Microsoft Visual C++ Redistributable packages for Visual Studio 2015, 2017, 2019, and 2022 here, installing both X86 and X64 Architecture.
Note: You will be required to restart your computer after installing Microsoft C++ Redistributable Packages
Check environment variables
To ensure that all components have been installed successfully, open a new session of R/RStudio and execute the following:
Sys.getenv("INSTALLDIR") # NLME Engine path
Sys.getenv("NLMEGCCDir64") # GCC path
Sys.getenv("PhoenixMSMPIDir") # MSMPI path if MSMPI was installedIf the NLME Engine installation has been successful, the above system paths should be returned.
Note: If GCC and/or MSMPI was installed by Phoenix and not using
the NLME Engine installer, Sys.getenv("NLMEGCCDir64") and
Sys.getenv("PhoenixMSMPIDir") will return a different
folder - e.g., ‘“C:\PHSTMinGW64”’ and
"C:\\Program Files (x86)\\Certara\\MPI\\". They could be
used as well.
To ensure that all components have been installed successfully, open a new session of R/RStudio and execute the following:
Sys.getenv("INSTALLDIR") # NLME Engine path
Sys.getenv("PhoenixMPIDir64") # OpenMPI path if OpenMPI was installedIf the NLME Engine installation has been successful, the above system paths should be returned.
To ensure that all components have been installed successfully, open a new session of R/RStudio and execute the following:
Sys.getenv("INSTALLDIR") # NLME Engine path
Sys.getenv("PML_BIN_DIR") # Enables access to libraries compiled specifically for Ubuntu 22.04
Sys.getenv("PhoenixMPIDir64") # OpenMPI path if OpenMPI was installedIf the NLME Engine installation has been successful, the above system paths should be returned.
MCP server setup troubleshooting
The optional Certara MCP server exposes RsNLME to AI coding agents (Cursor, Claude Code, Codex, and Claude Desktop). Setup friction here is largely an environment problem – the table below collects the common failures and the fix.
For the full setup and usage guide (supported clients, tool profiles,
live-session tools, and Claude Desktop on Windows), see the Certara
MCP Server: Setup and Usage vignette. The same checklist is
available to agents through the knowledge base
(Certara.R.mcp.setup_troubleshooting).
| Symptom | Likely cause | What to try |
|---|---|---|
| MCP tools missing / server not listed |
write_mcp_config() not run, or the client was not
reloaded |
Run
Certara.R::write_mcp_config(client = "cursor", scope = "project");
reload the client; in Cursor, Settings -> Tools &
MCPs and enable the Certara R server |
ellmer / mcptools / btw not
found |
A development install with repos = NULL skips
Suggests
|
Install from the release repository, or install the MCP stack
directly: install.packages(c("btw", "mcptools", "ellmer")).
Version floors: btw >= 1.2.0,
mcptools >= 0.2.0, ellmer >= 0.4.0
|
| Cursor “tool not found” when calling the server | Using the mcp.json key instead of the
CallMcpTool id |
Cursor prefixes user servers with user-,
e.g. user-certara-r; check client_routing in
certara_mcp_capabilities()
|
| Fit/VPC “can’t find the model” | Confusing the MCP server’s R process with an interactive session, or acting on the wrong model | Call certara_session_status() to see which R process
holds state; confirm which fit to use and enumerate runs with
list_mcp_runs()
|
| Engine / compile failures (RStudio / terminal) |
INSTALLDIR / NLME not resolvable |
Confirm the NLME Engine install and that
Sys.getenv("INSTALLDIR") is set (see the
environment-variable checks above) |
MCP-launched fit fails with Compile/Link Failed on
Claude Desktop (Windows), but the same model fits from RStudio |
Claude Desktop sanitizes the MCP server’s environment, dropping
ComSpec, INSTALLDIR, and
NLMEGCCDir64
|
Add those variables to the env block of
claude_desktop_config.json (see below), then fully quit and
relaunch Claude Desktop |
| Agent behavior feels out of date | The installed package predates the current MCP knowledge base/rules | Install the current release and call
certara_mcp_capabilities() to confirm the advertised
rules |
| Too many tools listed | Normal when btw tool groups are enabled |
Use the workflow phases in
certara_mcp_capabilities()$workflows; for the leanest
server set btw_groups = "docs"
|
# Re-write the client configuration and confirm the live wiring
Certara.R::write_mcp_config(client = "cursor", scope = "project")
Certara.R::certara_session_status()Claude Desktop on Windows: extra environment variables
Claude Desktop launches MCP servers with a sanitized, minimal
environment. On Windows that snapshot is inherited by every
MCP-launched NLME fit, so variables that are set in RStudio or a
terminal never reach TDL5/gcc. The usual symptom is
Compile/Link Failed /
ERROR in generating Model.cpp even though the same model
fits from RStudio.
Add an env block to the certara-r server in
claude_desktop_config.json with at least:
-
ComSpec–C:\WINDOWS\system32\cmd.exe(this is the one that unblocksCompile/Link Failed) -
INSTALLDIR– NLME Engine install directory -
NLMEGCCDir64– Certara-shipped GCC 8.4 -
TMP,NUMBER_OF_PROCESSORS, andPATHEXT(commonly dropped as well)
Then fully quit Claude Desktop (system tray -> Quit, not just
closing the window) and relaunch. A sample env block, the
MSIX config-path gotcha, and a diagnostic job are in Claude
Desktop on Windows: required environment variables.
Claude Code (CLI) generally does not need this – a terminal-launched server inherits the shell environment.
There is no automated “doctor” command - setup spans the client, the
R environment, and the engine install, so the checklist above (and
certara_session_status() for the live wiring) is the
supported path.
FAQ
Do existing Phoenix users need to install the NLME Engine?
Yes. Certara.RsNLME version 3.2.0 requires
NLME-Engine-26.9.1. Existing Phoenix users must install the
NLME-Engine executable, separate from NLME-Engine that is embedded in
Phoenix application.
Note: Phoenix NLME-Engine is kept in a separate location and
installing NLME-Engine-26.9.1 will not affect your existing
Phoenix installation.
Is the Certara.NLME8 R package distributed in a Phoenix release compatible with RsNLME?
It is recommended to maintain a distinct R version (or separate R
library) that ensures the version of the Certara.NLME8
package that you installed (given the installation instructions provided
in your version of Phoenix) is not automatically updated when installing
Certara.RsNLME.