bakercp / ofxDlib

An openFrameworks wrapper for dlib. http://dlib.net/
MIT License
52 stars 16 forks source link

Changed the addon_config to modify includes for VS + tutorial #30

Open brinoausrino opened 5 years ago

brinoausrino commented 5 years ago

With this updates the includes for the vs project generated with the project generator are correct. The project generator still misses to include the preprocessor flags automatically (see instructions).

So if you want to simply create a vs project compile this fork of the pg -> https://github.com/brinoausrino/projectGenerator

bakercp commented 5 years ago

Also, to cross reference, this moves #14 forward.

bakercp commented 5 years ago

Sorry for the slow merge on this one. Let me know when it's ready to merge.

brinoausrino commented 5 years ago

Sorry for the slow merge on this one. Let me know when it's ready to merge.

I changed some path and installed dlib freshly following the instructions. So it should be ready to merge.

brinoausrino commented 5 years ago

Sorry for the slow merge on this one. Let me know when it's ready to merge.

I changed some path and installed dlib freshly following the instructions. So it should be ready to merge.

@bakercp

hiroMTB commented 5 years ago

Have you tried with CUDA? I assume this does not compile because this PR excludes CUDA related header. Cmake optimizes and automatically copies required header files so we don't need to exclude headers and sources manually.

brinoausrino commented 5 years ago

You're right. If you want to use CUDA you need to link the libraries manually. But since there is no option in the PG to activate/deactivate cuda or set some kind of this option it might be easier to do this step manually. I'll add this in the readme as well

hiroMTB commented 5 years ago

If you are using CUDA installed PC, Cmake is able to detect CUDA (also MKL) and optimize config.h and .h/.cpp automatically. So we don't need to edit vs properties manually.

Your PR includes lots of ADDON exclude. This is because you copied wrong dlib include folder at the begining. Please try to use original addon_config.mk. It should work.

On Tue, Oct 8, 2019, 12:25 AM Brian Eschrich notifications@github.com wrote:

You're right. If you want to use CUDA you need to link the libraries manually. But since there is no option in the PG to activate/deactivate cuda or set some kind of this option it might be easier to do this step manually. I'll add this in the readme as well

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakercp/ofxDlib/pull/30?email_source=notifications&email_token=AABPGAH2ICUQIRAKHZBVVBDQNNIGLA5CNFSM4ISNNWB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAQYG5Y#issuecomment-539067255, or mute the thread https://github.com/notifications/unsubscribe-auth/AABPGAEBVESWRTJJHW2RPEDQNNIGLANCNFSM4ISNNWBQ .

brinoausrino commented 5 years ago

Thank you @hiroMTB for reviewing the changes. I changed the includes back to the original config, you're right it was a wrong copy issue. Also I added the CUDA includes, that you could comment in/out if you want to use them. You may have a look if everything works like this? Thanks

hiroMTB commented 5 years ago

Thanks! I rember I needed to add more cuda lib files. Like,

ADDON_LIBS += $(CUDA_PATH)/lib/x64/cublas.lib cublasLt.lib cuda.lib cudadevrt.lib cudart.lib cudart_static.lib cudnn.lib cufft.lib cufftw.lib curand.lib cusolver.lib cusolverMg.lib cusparse.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib nvblas.lib nvgraph.lib nvjpeg.lib nvml.lib nvrtc.lib OpenCL.lib

Can you try this on CUDA installed PC?

Also it might be nice to remove DDLIB_USE_CUDA=1 option and let Cmake detect cuda and turn on this flag automatically.

hiroMTB commented 5 years ago

Please take a look at this PR, it might help. https://github.com/bakercp/ofxDlib/pull/31

brinoausrino commented 4 years ago

ADDON_LIBS += $(CUDA_PATH)/lib/x64/cublas.lib cublasLt.lib cuda.lib cudadevrt.lib cudart.lib cudart_static.lib cudnn.lib cufft.lib cufftw.lib curand.lib cusolver.lib cusolverMg.lib cusparse.lib nppc.lib nppial.lib nppicc.lib nppicom.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib nvblas.lib nvgraph.lib nvjpeg.lib nvml.lib nvrtc.lib OpenCL.lib

added, worked for me

Also it might be nice to remove DDLIB_USE_CUDA=1 option and let Cmake detect cuda and turn on this flag automatically.

automatic detection also worked. Thanks for your comments.