Skip to content

moja-global/FLINT.Module.Agricultural_Soil_Model

Repository files navigation

FLINT Agricultural Soil Module

All Contributors

Environment: Visual Studio 16 2019 Win64

Building the project

Assuming you have followed the moja flint documentation to build using the vcpkg method, the commands below should build your example project solution.

NOTE: Paths used in commands may be different on your system.

# Create a build folder under the Source folder
mkdir -p Source\build
cd Source\build

cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=C:\Development\Software\moja -DVCPKG_TARGET_TRIPLET=x64-windows -DENABLE_TESTS=OFF -DOPENSSL_ROOT_DIR=c:\Development\moja-global\vcpkg\installed\x64-windows -DCMAKE_TOOLCHAIN_FILE=c:\Development\moja-global\vcpkg\scripts\buildsystems\vcpkg.cmake ..

Important: You need to set the correct path to GDAL library in libs.base_agri.win.json file in

FLINT.Module.Agricultural_Soil_Model/Run_Env/config/

{
    "Libraries": {
    	"moja.modules.gdal": {
            "library": "moja.modules.gdald.dll",
	     "path": "C:/Users/sulay/Desktop/moja-global/FLINT/Source/build/bin/Debug",
            "type": "external"
        },

Change "path": "C:/Users/sulay/Desktop/moja-global/FLINT/Source/build/bin/Debug", to the path where FLINT is installed and GDAL is built. For example if FLINT is installed in C:/Development/moja-global/FLINT, then the path for GDAL will be C:/Development/moja-global/FLINT/Source/build/bin/Debug

For example the libs.base_agri.win.json file should look like this :

{
   "Libraries": {
   	"moja.modules.gdal": {
           "library": "moja.modules.gdald.dll",
   		"path": "C:/Development/moja-global/FLINT/Source/build/bin/Debug",
           "type": "external"
       },
       "moja.flint.example.agri": {
           "library": "moja.flint.example.agrid.dll",
           "path": "%LOCAL_LIBS%",
           "type": "external"
       }
   }
}

Running the project

Running in the IDE and debugging is a little tricky. This could more than likely be resolved with better cmake setups. But for now there is some setup that can make running and debugging work.

The issue is we want to run with the moja.cli.exe from the moja.FLINT project, but debug in our current IDE (FLINT.example).

The solution is to use properties to setup a Debug run in the IDE, making the command run moja.cli.exe.

NOTE : All paths used below with C:\Development\moja-global will need to be modified to match your system build location of the moja project.

Test Module Example

The settings required in VS2019 are:

# Command
C:\Development\moja-global\FLINT\Source\build\bin\Debug\moja.cli.exe

# Command Args for point example
--config config\agri_point.json --config config\libs.base_agri.win.json  --logging_config logging.debug_on.conf --config_provider config\provider_agri.json
 
# Command Args for spatial example
--config config\agri_config.json --config config\libs.base_agri.win.json  --logging_config config\logging.debug_on.conf --config_provider config\provider_agri.json

# Working Directory
..\..\..\Run_Env

# Environment
PATH=C:\Development\moja-global\vcpkg\installed\x64-windows\debug\bin;C:\Development\moja-global\FLINT\Source\build\bin\Debug;%PATH%
LOCAL_LIBS=$(OutDir)

With Envs: PATH for various libraries built in the Moja stage and LOCAL_LIBS so we can modify the explicit path for our example config to load libraries from this vs build (the default is the same location as the EXE).

To match this, the example point config uses an environment variable in the library path:

{
  "Libraries": {
    "moja.flint.example.base": {
      "library": "moja.flint.example.agrid.dll",
      "path": "%LOCAL_LIBS%",
      "type": "external"
    }
  }
}

How to Get Involved?

moja global welcomes a wide range of contributions as explained in Contributing document and in the About moja-global Wiki.

FAQ and Other Questions

Contributors

Thanks goes to these wonderful people (emoji key):


Sulay Shah

💻

James Leitch

👀

This project follows the all-contributors specification. Contributions of any kind welcome!

Maintainers Reviewers Ambassadors Coaches

The following people are Maintainers Reviewers Ambassadors or Coaches


Sulay Shah

💻

James Leitch

💻

Maintainers review and accept proposed changes
Reviewers check proposed changes before they go to the Maintainers
Ambassadors are available to provide training related to this repository
Coaches are available to provide information to new contributors to this repository

About

Code repository for FLINT agricultural soils module.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published