MUQ currently supports Linux and OSX systems. We do not currently support Windows, but let us know if that is important to you and we may consider it in the future.
On Linux or OSX, there are three primary ways of installing MUQ:
muq
conda package from the conda-forge channel. (See instructions below.)muq
docker image. (See Using MUQ with Docker )A conda package containing the c++ and python components of MUQ is available via conda-forge. To install and use MUQ using conda, use
If using MUQ with c++, you will also need to install CMake in order to link with MUQ:
You may run into conflicts when installing MUQ and Fenics with conda if they are installed one at a time. To avoid this, we recommend installing MUQ and Fenics at the same time:
MUQ leverages CMake to configure its build. For a C++ project building on MUQ, CMake is therefore the most natural way to link to the MUQ libraries. Here's a minimal of example of a CMakeLists.txt
file for linking against MUQ.
cmake_minimum_required(VERSION 3.10)
project(GaussianProcess_CO2)
set(CMAKE_CXX_STANDARD 17)
find_package(MUQ REQUIRED)
include_directories(${MUQ_INCLUDE_DIRS})
add_executable(my_muq_exe MyCode.cpp)
target_link_libraries(my_muq_exe ${MUQ_LIBRARIES} ${MUQ_LINK_LIBRARIES})
Compiling the my_muq_exe
executable involves the typical CMake configure and build steps. On the command line, this might be
mkdir build
cd build
cmake ..
make
**_NOTE:_** On newer Macs with the Apple M1 processor, you might have to set
-DCMAKE_OSX_ARCHITECTURES=x86_64
when running cmake.
**_NOTE:_** When using MUQ with MPI, you will need to tell CMake to use MPI compilers both when building MUQ and when compiling the examples. For example, building the examples may require the following CMake command
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_C_COMPILER=mpicc ..
make
**_NOTE:_** If you install MUQ to a non-standard location, such as
~/Installations/MUQ_INSTALL
, you may need to tell CMake where to look for the MUQ configuration. This can be accomplished by explicitly defining theCMAKE_PREFIX_PATH
variable in your CMake command. For example,
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=~/Installations/MUQ_INSTALL/lib/cmake/MUQ ..
make