Skip to content
sillsdevPublic

Repository files navigation

LCModel Library

Description

The library for the SIL Language and Culture Model.

The liblcm library is the core FieldWorks model for linguistic analyses of languages. Tools in this library provide the ability to store and interact with language and culture data, including anthropological, text corpus, and linguistics data.

Instructions

  1. Install Required Software

    • git
    • On Windows, Visual Studio 2022 with the "Desktop development with C++" workload. The C++ build tools are required for any Windows build, not only for building inside the IDE: code generation preprocesses the IDL with cl.exe.
    • JetBrains Rider or MonoDevelop, if you prefer another IDE
  2. Clone the liblcm repository

    • Open a terminal (or git bash on Windows) and cd into a desired directory.
    • Run git clone https://github.com/sillsdev/liblcm.git
  3. Build liblcm

    • cd into the directory of the cloned liblcm repository.

    On Windows:

    • Run dotnet build -m:1 to build the liblcm library. Alternatively, LCM.sln can be built from within Visual Studio.

    On Linux:

    • Source environ, then run dotnet build -m:1 to build the liblcm library.

Use -m:1 for a cold-start build (a fresh clone or worktree, with no generated sources yet). Parallel builds race on the generated sources. Plain dotnet build is fine once those sources exist.

By default, this will build liblcm in the Debug configuration. To build with a different configuration, use:

dotnet build -m:1 --configuration (Debug|Release)

Debugging

The LCModel library consumes multiple libpalaso files as NuGet packages. FieldWorks and other projects consume LCModel as a NuGet package. Several options to debug across NuGet dependencies are discussed on this wiki. To publish and consume LCModel through local sources:

  • Set an environment variable LOCAL_NUGET_REPO with the path to a folder on your computer (or local network) to publish locally-built packages
  • See these instructions to enable local package sources
  • dotnet pack will pack nuget packages and publish them to LOCAL_NUGET_REPO

Tests

Linux

In JetBrains Rider

Open the solution in Rider and run them all there. Right-click the solution and choose "Run Unit Tests".

In a terminal

  • Install NUnit.ConsoleRunner

  • then run (adjust the version number 3.11.1 accordingly):

     (. environ && cd artifacts/Debug/net462/ && mono --debug ~/.nuget/packages/nunit.consolerunner/3.11.1/tools/nunit3-console.exe *Tests.dll )

Windows

With ReSharper

Open the solution in Visual Studio and run them all there. Right-click the solution and choose "Run Unit Tests".

Without ReSharper

To run the tests for a single test dll:

  1. Go to the liblcm directory.

  2. Execute: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe"

    Note: Running the tests after building the solution from inside VS resulted in a BadImageFormatException. Running the tests after building from the cmd prompt worked.

  3. Go to the liblcm\artifacts\Debug\net462 directory.

  4. Execute: ..\..\..\packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe SIL.LCModel.Tests.dll

    (Or specify one of the other SIL.LCModel*Tests.dll)

  5. To debug the tests from Visual Studio: Immediately after the tests have started running "Attach to Process..." and select nunit-agent.exe.

Releases

Sponsor this project

Packages

Used by

Contributors

Languages