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.
-
Install Required Software
- git
- Visual Studio 2019 (with C++), MonoDevelop, or JetBrains Rider
-
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
-
Build liblcm
- cd into the directory of the cloned liblcm repository.
On Windows:
- Run the appropriate
vsvars*.bat
. Alternatively,LCM.sln
can be built from within Visual Studio. - Run
build.cmd
to build the liblcm library.
On Linux:
- Run
build.sh
to build the liblcm library.
By default, this will build liblcm in the Debug configuration. To build with a different configuration, use:
build.(cmd|sh) (Debug|Release)
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
build /t:pack
will pack nuget packages and publish them toLOCAL_NUGET_REPO
Open the solution in Rider and run them all there. Right-click the solution and choose "Run Unit Tests".
-
Install
NUnit.ConsoleRunner
-
then run (adjust the version number
3.11.1
accordingly):(. environ && cd artifacts/Debug/net461/ && mono --debug ~/.nuget/packages/nunit.consolerunner/3.11.1/tools/nunit3-console.exe *Tests.dll )
Open the solution in Visual Studio and run them all there. Right-click the solution and choose "Run Unit Tests".
To run the tests for a single test dll:
-
Go to the
liblcm
directory. -
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. -
Go to the
liblcm\artifacts\Debug\net461
directory. -
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
) -
To debug the tests from Visual Studio: Immediately after the tests have started running "Attach to Process..." and select
nunit-agent.exe
.