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 ..
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 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.
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"
}
}
}
moja global welcomes a wide range of contributions as explained in Contributing document and in the About moja-global Wiki.
- You can find FAQs on the Wiki.
- If you have a question about the code, submit user feedback in the relevant repository
- If you have a general question about a project or repository or moja global, join moja global and
- submit a discussion to the project, repository or moja global team
- submit a message to the relevant channel on moja global's Slack workspace.
- If you have other questions, please write to [email protected]
Thanks goes to these wonderful people (emoji key):
Sulay Shah 💻 |
James Leitch 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!
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