Skip to main content

Python wrapper around Dakota

Project description

Carolina

License PyPI - Python Version PyPI version Platform

Carolina is a pyDAKOTA fork maintained by Equinor. Its raison d'être is to have easier building of a Python Dakota wrapper, without any MPI support. Carolina supports Python version 3.11, 3.12, 3.13 and 3.14.

Installation

For Linux and MacOS:

pip install carolina

Otherwise, build Carolina youself as described below.

Building and installing Carolina

In order to build Carolina, Boost, including Boost.Python, and Dakota must be installed. This requires CMake and a C/C++ compiler. It is recommended to check the build scripts at .github/workflows/bundle_with_dakota_* where the full installation is described. The installation will likely vary across different operating systems. Roughly speaking, the following steps must be done:

  1. Install CMAKE

  2. Install Boost with correct python version (NOTE: you may need to edit the python version into the project-config.jam if on MacOS, see the excerpt from the MacOS install script below)

    python_version=$(python --version | sed -E 's/.*([0-9]+\.[0-9]+)\.([0-9]+).*/\1/')
    python_bin_include_lib="    using python : $python_version : $(python -c "from sysconfig import get_paths as gp; g=gp(); print(f\"$(which python) : {g['include']} : {g['stdlib']} ;\")")"
    sed -i '' "s|.*using python.*|$python_bin_include_lib|" project-config.jam
    
  3. Install dakota

    • after downloading, replace <DAKOTA_VERSION> with the dakota version, for example 6.18
    • In order to install Dakota to a specific folder, use -DCMAKE_INSTALL_PREFIX="<INSTALL_DIR>" as part of the cmake invocation.
    cd dakota-<DAKOTA_VERSION>-public-src-cli
    mkdir -p build
    cd build
    cmake \
        -DCMAKE_CXX_STANDARD=14 \
        -DBUILD_SHARED_LIBS=ON \
        -DDAKOTA_PYTHON_DIRECT_INTERFACE=ON \
        -DDAKOTA_PYTHON_DIRECT_INTERFACE_NUMPY=ON \
        -DDAKOTA_DLL_API=OFF \
        -DHAVE_X_GRAPHICS=OFF \
        -DDAKOTA_ENABLE_TESTS=OFF \
        -DDAKOTA_ENABLE_TPL_TESTS=OFF \
        -DCMAKE_BUILD_TYPE='Release' \
        -DDAKOTA_NO_FIND_TRILINOS:BOOL=TRUE \
        ..
    make -j4 install
    

    This step is the one that might be the most tricky to get working on your local OS. It expects a number of packages to be found, including libgfortran, eigen, lapack, numpy, and for the appropriate libraries to be on LD_LIBRARY_PATH(linux)/DYLD_LIBRARY_PATH(MacOS). Build errors often arise from (1) the package not being installed or (2) library folders/files of the installed package not being on the library path (LD_LIBRARY_PATH for linux or DYLD_LIBRARY_PATH for MacOS).

  4. After installing Dakota, it is possible to run pip install . as it will look for the following environment variables:

  • The BOOST_ROOT environment variable can be set to the location of the boost library containing the folders include and lib, if they are not already included globally.

  • The BOOST_PYTHON can be set if a given version of boost_python is needed. For instance if Python 3.8 is to be used:

        export BOOST_PYTHON=boost_python38
    

    By default the installation script will try to guess the boost_python version from the minor version of Python, i.e. for Python 3.10, it will try boost_python310.

  • It also expects dakota binary executable to be on the system PATH. To verify this, see if you can type dakota in the terminal and run it without errors. Then, try start up python and see if you can import dakota. If these two "tests" pass, you should be able to install Carolina.

Carolina can then be installed with:

    pip install .

The library can then be tested by entering the tests directory and execute:

    pytest

In the case of testing newer versions of Dakota, scripts can be found in the script folder.

Carolina requires Dakota 6.18, but will work with older versions as well. Pathes can be reverted to allow for building against versions prior to 6.13 or 6.16.

From Dakota version 6.13 a different set of boost libraries is needed: instead of boost_signals, boost_program_options is used. From Dakota version 6.16 a small change was made in the Python interface. From Dakota version 6.18 a file was removed from the source and build script was altered.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

carolina-2.0.4-cp314-cp314-manylinux_2_28_x86_64.whl (27.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

carolina-2.0.4-cp314-cp314-macosx_15_0_arm64.whl (15.2 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

carolina-2.0.4-cp313-cp313-manylinux_2_28_x86_64.whl (27.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

carolina-2.0.4-cp313-cp313-macosx_15_0_arm64.whl (15.2 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

carolina-2.0.4-cp312-cp312-manylinux_2_28_x86_64.whl (27.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

carolina-2.0.4-cp312-cp312-macosx_15_0_arm64.whl (15.2 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

carolina-2.0.4-cp311-cp311-manylinux_2_28_x86_64.whl (27.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

carolina-2.0.4-cp311-cp311-macosx_15_0_arm64.whl (15.2 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file carolina-2.0.4-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4e284a9c2c4a4fa74edb42ab9ed01dfb9bea09c8d8ef96c8d7a3802b238bab3
MD5 424cf8d8d12b97c3f1197180c8c01cae
BLAKE2b-256 236ea6791101c2a1338c1aaa128d6622e1cfbac95a929bb1b4140e805d2efa7e

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 247572722211c14e105729ee3db4c2a4f11083062d8becef9df16f9ae99d4234
MD5 c0c34d8e51cadb0e10570220978026e9
BLAKE2b-256 d521134e318436d7acceb3df34d8c9a4af248ec4d95197b3a254db2136779181

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75a0a7dd0bee8cb270f8f17d34ea675f48d9991317066df7099e2667ce3bab67
MD5 5f61c61d0ea854fd42bf129706758da1
BLAKE2b-256 0fec011c0589dafcd6d29c256978d2af03cade731996b78c6829187ba945a8c0

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2f32207c867591962565d93e082f33e5d555d40cfc2a370076fb1f3b3f2580df
MD5 14bc1d699c1841bb6b06029b1ed97489
BLAKE2b-256 0f73d43485991604759f741389787a9aaf1d70c75448a45559be18e9deb99a4e

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 329b4e1cc52fc9410f1c0b4e28e3d88f5ad1381554e71d56d0eebef404bddd28
MD5 9a844c20e7632d513051270e6b729209
BLAKE2b-256 cd1ba67b0ee4dba127c5315bcdb484e2209b5403f688b2a8dd13dac59b8795fa

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5cac53bbcf655b3bfb2f42ba19de57dbfc685736b3642bdf1ac6a8fbbc296567
MD5 b0412d8f6279d6172eb9b7167313fc7e
BLAKE2b-256 e58510e4ca5f6ee96201d35bae0f38ba832b87678dbc3719e7ed65098d9e83bb

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc1a34b8e29fca79587c1a6b9d7e6d3e73e8f8218e4a1d400dddabaaa0c436a9
MD5 16cf47cc617c223dc7d61963b75f8b5f
BLAKE2b-256 63426d9383dd592b08e794789b76d5e3196587c431fd7e12c566eb41fd122f04

See more details on using hashes here.

File details

Details for the file carolina-2.0.4-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-2.0.4-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d67fa5e0785e54d44d5d58ac2994717caee91e715d5366c443dc628675e205e0
MD5 a4e64037e576ed49a0b1d617ffbaf387
BLAKE2b-256 22b794c72c4e84f00f754b080ab1c5f627a12c2e2deb0432e3dd88bbac57602f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page