Washington-University / CiftiLib

C++ Library for reading and writing CIFTI-2 and CIFTI-1 files
BSD 2-Clause "Simplified" License
14 stars 10 forks source link

Provide openmp flag in .pc file if used. #17

Closed kiwifb closed 5 years ago

kiwifb commented 5 years ago

When CiftiLib is compiled with openmp the resulting library will depend on openmp libraries. Which means that when you link with the libCifti you need to provide openmp libraries or instructions to link with openmp libraries.

In the case of gcc/g++ passing -fopenmp to the compiler when linking is sufficient. Alternatively you would use -lgomp. With this branch the openmp flags are added to the cflags (if openmp is not available it will be as before). If you use that cflags at linking stage (as you should) the compiler should link properly with the appropriate openmp libraries.