Quick Start
This tool has been compiled and tested on Windows (win64), Linux (amd64), and macOS(amd64). Using any other architecture, is not guaranteed to work.
Download#
To run Comfor you can download the binaries from the release page or you can build it from source. For download the binary for your architecture and follow the instructions given here and run some test.
To build Comfor from sources you will need to download an compile the code. If so, follow these instructions.
Build from sources#
Prerequisites#
CMake : a cross-platform, open-source build system generator. Allows to generate a project for a given IDE (Unix Makefiles, Xcode, Eclipse, etc...) or compilation rules for Comfor. It can be easily installed under linux with the following command:
On MacOS using brew:
Binaries files for Mac OS and Windows can be downloaded at cmake.org
C++ Compiler
Comfor is written in C++ and it needs at least a c++ compiler that support C++ 17 language features.
Examples:
- gcc >= 9
- clang libc++ >=7
- Apple clang >= 11.0.0
- MSVC >= 2015
Under Ubuntu 18.04/20.04, you can use gcc this can be installed with the following command:
Under Mac OS verify if the Clang compiler is already installed.
If you want to install or update the Clang compilers, enter the command:
Under Windows you can use a POSIX environnement like MSYS2 or Mingw or Mysys. Since version 0.2.1.
Note
Comfor is compatible with Microsoft C++ compilers (Tested using Visual C++ 2019 ).
Warning
Mingw32 is not fully compatible with google-test, a popular library to build unit an integration test (see issue 2418). You can compile Comfor but you cannot build the binary files for the test cases.
Python
Note
This is only useful for testing and documentation.
Python modules are used to generate the documentation and charts during testing . Make sure that python and the following packages are installed.
- Charts: Matplotlib
- This site: Mkdocs
To install, make sure that Python 3 is installed:
And install the packages using pip
Warning
On windows comfor is currently working by installing the standalone Python 3.8.7 distribution. Anaconda is not yet supported. Make sure that python and pip are on the path.
Clone#
Clone or download the sources from the main repo. If you are not familiarized with Git, check the (Cheat Sheet)
Compile#
Using make#
Make sure that make is installed on your machine make --version, this is usually the case for macOS and Linux after install the developer tools. If you are not sure, use the cross platform proposition.
The compilation rules are generated by Cmake using the CMakeList.txt file included in the projet. A good habit is to encapsulate all the intermediate files generated by Cmake in a single folder (the build). Cmake identifies the architecture, the compiler version and generate the projet (a make file by default under Unix). Finally, make generate the binary according to the compilation rules.
The binary files are on the Bin/Release folder.
Tip
Cmake can generate the project for different IDE (Eclipse, Xcode, Visual code..). In the previous example we assume that the default generator is Unix MakeFiles. You can specify generator using cmake .. -G <generator_name>. To see the available list of generators for your case use: cmake -G
Cross platform proposition#
If you are having troubles compiling the code you can use visual code. Visual code, provides a GUI support and different extension to automatize th compilation process. To configure Visual click here.
Run and test#
You should now have a nice binary file called Comfor. To run comfor you can specify the name of the input file, or run comfor directly, comfor will prompt you for the path to the input file.
Run it#
Run one of the provided samples in Examples folder using the following the following command. Or download some other test from the download page
Test it#
In addition to the main binary file, Cmake also generates a series of executables called *Test.o/exe. These files allow to launch a test to see if the different comfor modules are working correctly. You can execute directly this files.
Example:
Expected result :
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from TabularTest
[ RUN ] TabularTest.parseOne
[ OK ] TabularTest.parseOne (0 ms)
[ RUN ] TabularTest.parseSeveral
.
.
.
[ OK ] TabularTest.parseFile (2 ms)
[----------] 5 tests from TabularTest (2 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (3 ms total)
[ PASSED ] 5 tests.
If some test fails, please feel free to contact us.
Postprocessing#
Comfor can generate VTK files for the results. Paraview post-processor can be used to visualize those results. Paraview is available at paraview.com