Revised TREX watershed model, source code from CSU.
- CMake2.8+
- Windows:
- Microsoft Visual Studio 2010+
- or CLion and mingw64 4.8+
- Linux/macOS:
- GCC 4.8+
- clang
- icc
-
common commands
cd <path to TREX> mkdir build cmake .. make && make install
Take VS2013 as an example.
- Open "Intel compiler 17.0 Update 4 Intel(R) 64 Visual Studio 2013" from start menu.
- cd to the compile destination folder. e.g.,
cd D:/compile/trex - Run
cmake <path to TREX src path>. e.g.,cmake C:\z_code\Hydro\TREX- Compile 64-bit version:
cmake -G "Visual Studio 12 2013 Win64" C:\z_code\Hydro\TREX
- Compile 64-bit version:
- Open the project
TREX20110210.sln, and do what you want!
If you prefer the command line, the common commands above should be OK.
However, if you want a user-friendly IDE for to learn and improve the TREX model, I recommend the cross-platform IDE CLion.
CLion use CMake to manage projects. Under Windows, you may also install mingw64 (or mingw) for the GCC compiler.
Using CLion is quite easy and intuitive. Just open the TREX path from File -> Open.... Then CLion will automatically load the project by CMakeLists.txt existed in TREX directory. Now, you can build TREX model by typing Ctrl+F9 or clicking the build button.
In order to make it easier to track code changes and keep up with newer revisions, I use subtree to manage the TREX source code from CSU.
-
Set subtree as
trex_src(only do once at the very beginning of this repository)git remote add -f trex_src [email protected]:crazyzlj/trex_src_csu.git git subtree add --prefix=trex_src trex_src master --squash
-
Do any modification to the
trex_srcto meet our specific needs. -
If the TREX source is updated we should pull the latest code from trex_src_csu and merge it.
git fetch trex_src master git subtree pull --prefix=trex_src trex_src master --squash
-
05/18/2018: Update the source code to version 101017.
-
10/12/2017: initial by the source code updated in 2/10/2011.