hughperkins / DeepCL

OpenCL library to train deep convolutional neural networks
Mozilla Public License 2.0
867 stars 199 forks source link

CMake config file and manifest txt loading #27

Closed Maggeych closed 8 years ago

Maggeych commented 8 years ago

In order to link against DeepCL using cmake's find_package function I added the generation of a cmake config file. Furthermore the loader for a manifest txt file was not enabled even though BUILD_JPEG_SUPPORT was set to ON. To enable manifests as input to deepcl_predict I changed the loader to GenericLoaderv2 in src/main/predict.cpp.

hughperkins commented 8 years ago

Thanks! Merged. Hmmm, just noticed, after merging, shouldnt the JPEG_AVAILABLE flag be set by the find_package(JPEG REQUIRED) line?

hughperkins commented 8 years ago

Ah. I think the find_package will only set internal cmake variables right? And then we need the add_definitions to add the #define, that can be detected within the C++ code, right? So I think that your changes seem good :-)

hughperkins commented 8 years ago

I think it might be worth merging LIBJPEG_AVAILABLE and BUILD_JPEG_SUPPORT, so we just have BUILD_JPEG_SUPPORT. Seems like they are semantically the same right? (I guess historically they might have been slightly different, but I probably removed some detection step, and now they are the same essentially).

Maggeych commented 8 years ago

Basically one could simply run find_package(JPEG) without the required flag and then use the JPEG_FOUND variable set by FindJPEG.cmake to add the define flag. But this would mean that JPEG always gets linked into DeepCL if it's installed. I think it's better to let the user choose whether to compile with JPEG support or not.

hughperkins commented 8 years ago

Yes, agree. Thank-you Maggeych.