Chapter 3.1 : Example with full libraries generation
Once the :
1 |
find_package(PhoenixHPCProxy REQUIRED) |
1 2 3 4 5 6 7 |
set(HADAMARD_PRODUCT_BASE_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/hadamard_product.cpp) phoenix_hpc_proxy_full( NAME hadamard_product_cmake_perf HEADER ${CMAKE_CURRENT_SOURCE_DIR}/hadamard_product.h SRCS ${HADAMARD_PRODUCT_BASE_SOURCE} OPTIMISATION_OPT "-O3" LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib) |
Parameters are :
- NAME : name of the target to be generated
- OPTIMISATION_OPT : main option to be passed to the compiled libraries (-O2, -O3, -Ofast, etc)
- EXTRA_OPTION : extra option of the compilation (-Wall, -Werror, -DSOME_MACRO=someValue, etc)
- HEADER : list of headers of the libraries to be created
- SRCS : list of source of the libraries to be created
- WORKING_DIRECTORY : directory in which to call phoenix_hpc_proxy
- LIB_DIR : directory in which to search libraries for sub architectures. So we set it to the CMAKE_INSTALL_PREFIX/lib so the installed libraries will be found during the excution of the installed program
It is important to specify the hreader(s) you want to expose in your proxy. I has to contain only prototypes of non template function. It is totally normal because we want to specify them for different architectures.
Note : for now you have to choose between CMAKE_INSTALL_PREFIX/lib and CMAKE_CURRENT_BINARY_DIR depending if you wan to execute your program only in the install directory or in the build directory. The option to specify multiple libraries directories will be added at some point, but it is not avalaible now.