Skip to content

about build

Kohei Noda edited this page Feb 8, 2024 · 12 revisions

About Build

  • Use CMake to build.
  • The build command must be executed in the top directory of this program (1 level above the src directory and test directory)!!!

How to build

  • 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

Debug options

  • 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

How to search build options

  • 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