### Run Example Experiment Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/README.md This command runs the example experiment using the compiled JAR and native library, directing results to the 'exdata/' directory. ```bash java -classpath build/coco.jar -Djava.library.path=build/ ExampleExperiment ``` -------------------------------- ### Install coco-experiment using pip Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/README.md The recommended way to install the coco-experiment package is by using pip. This command ensures you get the latest version, and it's best practice to do this within a virtual environment. ```bash pip install -U coco-experiment ``` -------------------------------- ### Build Example Experiment with Meson Source: https://github.com/numbbo/coco-experiment/blob/main/build/c/README.md Alternatively, use Meson and Ninja to build the example experiment. This method provides another way to compile the C/C++ components. ```bash meson setup build meson compile -C build ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Initializes CMake version and defines the project name, description, and language. ```cmake cmake_minimum_required(VERSION 3.19) project(COCOUnitTest DESCRIPTION "COCO C unit tests" LANGUAGES C) ``` -------------------------------- ### Build Example Experiment with CMake Source: https://github.com/numbbo/coco-experiment/blob/main/build/c/README.md Use these commands to build the included example experiment using CMake. Ensure you have CMake version 3.19 or greater and a C99-compliant C compiler. ```bash cmake -B build . cmake --build build ``` -------------------------------- ### Install Cocoex Python Package from Source Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs the cocoex Python package locally from its source directory. Uninstall any existing version before installing. ```sh pip uninstall -y coco-experiment ``` ```sh pip install . ``` -------------------------------- ### Install Development Version of Cocoex Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/DEVELOPMENT.md Use this command to install the package in development mode from the root directory of the cocoex Python package. ```sh python -m pip install . ``` -------------------------------- ### Install Coco Experiment Python Package Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs the coco-experiment Python package from a local build directory. Ensure you uninstall any existing version first. ```sh python -m pip uninstall -y coco-experiment ``` ```sh python -m pip install ../../build/python/ ``` -------------------------------- ### CMake Project Configuration Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/CMakeLists.txt Sets the minimum CMake version and defines the project name and languages. This is a standard starting point for CMake projects. ```cmake cmake_minimum_required(VERSION 3.20) project(COCO LANGUAGES C) ``` -------------------------------- ### Install Cocoex Python Package on ARM macOS Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs the cocoex Python package from source on an ARM-based macOS system, specifying the architecture. ```sh arch -arm64 pip install . ``` -------------------------------- ### Setup and Run SMS-EMOA in MATLAB Source: https://github.com/numbbo/coco-experiment/blob/main/examples/bbob-biobj-matlab-smsemoa/README.md Compiles and runs the SMS-EMOA algorithm and the COCO framework within MATLAB. This is done after the build step. ```matlab setup run_smsemoa_on_bbob_biobj ``` -------------------------------- ### Install Development Version with Debug Symbols Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/DEVELOPMENT.md Install the package with debug symbols enabled for C code assertions. This command should be run from the root directory of the cocoex Python package. ```sh python -m pip install -e . \ --no-build-isolation \ -Csetup-args=-Dbuildtype=debug \ -Cbuild-dir=build-dbg ``` -------------------------------- ### Install Cocoex Python Package with C99 Mode Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs the cocoex Python package from source, explicitly enabling C99 mode for the C compiler, which may be necessary on older systems. ```sh CFLAGS="-std=c99" pip install . ``` -------------------------------- ### Test Cocoex Python Package with Pytest Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs pytest and runs the package's tests using the pytest framework. ```sh pip install pytest ``` ```sh python -m pytest test ``` -------------------------------- ### Run Regression Tests Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Executes the regression tests using Python scripts. Requires the cocoex Python package to be installed. ```sh python test_suites.py ``` ```sh python test_loggers.py ``` -------------------------------- ### Update Existing Conda Environment Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Installs required development dependencies into an already activated conda environment without creating a new one. ```sh conda env update --file env.yaml ``` -------------------------------- ### Build Classes and Native Library Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/README.md Execute this command after configuration to compile the Java classes and the native JNI library. ```bash cmake --build build ``` -------------------------------- ### Configure Build Source: https://github.com/numbbo/coco-experiment/blob/main/test/integration-test/README.md Configure the build system using CMake. This command prepares the build environment. ```bash cmake -B build ``` -------------------------------- ### Creating a Static Library Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Builds a static library named 'about_equal' from its source and header files. Includes public directory for headers. ```cmake add_library(about_equal STATIC about_equal.c about_equal.h) target_include_directories(about_equal PUBLIC .) if(MATH_LIBRARY) target_link_libraries(about_equal PUBLIC ${MATH_LIBRARY}) endif() ``` -------------------------------- ### Fabricate Sources Source: https://github.com/numbbo/coco-experiment/blob/main/test/integration-test/README.md Run this command to fabricate the necessary sources for the tests. Ensure you are in the correct directory. ```bash python ../../../scripts/fabricate ``` -------------------------------- ### Run Tests with Valgrind Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/README.md Execute the test suite using valgrind to detect potential memory leaks. This command is only available on Linux. ```bash ctest -T memorycheck --text-dir build ``` -------------------------------- ### Change Directory to Unit Tests Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Navigates the file system to the unit tests directory. ```sh cd test/unit-test ``` -------------------------------- ### Build Wheel using build Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/DEVELOPMENT.md Build a wheel package using the 'build' tool. Execute this command from the root directory of the cocoex Python package. ```sh python -m build -w . ``` -------------------------------- ### Execute Matlab Experiment Source: https://github.com/numbbo/coco-experiment/blob/main/build/octave/README.md Run a Matlab experiment from the system shell. Ensure the experiment file is in the current directory or on the Matlab path. ```shell matlab exampleexperiment_new_name.m ``` -------------------------------- ### Execute Octave Experiment Source: https://github.com/numbbo/coco-experiment/blob/main/build/octave/README.md Run an Octave experiment from the system shell. Ensure the experiment file is in the current directory or on the Octave path. ```shell octave exampleexperiment_new_name.m ``` -------------------------------- ### Build Tests with CMake Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Configures and builds the project's tests using CMake. The -B flag creates a build directory if it doesn't exist. ```sh cmake -B build ``` ```sh cmake --build build ``` -------------------------------- ### Configure Build with CMake Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/README.md Use this command to configure the build process for the Java and C++ components of the CoCO framework. ```bash cmake -B build . ``` -------------------------------- ### Build sdist Archive using Hatchling Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/DEVELOPMENT.md Build a source distribution (sdist tar.gz) using hatchling. Run this command from the root directory of the cocoex Python package. ```sh python -m hatchling build -t sdist -d dist/ ``` -------------------------------- ### Execute Matlab/Octave Experiment from Shell Source: https://github.com/numbbo/coco-experiment/blob/main/build/octave/README.md Alternatively, execute the experiment directly from the Matlab or Octave interactive shell. ```matlab example_experiment_new_name ``` -------------------------------- ### Build coco-sys Crate Source: https://github.com/numbbo/coco-experiment/blob/main/build/rust/README.md Build the coco-sys crate, which provides the low-level system bindings for COCO. ```sh cargo build -p coco-sys ``` -------------------------------- ### Finding Libraries Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Locates system libraries like libm and librt, which may be required for certain functionalities. ```cmake find_library(LIBM m) find_library(LIBRT rt) ``` -------------------------------- ### Create Conda Environment Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Use this command to create a new conda environment with all necessary dependencies from the env.yaml file. ```sh conda env create -f env.yaml ``` -------------------------------- ### Run Tests (Linux/macOS) Source: https://github.com/numbbo/coco-experiment/blob/main/test/integration-test/README.md Execute the tests using ctest on Linux or macOS. This command runs the compiled tests. ```bash ctest --test-dir build ``` -------------------------------- ### Upload Python Packages to PyPI Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Uploads the built Python source package and wheels to the Python Package Index (PyPI) using the twine utility. ```sh twine upload dist/* ``` -------------------------------- ### Build coco-rs Crate Source: https://github.com/numbbo/coco-experiment/blob/main/build/rust/README.md Build the main coco-rs crate, which includes the higher-level Rust API. ```sh cargo build ``` -------------------------------- ### Run Tests (Windows) Source: https://github.com/numbbo/coco-experiment/blob/main/test/integration-test/README.md Execute the tests using ctest on Windows, specifying the Debug configuration. This command runs the compiled tests. ```bash ctest --test-dir build -C Debug ``` -------------------------------- ### Run Tests with CTest Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Executes the built tests using CTest, specifying the build directory. ```sh ctest --test-dir build ``` ```sh ctest --test-dir build -C Debug ``` -------------------------------- ### Build MATLAB SMS-EMOA Implementation Source: https://github.com/numbbo/coco-experiment/blob/main/examples/bbob-biobj-matlab-smsemoa/README.md Builds the MATLAB implementation of SMS-EMOA by updating COCO framework files. This command is executed in the shell before running MATLAB scripts. ```shell python do.py build-matlab-sms ``` -------------------------------- ### MinUnit Test Macro Definition Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Defines a macro to streamline the creation of MinUnit test executables. It adds the executable, links the 'about_equal' library and system libraries, and registers it as a CTest. ```cmake macro(minunit_test name) add_executable(${name} ${name}.c) target_link_libraries(${name} PUBLIC about_equal) if (LIBM) target_link_libraries(${name} PUBLIC ${LIBM}) endif() if (LIBRT) target_link_libraries(${name} PUBLIC ${LIBRT}) endif() add_test(NAME ${name} COMMAND $ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endmacro() ``` -------------------------------- ### Tag and Push Git Repository Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Tags a specific commit with a version number and pushes the tag to the remote repository to trigger a release build. ```sh git tag -a -m 'Version X.Y.Z' vX.Y.Z ``` ```sh git push --tags ``` -------------------------------- ### Activate Conda Environment Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Activates the specified conda environment, making its tools and packages available in your current shell session. ```sh conda activate cocoex ``` -------------------------------- ### Rerun Fabricate Script Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Executes the fabricate script to bundle C files and update binding metadata. This should be run after core file changes. ```sh python ../../scripts/fabricate ``` -------------------------------- ### Find Java and JNI Packages Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/CMakeLists.txt Locates the required Java and JNI development packages. The 'REQUIRED' keyword ensures the build fails if these packages are not found. ```cmake find_package(Java REQUIRED) find_package(JNI REQUIRED) include(UseJava) ``` -------------------------------- ### Add Native Library Target Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/CMakeLists.txt Creates a shared native library 'CocoJNI' from C source files. It links this library against the 'coco-native' target and includes JNI directories. ```cmake add_library(CocoJNI SHARED CocoJNI.c) target_link_libraries(CocoJNI PRIVATE coco-native) target_include_directories(CocoJNI PRIVATE ${JNI_INCLUDE_DIRS}) ``` -------------------------------- ### Tainted Problem Test Executable Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Adds the 'test_tainted_problem' executable, linking it with necessary libraries and registering it as a test with specific arguments and failure properties. ```cmake add_executable(test_tainted_problem test_tainted_problem.c coco.c) if (LIBM) target_link_libraries(test_tainted_problem PUBLIC ${LIBM}) endif() if (LIBRT) target_link_libraries(test_tainted_problem PUBLIC ${LIBRT}) endif() add_test(NAME test_tainted-bbob COMMAND $ bbob) set_property(TEST test_tainted-bbob PROPERTY WILL_FAIL YES) add_test(NAME test_tainted-bbob-largescale COMMAND $ bbob-largescale) set_property(TEST test_tainted-bbob-largescale PROPERTY WILL_FAIL YES) ``` -------------------------------- ### MinUnit Test Invocations Source: https://github.com/numbbo/coco-experiment/blob/main/test/unit-test/CMakeLists.txt Calls the 'minunit_test' macro to define and configure multiple unit tests for various components of the COCO library. ```cmake minunit_test(test_biobj_utilities) minunit_test(test_brentq) minunit_test(test_coco_archive) minunit_test(test_coco_observer) minunit_test(test_coco_problem) minunit_test(test_coco_string) minunit_test(test_coco_utilities) minunit_test(test_logger_bbob) minunit_test(test_logger_biobj) minunit_test(test_mo_utilities) ``` -------------------------------- ### Add Compilation Fix for Older MATLAB/GCC Source: https://github.com/numbbo/coco-experiment/blob/main/build/octave/README.md This preprocessor directive may be necessary for C files compiled with gcc in older MATLAB versions (before 2015b). It should be placed before the include of 'mex.h'. ```c #define char16_t UINT16_T ``` -------------------------------- ### Update Conda Environment Source: https://github.com/numbbo/coco-experiment/blob/main/DEVELOPMENT.md Use this command to update an existing conda environment with dependencies from env.yaml, pruning any unused packages. ```sh conda env update -f env.yaml --prune ``` -------------------------------- ### Add Java JAR Target Source: https://github.com/numbbo/coco-experiment/blob/main/build/java/CMakeLists.txt Defines a Java Archive (JAR) target named 'coco' with specified source files. It also generates native headers for JNI integration. ```cmake add_jar(coco Benchmark.java CocoJNI.java ExampleExperiment.java Observer.java Problem.java Suite.java GENERATE_NATIVE_HEADERS coco-native) ``` -------------------------------- ### Import cocoex in Python Source: https://github.com/numbbo/coco-experiment/blob/main/build/python/README.md When using the coco-experiment package in your Python code, the import name is 'cocoex'. This is similar to how other packages like scikit-learn are structured. ```python import cocoex ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.