... | ... | @@ -3,5 +3,12 @@ Build on MacOSX |
|
|
MacOSX is based on a flavor of Unix, and MatLib can thus be built on a Mac using the procedure described [here](../unix-install). For those uncomfortable with the terminal, and/or willing to take advantage of the graphical interface of XCode (e.g. for debugging), we describe below a terminal-less procedure.
|
|
|
1. Download the files (or clone the repository): in the following we will refer to the top directory as `MatLib` (although you can pick the name of your choice).
|
|
|
2. Create a build directory to use with CMake: the location of this directory is arbitrary, but we will create it just under `MatLib` (using the Finder if you don't want to open a terminal).
|
|
|
3. Open CMake, and indicate the `MatLib` directory as the location of source code, and `MatLib/build` as the location where to build binaries. You can then click on the `Configure` button. The first time you click on `Configure` you will be asked to pick a generator: in this example we will use XCode (which should have been installed before of course).
|
|
|
4. ... |
|
|
\ No newline at end of file |
|
|
3. Open CMake, and indicate the `MatLib` directory as the location of source code, and `MatLib/build` as the location where to build binaries. You can then click on the `Configure` button. The first time you click on `Configure` you will be asked to pick a generator: in this example we will use XCode (which should have been installed before of course). CMake will then try to configure all build options, but it may not be able to do all automatically:
|
|
|
* you have to specify the `CMAKE_INSTALL_PREFIX`, which stands for the directory where you want to install headers, libraries and python modules ;
|
|
|
* you may also have to manually specify where to find Python libraries (it is suggested to use Anaconda, in which case the libraries are located in `.../anaconda3/lib/libpythonx.x.dylib`, while the include files are in `.../anaconda3/include/pythonx.x`, where x.x denotes the version you are using) ;
|
|
|
* the same problem may occur with `swig` (used to generate python bindings); it is important that your swig and python distributions be compatible: it is suggested to use Anaconda, which includes a `swig` module (may require manual installation with `conda install swig`); MatLib should work with python2.7 or python3, but you have to choose one version at configuration time ;
|
|
|
* finally, you may want to adjust some compiler options (e.g. set `CMAKE_CXX_FLAGS` to `-Wno-deprecated` to avoid some warnings), which can be done using `ccmake ..`.
|
|
|
|
|
|
**IMPORTANT**: if you use Anaconda on MacOSX (and only in that case), make sure to set the variable `USING_ANACONDA` to `ON`.
|
|
|
4. You can generate a XCode project file by clicking on `Generate`. It will be located in the `build` directory.
|
|
|
5. You can then open the project file in XCode, build it, and test it (selecting the appropriate target). |
|
|
\ No newline at end of file |