FLAGR can be compiled as a standard console application, or as a shared/dynamic link library.
Building FLAGR as a standard console application
In Linux platforms GCC can be used to compile cflagr.cpp as follows:
g++ -Wall -std=gnu++11 -O3 -std=gnu++11 -Isrc/ -c /path/to/cflagr/cflagr.cpp -o /path/to/obj/flagr.o g++ -o /path/to/out/FLAGR obj/Release/cflagr.o -O3 -s
For Windows-based systems, MingW can be used in a similar way:
g++ -Wall -std=gnu++11 -O3 -std=gnu++11 -Isrc\ -c /path/to/cflagr/cflagr.cpp -o /path/to/obj/flagr.o g++ -o /path/to/out/FLAGR.exe /path/to/obj/cflagr.o -O3 -s
Building FLAGR as a shared library or a dynamic link library
At first, please notice that the GitHub repository of FLAGR already contains fully-functional pre-built shared and dynamic link libraries which have been created and tested with the GCC compiler. Both of them are located in the pyflagr/pyflagr directory and can be used immediately in 3rd party applications (do not forget to also include the required dependencies).
In cases where a manual build is required (e.g. you have implemented your own rank aggregation or evaluation method), GCC can be used with the -shared flag as follows:
g++ -O3 -Wall -Werror -shared -std=c++11 -fPIC /path/to/cflagr/cflagr.cpp -o /path/to/so/flagr.so
This command will generate the necessary .so Linux shared library.
For Windows-based systems with the GCC compiler, FLAGR can be built as a Dynamic Link Library by invoking the following system commands:
g++ -O3 -c -o flagr.o /path/to/cflagr/dllflagr.cpp g++ -O3 -o /path/to/dll/flagr.dll -s -shared flagr.o -Wl,--subsystem,windows
This command will generate the necessary .dll library. An automated procedure for compiling FLAGR as a DLL can be executed from the makedll.bat batch file included in the GitHub repository. Please make sure that you have specified the correct file locations in makedll.bat before executing it.
