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.8, 3.9, 3.10, 3.11, 3.12

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-1.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

carolina-1.0.11-cp312-cp312-macosx_10_9_universal2.whl (18.0 MB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

carolina-1.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

carolina-1.0.11-cp311-cp311-macosx_10_9_universal2.whl (17.5 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

carolina-1.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

carolina-1.0.11-cp310-cp310-macosx_11_0_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

carolina-1.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

carolina-1.0.11-cp39-cp39-macosx_11_0_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

carolina-1.0.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

carolina-1.0.11-cp38-cp38-macosx_11_0_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

File details

Details for the file carolina-1.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 766ce7189c521b8e0736a27685d724068e26204d4c52aa6ffbe00ff7920c78b4
MD5 1e7d639ce3e9fed1e80a01182ca5ade0
BLAKE2b-256 92c66620927471793d2911ad0f8cd96c6ec8e7978d483f43dc7160b0e97201a4

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c8801691e8d8ebeb9fde2b42f70b48a81f9d5acb72b4a7fcd14b369502b53f29
MD5 99753ffdf676fb8154552224061cc520
BLAKE2b-256 dada55513fc89daa48d7346648098afea35ac560cb4a58fd90261d8be8c38724

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e8432b8c19e3d23aabf52d28e0135c9a5bbd3a61eed38c32a617a4ed193e1b1
MD5 7905dc082fda2aa8d0c2ac057b354553
BLAKE2b-256 36f8d600c58c2e52b0510d37ac1df4834ef6a92df1f053ba4fd89784e72a0f8b

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0284cdc285b9a5e539a10b2a265a00beab61b81402c16ab01f61bdbcab123cb5
MD5 d8b18148786bdb05aa7b90f0305e7f8c
BLAKE2b-256 e82f2e37a8ca7ae13aa3e647969c0ba417c0b8e4945ea19982061dbbcbca2282

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8ea4e1ff45fe3706a3863fcf09960fb26d905b903276e73f56cdcd4ac5ab588
MD5 4e8e13543cd76ac15bf3ecf206351d8d
BLAKE2b-256 0cefec545f0e413a3f6d2f1e5d86109bab436b9711352b1a1718166039066155

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6abdcdd3b1a5e72e968eafda973868d30fd40c22e3ed07b708b9fb8ee71d5543
MD5 f332a8de70191a85616d6fd942ae85b9
BLAKE2b-256 f37982d8525f70cd9dc8e92ae42d00d85ab444b25a3c7526ee16ea3c9a547754

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d9ed62768f38a5e46e06e208f7c00a901a205cd89ffbce96e71c9c673f6c5d3
MD5 272ff4db19187effcfb8a170b61c83f2
BLAKE2b-256 47e57aac044c418df41b584935cdc9612d41741d7fc4cd65377a1dcf1fd8f7e7

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a19c6e52ccb2de5ebf056dfe2680c374120090647cc3ba422e32613f22a91f54
MD5 1d870af462f0cf36970c93e21c0da0f2
BLAKE2b-256 fbd8310c5ff2e56dae8c978aac821228cfddf99aa898b9ae8efd675eb57c508d

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3334de720663fd60bba6ac0dae55237f0bb6b9ce20ad18d1d1e6d93784c9f49b
MD5 a3ea79de79b2d75c6ce30d3e12c380b3
BLAKE2b-256 edfac8834933d3507d5db348f3860bfb789341c3a27d898bdd96f4e62f94eb6e

See more details on using hashes here.

File details

Details for the file carolina-1.0.11-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.11-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9de73149faa5d568b4c3e9262538bf729cc44c8380e37a32f44a6e298f887d41
MD5 7a49033fe89ffd8bd1f69aca4d13b953
BLAKE2b-256 9106f6a26aad329df63677cf023883fe368e5d9cd1d4de43dd5c23f7788a7f07

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