-
Notifications
You must be signed in to change notification settings - Fork 0
about build
Kohei Noda edited this page Feb 8, 2024
·
12 revisions
- Use CMake to build.
- Default build settings and build option separation processing are written in CMakeLists.txt.
- If you want to add settings, it is recommended to refer to the CMake official documentation.
- The build command must be executed in the top directory of this program (1 level above the src directory and test directory)!!!
-
You need to build all files by running the setup script when you compile for the first time, change build options, or change compilers.
./setup --build --fc ifort -j 4
-
You can use the following command to build only the changed files.
- You can use this method only when you don't change the build options.
cmake --build build
-
You must run tests after building.
- For more information about tests, see About test.
pytest --all
- Debugging is the process of fixing bugs in a program.
- Compilers provide useful features for debugging when you add options at compile time, although execution speed is reduced.
- Therefore, it is recommended to add debug options during development.
- If you want to add debug options, set the --build-type option to "debug" in the setup script.
./setup --build --build-type=debug -j 4
- You can confirm the options added by --build-type=debug by looking at the value of CMAKE_Fortran_FLAGS_DEBUG in the CMakeLists.txt.
- If you want to add additional options, use the --flags option in the setup script.
./setup --build --build-type=debug --flags="additional debug options" -j 4
- You can check the compiler build options by the following command.
# Intel(R) Fortran
man ifort
# Intel(R) new Fortran compiler
man ifx
# GNU Fortran
man gfortran
- Also, you can check information about the compiler by the following URL.
- If you use Intel(R) Fortran
- If you use GNU Fortran