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.14-cp312-cp312-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

carolina-1.0.14-cp312-cp312-macosx_11_0_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

carolina-1.0.14-cp311-cp311-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

carolina-1.0.14-cp311-cp311-macosx_11_0_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

carolina-1.0.14-cp310-cp310-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

carolina-1.0.14-cp310-cp310-macosx_11_0_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

carolina-1.0.14-cp39-cp39-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

carolina-1.0.14-cp39-cp39-macosx_11_0_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

carolina-1.0.14-cp38-cp38-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

carolina-1.0.14-cp38-cp38-macosx_11_0_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

File details

Details for the file carolina-1.0.14-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 0aa13a13b2bcbe9fd771db37bd6d75cb5df58261f8a9e3ca3c981317d1935859
MD5 e9ee2327f72af79466eb44e82456fa11
BLAKE2b-256 36079b80f6b10647a4475523992a8b3cf754cdbc23728b2bec3bf52d1f90c080

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cb54a5bd5c72c79297ba80b30eecce12d587e2281913b82926cfa470ca974383
MD5 69d8f9d892019e851dd44d1c23b3382a
BLAKE2b-256 1907b0e2a5b8fb6b0cec77d5f9ddef5b153172e7b5a25ac792a921f1d35ca1a9

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 310cc60505f8aa0fb5900c6a889840b38bac44d4bea341722bd560a874813a46
MD5 f1bc3e10e4360e4f16efa3484283c785
BLAKE2b-256 9cc1f466059ea748badb991fbb6e441e3fb91311204721ce7da7378d5434b18a

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c06f4d6b45870438f96c344ffe218e613cf738212cc3270ab58ca0d60ebd41e2
MD5 8d032daa2d25a9494e201b4bf103c674
BLAKE2b-256 90d5df6e5771fb4b93661f35d876170adcd6bcec392ae84c12fdc3ed401f199f

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 2aedd160b0cbb22f31f06a4a801f6eb45f6e9f7f9c495aafa3b04d4ba40f6a46
MD5 3bf75d91e8d5fea67ac9d2a9be29ca58
BLAKE2b-256 a5a817a99001048ec09113b713bc039ce48f6a061a700749e1df578a1d04eb91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.14-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 76533d2d4365826653ae65cb509374e977856e49a7b7be9c7a204fcd4efedac8
MD5 b44dafd5f52d0af9055e74705e400e60
BLAKE2b-256 56345ac23dcc824775cd4b09068bad02f257a5a51e42d98949358ba8972a0d6b

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4885fdc0d34c6610457e7bc0e0bc784942a259780a47752ca3ed565af29e040e
MD5 96a06c5f5f541fe3f8d5f5016ee6d2c7
BLAKE2b-256 3786b3a514bee75ca11875039f1e44a31f547de530d526e0f4ecd93250a414f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.14-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 29d3c57217cf2ccc3f6dd9af1aca4a4aa216152efcc5840ee3ba31aa7cb85286
MD5 2790c7a42d630d4580f3b54046199881
BLAKE2b-256 c78b970149ac12161dbd38a4c9b5724f8b14952291e0683345166db3d3dc0c41

See more details on using hashes here.

File details

Details for the file carolina-1.0.14-cp38-cp38-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for carolina-1.0.14-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 df7da5d5a2b8c74ee7510a696898d74c5e0b544a86ea52f719463b43e086fc23
MD5 f3c68106abe3122d0ad85c83b30d675b
BLAKE2b-256 894ed112a552b4037f220b48ca845f6fedcc8f7f680ec3f3e921afa5f3ac4b3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.14-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 13574a98326327863c50b383515df9de9423506223f275fe15867d1524b266b7
MD5 212ebb8a1bf140b636c16384ef7e9fb1
BLAKE2b-256 f7e44efe278bf84f46a643ff77996c7e0b4d7c2f281f34b0f8c3305bb8d3e6ac

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