|
From: Jake H. <jak...@gm...> - 2022-12-17 16:37:51
|
Hi Jonathan, I was not aware of this functionality. Thanks for pointing it out and also for the sample file, much appreciated. Cheers Hi Jake, > > The usual way to configure the CMake build - regardless of the IDE you are > using - is to create a file called CMakeUserPresets.json in the root > directory of the QuantLib project, next to the existing CMakePresets.json > file, and specify the CMake options that you want in there. You shouldn't > modify CMakeLists.txt directly. > > I've attached a sample CMakeUserPresets.json file that you can use to > compile the main library only - not the tests, benchmarks, or examples. It > should only be necessary for you to update the BOOST_ROOT variable to point > to your local installation. > > In Visual Studio Code, just install the recommended CMake extensions, and > choose the configure and build presets like so: > > [image: image.png] > > Then all you have to do is press F7 to start the build. > > Hope this helps. > > On Sat, Dec 17, 2022 at 7:02 PM Jake Heke <jak...@gm...> wrote: > >> Ciao Cay, >> Building QuantLib with Visual Studio Code is no joke! The tool IMHO is >> more flexible than VS Community, but of course more flexibility comes at >> the price of more configuration effort. >> I was able to successfully build the whole solution wihout examples and >> test suite by using CMake. In this way the build time I think it was a bit >> shortened. >> In order to exclude those items from the build process it is enough to >> manually edit the CMake configuration file CMakeLists.txt which is located >> in the root QuanLib installation directory. >> Thanks for your support. >> Cheers >> W. >> >> Il giorno ven 16 dic 2022 alle ore 21:07 <cay...@fr...> ha >> scritto: >> >>> Ciao Jake, >>> >>> >>> >>> I have never tried to build QuantLib on MinGW, but: >>> >>> Since you are building a C++ library, you need to build the whole thing, >>> the least you have to build is the QuantLib itself excluding the examples >>> and tests. But once you have managed to build QuantLib, you might just as >>> well build the other stuff, too. >>> >>> So, there is no shortcut I am afraid. >>> >>> (Of course, in theory, you could create your own project ‘Sub-QuantLib’ >>> with only calendar.cpp and all its dependencies. But this would require >>> painfully finding out all the dependencies of calendar.cpp and removing all >>> the overhead in for instance configure.hpp. In practice, this would not be >>> advisable, really. And it wouldn’t be a shortcut either.) >>> >>> >>> >>> The best way to tackle this kind of problem in C++ is usually to present >>> the specific linker errors. >>> >>> >>> >>> Since you mentioned boost specifically, my first guess would be that >>> either the linker cannot find the boost libraries, or you have an >>> incompatible glibc version. >>> >>> >>> >>> But once again, the specific linker errors are key here. >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Cay >>> >>> >>> >>> *From:* Jake Heke <jak...@gm...> >>> *Sent:* Freitag, 16. Dezember 2022 20:10 >>> *To:* qua...@li... >>> *Subject:* [Quantlib-users] How to partially build and test the >>> QuantLib solution >>> >>> >>> >>> Hello experts, >>> I am a new QuantLib user, currently trying to build the solution on >>> Windows with Visual Studio Code, Boost, CMake and MinGW. >>> I am still not able to build it because I am getting a good list of >>> linking errors. >>> Anyway, let's suppose that I want to build and test only the >>> functionalities containted in the source file >>> \QuantLib\ql\time\calendar.cpp (with all the required dipendences of >>> course). >>> According to your experience, is there a way to do it, or in order to >>> test the calendar functionalities I am forced to build the whole solution? >>> I apologize for the newbie question and thank you in advance for your >>> time. >>> >>> Best, >>> W. >>> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |