-
Notifications
You must be signed in to change notification settings - Fork 4
2. How to install
Please be sure to have CMake v3.15+ and a C++17-capable compiler.
You have two options: using the script or doing a manual installation
To compile and install the release version:
$> ./build.sh
You can also compile and install GHOST with different options:
$> ./build.sh debug
$> ./build.sh debug_no_asan
$> ./build.sh rel_dbg_info
$> ./build.sh tests
$> ./build.sh tutorial
respectively to compile and install the debug version of GHOST, the debug version without the address sanitizer flag, the release version with debug info, the Google unit tests, and source code of tutorials.
If it is the first time you compile and install GHOST on your GNU/Linux machine, type the command
$> sudo ldconfig
to create necessary links and cache to GHOST's shared library.
To compile in release mode, just type:
$> mkdir release
$> cd release
$> cmake -DCMAKE_BUILD_TYPE=Release ..
$> make
Install the library and the header files with:
$> sudo make install
Finally, if it is the first time you compile and install GHOST on your GNU/Linux machine, type the command
$> sudo ldconfig
to create necessary links and cache to GHOST's shared library.
Same as on GNU/Linux, except that the command to create links and cache on OSX is:
$> sudo update_dyld_shared_cache
You have two options: using the script or doing a manual installation
To compile and install the 32bit and 64bit release versions, go to the GHOST directory in a command prompt and type:
$> build.bat
This script is set to build GHOST with Visual Studio 17 2022. You can either modify the script or do a manual installation if you do not want using Visual Studio 17 2022.
The script will first ask you to enter the install path for GHOST headers and libraries. Just press ENTER to install GHOST to the default path (C:\Users\Public\Documents\ghost)
Then it will compile the release version of both the 32bit library (installed in the 'ghost\lib32' folder) and the 64bit library (installed in the 'ghost\lib' folder). Headers are installed in the 'ghost\include' folder.
Go to the GHOST directory in a command prompt and type the following commands:
Prepare the builds (change "Visual Studio 17 2022" if you want to use another compiler)
$> cmake -G "Visual Studio 17 2022" -A Win32 -B "build32" -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
$> cmake -G "Visual Studio 17 2022" -A x64 -B "build64" -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
Build both projects.
$> cmake --build build32 --config Release
$> cmake --build build64 --config Release
Install both 32bit and 64bit libraries to the default install path
$> cmake --install build32
$> cmake --install build64
If you want to install the libraries to a specific install path, type:
$> cmake --install build32 --prefix your_install_path
$> cmake --install build64 --prefix your_install_path
The 32bit library will be installed in the 'ghost\lib32' folder, and the 64bit library in the 'ghost\lib' folder, and headers will be placed in the 'ghost\include' folder.
- Got the error 'The compiler /usr/bin/c++ has no C++17 support. Please use a different C++ compiler.'?
- Make sure you have installed a C++17-capable compiler
- If you have such a compiler but still get the error, before typing the command 'cmake ..', type 'export CXX=/path/of/your/c++17/compiler/executable_name'
- While running your program on GNU/Linux or on OSX, if you have a message like 'error while loading shared libraries: libghost.so: cannot open shared object file: No such file or directory', you probably need to run the following command:
On GNU/Linux:
$> sudo ldconfig
On OSX:
$> sudo update_dyld_shared_cache