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

carolina-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

carolina-1.0.15-cp312-cp312-macosx_13_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.12 macOS 13.0+ ARM64

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

Uploaded CPython 3.12 macOS 11.0+ x86-64

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

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11 macOS 13.0+ ARM64

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

Uploaded CPython 3.11 macOS 11.0+ x86-64

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 13.0+ ARM64

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

Uploaded CPython 3.10 macOS 11.0+ x86-64

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

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 13.0+ ARM64

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

Uploaded CPython 3.9 macOS 11.0+ x86-64

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

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 13.0+ ARM64

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

Uploaded CPython 3.8 macOS 11.0+ x86-64

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8590af1dccfb997e50e79179ca22f22b315ba82973e22ce8dcf4ff5bb620fdcd
MD5 ae59fe00862912928c8ec106d2194a28
BLAKE2b-256 a74f17e678688e19646482f83a0f8bd756695db572d2b097c3ad06ac8a949dbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 fa58eddf88880268461f2491dd6153b797c4afb72b215a3bdd421adf0b8459e5
MD5 5b19435e1c0068c2642771f7f82009da
BLAKE2b-256 a8f96332978584129a84b52749ffd14dc7d55d3519ad37a5c7551ad1698c3a81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 07bdf83e8369c7be5b84024cb787d6c425f06c6c2455b160039ff45d3908683e
MD5 d88af639f0026cd1c423e415ecf40d81
BLAKE2b-256 9bca035e71324dea5b613749e34bae1178643a73e8a7716c7ae20dd21d5f3208

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dceaaa6a07f9d7d2cbe986701c47f00d399a6feea6b20b262665d3ff6e9655d8
MD5 925b1cab73f3cd2e386ce61a5635544f
BLAKE2b-256 ba33370ebda9800ea7467304a22a6cf1ff4d52de5034ab991555c819ab7ad263

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a0af4dff16e1f6470b337ab368a64e75e5153a054054070aeb8d11387a7dd0da
MD5 69f02726f9c6ecf2f0543f8958e5b18e
BLAKE2b-256 1ee9ec5b7861a9600d1141bd8d3f474ad535ee706ce466f9d94a7c2206a03e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7addb0eb18cfb17f26df8362d40ddfccd599de09ab2ee79d048533ce6694ebe6
MD5 9d3a1ab8681da7f87765b90d42867120
BLAKE2b-256 8e96ed85711f7116ae62c9dd4cb890e9c1cb31b6084250ca05d5b4f1960db179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 573953002acfa18c29c21e109d458315c84eba311e5492ac3156aab9ac37ebed
MD5 e4595eb84736109a90b7efba9437301f
BLAKE2b-256 45db87cdde246323328ea809fae3f7b7a63a8d966eee1597d8f228faed0f0d45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6b3e86293ff605206e029e5f920a8e2615ca74cabfb06f8e3bd8fed1f5b0854e
MD5 768182481f118be43d898df12e0d34ab
BLAKE2b-256 528889c6042feac940eb355f69e85af253a0ea853a6b907f2ccd79d8ea6dadf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a4b1ac5fb0327251b607b9108a23fbf32e4be06e4569dc8c6f62392ef1132d3c
MD5 45785250f73e4ce9028a6f29d1a61bb3
BLAKE2b-256 1df62da145c1427c8b9b048acbf428ce600e7d6be97c0a12ce022f9823f07d7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d1534b4485358e9cf9dcae159acf706048baacce490c79a39c7170df01edc9a
MD5 fa4f9ebfbb257caaadad2ec68f64a0f0
BLAKE2b-256 5de8ad7ba7595fc7b063c73ab8414f4432edb9471a4854fd8ebe5f291629a4f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 8072bb678bf8912a94f084953cafab4d32b72c328fb0a7a05950d5299d7239ea
MD5 d7ff9c654d51c1fa833bba346bb2229b
BLAKE2b-256 1d6db7bef62b1f105ba591569dd31a42d2930699362c300deb4c2219a6396b3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3bcbcae6e07aa09dbac95d076ce3759686377e8af640f4bbb58bb5d2a803028b
MD5 ce2f50f328833f67d1db9d55c267c382
BLAKE2b-256 c7cd246158c3849c2fdb1e8b7ee9692af82c2e0007eb33e367fec7107e75cfa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1eb6f2d05b0b848e2d9f184f394eea01851006d5dcef3f9d07586464c02c991
MD5 4656c5d5be8d9160b6d9e05d87fe8a45
BLAKE2b-256 efce18b427c84e26323cc96def3d4fdb356034dd425a96d91b039ead8eb5ee65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 742da43cf62fc84739734fafb878ddd144ced32e560abd673681cdea50b7294a
MD5 575bffee2c5943a9f59c5c07ae9794c1
BLAKE2b-256 aa004d596f192b1bcd07d1f6689ff2d0caf0240e7a225516814387039653f9f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carolina-1.0.15-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 98fcb621d4a03b0afd8ac302033f02c2cc2d8734830a1b5c6b86f4387f3cd095
MD5 b11adf04f66d77782eb30d190e8b93db
BLAKE2b-256 187861b2909bbc95f883e35a0c9597d420ad00892952409f32bc92e36109af26

See more details on using hashes here.

Supported by

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