From 097518d9ab40a2cdbd817b91847b6a1ad667bead Mon Sep 17 00:00:00 2001 From: Diamond Rivero Date: Wed, 11 Oct 2023 01:50:34 +0800 Subject: [PATCH] Update documentation for building with cmake (#222) * update build guide with cmake * update build guide based on OS * Separate build and build files generation Co-authored-by: Leszek Grzanka * separate build and build files generation * fix end of code block * fix build command typo * fix build command typo * Use `--parallel` compilation in building Co-authored-by: Leszek Grzanka * Use `--parallel` compilation in building Co-authored-by: Leszek Grzanka * Use `--parallel` compilation in building Co-authored-by: Leszek Grzanka --------- Co-authored-by: Leszek Grzanka --- README.md | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eb20ad77..b32cb8c5 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,122 @@ libamtrack comes with a collection of wrappers for Python and Matlab (/distribut ## iv. Use precompiled binaries If you want to use libamtrack in your own code, please try to use the precompiled binaries (incl. headers) for your OS (Win, Mac OS X) are found on libamtrack's website. In case you are running Linux (or some exotic OS) you will have to compile and install libamtrack using autotools. But in the future, rpm/deb packages will be provided. -## v. Compile libamtrack from distributed sources -Download the latest source distribution and use autotools (Windows: MinGW, Mac OS X: XCode) to compile and install. - ## vi. Work with full sources / development -This should be the very last alternative - THE FACT THAT YOU ARE LOOKING AT THIS FILE MIGHT BE AN INDICATION THAT YOU WANT TO DEVELOPE RATHER THAN JUST USE libamtrack. If not, try (i)-(vi). IF YOU DO, please look at README_DEVELOPERS. +If you want to compile it on your own latest source code of libamtrack, please use this to build and install according to your OS. + +### Linux + +Requirements: +- git +- gcc +- libtool +- gfortran +- libgsl-dev +- cmake + +Get the latest source code of the libamtrack: + +```bash +git clone https://github.com/libamtrack/library.git +``` + +Go to `library` directory and then create `build` directory: + +```bash +cd library && mkdir build +``` + +Generate build files for the libamtrack: +```bash +cmake -S . -B build +``` + +Build the libamtrack: +```bash +cmake --build build --parallel +``` + +Install the libamtrack: +```bash +cmake --install build +``` + +### Windows(MSYS2) + +Get first the [MSYS2](https://www.msys2.org/) and please follow the installation guide. + +Requirements: +- git +- gcc +- libtool +- mingw-w64-x86_64-gcc-libgfortran +- mingw-w64-x86_64-gsl +- cmake + +Get the latest source code of the libamtrack: + +```bash +git clone https://github.com/libamtrack/library.git +``` + +Go to `library` directory and then create `build` directory: + +```bash +cd library && mkdir build +``` + +Generate build files for the libamtrack: +```bash +cmake -S . -B build +``` + +Build the libamtrack: +```bash +cmake --build build --parallel +``` + +Install the libamtrack: +```bash +cmake --install build +``` +### MacOS + +Get first the [Homebrew](https://brew.sh/) to install the required packages. + +Requirements: +- git +- gcc +- libtool +- gsl +- cmake + +Get the latest source code of the libamtrack: + +```bash +git clone https://github.com/libamtrack/library.git +``` + +Go to `library` directory and then create `build` directory: + +```bash +cd library && mkdir build +``` + +Generate build files for the libamtrack: +```bash +cmake -S . -B build +``` + +Build the libamtrack: +```bash +cmake --build build --parallel +``` + +Install the libamtrack: +```bash +cmake --install build +``` # 3. CAN I USE LIBAMTRACK IN MY RESEARCH AND/OR MODIFY THE CODE?