Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use precompiled binaries of required C++ libraries instead of downloading source and compiling them. #19

Open
shubhamkarande13 opened this issue Aug 30, 2020 · 6 comments

Comments

@shubhamkarande13
Copy link
Member

shubhamkarande13 commented Aug 30, 2020

Is your feature request related to a problem? Please describe.
FLINT development environment takes 60+ mins to set up depending on the CPU and may take more time on older CPUs (2-3 hrs). When we use the command vcpkg.exe install gdal:x64-windows
vcpkg downloads the source code of GDAL which is 3.8 GB and then compiles it.
This is repeated for every library which is a dependency of FLINT.
After installing the libraries the source code of the libraries is never touched again and just consumes space for no reason. After installing all libraries the vcpkg folder it's size is around 15 GB which is a waste of space.

Describe the solution you'd like
After installing the libraries I used the vcpkg export --7zip command to export the libraries in a 7z file. With these exported libraries I was able to set up the FLINT development environment in a different directory in just 15 mins flat and I was able to build and run the solution without any issues. The size of the vcpkg folder with precompiled libraries is just 1.8 GB while the vcpkg folder with regular installation is of 15 GB.

You can download the precompiled libraries exported package here: https://drive.google.com/file/d/1Jkfu6Sbe0zoUkYv8aizrO80fZILcAGil/view?usp=sharing

To install it just extract all the contents of the file to the vcpkg folder (if it asks for replacing files select Replace All) and continue with the normal installation as given here.
You don't need to run the ix. command in step 1 of the installation vcpkg.exe install boost-test:x64-windows boost-program-options:x64-windows boost-log:x64-windows turtle:x64-windows zipper:x64-windows poco:x64-windows libpq:x64-windows gdal:x64-windows sqlite3:x64-windows boost-ublas:x64-windows

Comparison with precompiled libraries on the left with the standard installation process on the right.
compare

This trick reduces bandwidth usage by 15 GB and saves installation time by 1-2 hrs by removing the overhead of vcpkg's installation of C++ FLINT dependencies.

More info about vcpkg export command vcpkg documentation
usage examples on Microsoft devblogs

@gmajan
Copy link
Member

gmajan commented Aug 31, 2020

@leitchy @malfrancis @mfellows I am drawing your attention to this issue. It would be great to get your feedback. Thank you.

@mfellows
Copy link
Contributor

It's a nice shortcut - I wonder if this could be worked into the CI stuff somehow so that the current FLINT dependencies are always available as a zip file (seems like Travis supports Windows VMs?). It's at least worth including this as a note in the build instructions.

@shubhamkarande13
Copy link
Member Author

@mfellows what if we add the precompiled libraries to moja global's vcpkg repo ?
Then the user just needs to clone the vcpkg repo and they can move forward with the installation process.
The only caveat is that we need to update the repository from time to time whenever a library gets updated which itself does not happen very frequently.

@mfellows
Copy link
Contributor

I think I'd rather ask people to go make a sandwich once a year while they wait for the libraries to build than check 1.8GB of files into the repo... let's see what else we can figure out.

@shubhamkarande13
Copy link
Member Author

Haha, @mfellows I didn't think of that!
Seems CI would be the best option then. :)

@Tlazypanda
Copy link
Contributor

Tlazypanda commented Sep 10, 2020

Hey @shubhamkarande13 @mfellows Just adding here that with CI we can cache this once done and we don't need to build again ..There is a sample CI setup on Github Actions that I wrote sometime back 😅 https://github.com/Tlazypanda/FLINT/blob/master/.github/workflows/c-cpp.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants