{"id":21962444,"url":"https://github.com/scipopt/matlabscipinterface","last_synced_at":"2025-07-18T05:35:23.209Z","repository":{"id":108247558,"uuid":"401441364","full_name":"scipopt/MatlabSCIPInterface","owner":"scipopt","description":"Interface from Matlab to SCIP and SCIP-SDP","archived":false,"fork":false,"pushed_at":"2024-02-14T18:53:26.000Z","size":441,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T21:37:29.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scipopt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-30T18:09:20.000Z","updated_at":"2024-12-10T05:17:00.000Z","dependencies_parsed_at":"2024-01-30T21:44:03.000Z","dependency_job_id":"713e50d3-4629-4c33-996c-1600378c91f3","html_url":"https://github.com/scipopt/MatlabSCIPInterface","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scipopt/MatlabSCIPInterface","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FMatlabSCIPInterface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FMatlabSCIPInterface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FMatlabSCIPInterface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FMatlabSCIPInterface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scipopt","download_url":"https://codeload.github.com/scipopt/MatlabSCIPInterface/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FMatlabSCIPInterface/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265705487,"owners_count":23814472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T10:40:34.037Z","updated_at":"2025-07-18T05:35:23.156Z","avatar_url":"https://github.com/scipopt.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Matlab Interface to SCIP and SCIP-SDP\n\nThis repository provides an interface of Matlab/Octave to\n[SCIP](https://www.scipopt.org/) and [SCIPSDP](http://www.opt.tu-darmstadt.de/scipsdp/).\n\nThis interface is based on the OPTI Toolbox by Jonathan Currie, see:\n\nhttps://github.com/jonathancurrie/OPTI\n\nSince the OPTI Toolbox is unfortunately no longer maintained, we wanted\nto provide such a Matlab/Octave interface. However, the OPTI Toolbox\ncontains interfaces to many solvers, which we cannot support in its\nfull generality. We therefore took the OPTI Toolbox, stripped away all\nparts concerned with other solvers and reworked the SCIP specific\ncode. Thus, in comparison to the orginal OPTI Toolbox, this interface\nhas the following features:\n\n- It only interfaces to SCIP and SCIP-SDP, but retains the modeling\n  features of the OPTI Toolbox, including symbolic modeling of\n  nonlinear optimization problems.\n\n- Code that worked for the OPTI Toolbox using SCIP as a solver should\n  still work.\n\n- The interface now works under Linux and for Octave.\n\n- The preliminary interface to SCIP-SDP has been extended to a\n  full-fledged version.\n\nIn case someone wants to reactivate the OPTI Toolbox, these changes\nmight be incorporated.\n\nWe carefully tested the interface, but it is very likely that problems\nwith the installation and/or application arise. Some obstacale are:\nthere are many ways of installing SCIP/SCIP-SDP (make/cmake/packages),\nthe code should run both under Linux and Windows, and interfacing with\nMatlab is not easy. Please see below for some known issues.\n\n#### Compatibility\n\n- The interface should work for Matlab versions starting with 2011a and\n  Octave versions of at least 6.0.  It has been tested with Matlab\n  2020a/b as well as Octave 6.1.\n\n- There is currently a bug in Octave such that running the test fails with\n  `error: mark_as_constructed: invalid object`, see [https://savannah.gnu.org/bugs/?func=detailitem\u0026item_id=59775].\n  Until this bug is resolved, the interface will not be fully operational.\n\n- One needs least version 8 of [SCIP](https://www.scipopt.org/)\n  and, if wanted, at least version 4 of\n  [SCIPSDP](http://www.opt.tu-darmstadt.de/scipsdp/).\n\n\n## MATLAB-SCIP Interface\n\nObviously the interface needs [SCIP](https://www.scipopt.org/).\n\n### Installation\n\nThe installation process sets the appropriate paths for the mex file\nin Matlab/Octave to run. These paths will reset if you restart\nMatlab. To save path changes run the command\n\n  savepath()\n\nwith appropriate permissions (see Common Problems: Saving path changes).\n\n\n#### Linux\n\n- Download the latest version of SCIP. See the corresponding\n  installation description.\n\n- If you build SCIP from source, the Matlab-SCIP installation process\n  supports both make and cmake installs.\n\n- The mex file uses shared libraries, which are standard for cmake.\n  Make users need to specifically build shared libraries by using\n  `make ... SHARED=true`.\n\n- To specify the location of SCIP for the Matlab interface, you can\n  set the environment variable SCIPDIR to the SCIP directory. This\n  variable has to be defined before starting Matlab/Octave and in the\n  same terminal.\n\n  Alternatively you can specify the SCIP directory during the\n  installation process.\n\n- Note: In case you have installed the full SCIP Optimization Suite,\n  the environment variable SCIPOPTDIR can be used to specify the main\n  directory of the full optimization suite instead.\n\n- To start the installation process, change to the \"opti\" directory\n  within Matlab/Octave and run the file\n  `matlabSCIPInterface_install.m` in Matlab or Octave. The\n  installation automatically searches environment variables for SCIP\n  and prompts for user input, if it does not find a valid SCIP\n  installation. On linux systems specifying a gcc compiler might be\n  necessary (see below).\n\n\n#### Windows\n\n- Download the latest version of SCIP. See the corresponding\n  installation description.\n\n- The Matlab-SCIP installation process supports both make and cmake\n  installs as well as the Windows specific .exe install of SCIP.\n\n- If you plan on building SCIP from source, the GNU specific\n  make-functionality is needed. Make is supported by, for example,\n  [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) or\n  [Chocolatey](https://chocolatey.org/courses#getting-started). Refer\n  to their documentation for more information.\n\n- To specify the location of SCIP for the Matlab/Octabe interface, you\n  can permanently set the environment variable SCIPDIR to the SCIP\n  directory. The definition has to be performed before starting\n  Matlab/Octave and in the same terminal.\n\n  Alternatively you can specify the SCIP directory during the\n  installation process.\n\n- To start the installation process, change to the \"opti\" directory in\n  Matlab/Octave and run the file `matlabSCIPInterface_install.m` in\n  Matlab or Octave.  The installation automatically searches\n  environment variables for SCIP and prompts for userinput, if it does\n  not find a valid SCIP installation.\n\n- Note that for octave, the SCIP installation paths should not contain\n  spaces. So you might need to rename \"SCIPOptSuite 8.0.0\", e.g., to\n  \"SCIPOptSuite8.0.0\".\n\n### Troubleshooting\n\n#### Compiler\n\nThe mex compilation process needs a compatible C++ compiler to work.\nOn Linux systems the [C++ compiler support of\nMatlab](https://de.mathworks.com/support/requirements/previous-releases.html)\nis severly restricted.  Make sure you have a compatible C++-Compiler\ninstalled on your system. You will be prompted to specify such a\ncompiler during the installation process.\n\nOn Windows, the Matlab internal C++ runtime or the Matlab internal\nmingw addon are recommended for ease of use and compatibility with\nMatlab. Other C++ compilers may be used, but need to be compatible\nwith the respective Matlab/Octave version and must be made available\nat runtime to allow the installation script to work. Advanced users\nmay compile the mex files manually using the Matlab mex compiler\ndirectly in the system console, but no active support for this process\nis provided.\n\n#### Linux: Problems with Lapack/MKL using SCIP with IPOPT\n\nThis problem will often manifest with the message:\n\n'Intel MKL ERROR: Parameter 5 was incorrect on entry to DSYEV.'\n\nMatlab under Linux ships with a MKL version that replaces Blas, but is\ncompiled with 64 Bit integers. The dynamic shared object loader will\nreplace the Lapack/Blas implementation used by IPOPT by this MKL. If\nIPOPT uses a 32 Bit version, this causes a crash.\n\nThere does not seem to exist a nice and easy solution, but the following two\nmight work for you:\n\n- You can tell the system to use the Lapack versions that were used by IPOPT with\n\n  `LD_PRELOAD=/path/to/Lapack/liblapack.so matlab`\n\n  Possibly further shared libraries have to be added.\n\n  This solution seems to work, but has the price that all comands in\n  Matlab that use Lapack will fail (because they do not use MKL\n  anymore). In particular, eigenvalue comutations will fail.\n\n- You can build IPOPT using static versions of Lapack and possibly\n  linear algebra packages like Mumps. We have tested this under Ubuntu\n  16.04 with the 'stable/3.14' version of Ipopt and Ubuntu Mumps\n  packages. Then one needs to build a static version of Ipopt using\n  the static versions of Mumps. This can for example be done as\n  follows:\n\n  `./configure --prefix=\u003cyour install directory\u003e --with-lapack --with-lapack-lflags=\"/usr/lib/liblapack.a /usr/lib/libblas.a /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.so /usr/lib/x86_64-linux-gnu/libm.so\" --with-mumps --with-mumps-lflags=\"/usr/lib/libdmumps_seq.a /usr/lib/libmumps_common_seq.a /usr/lib/libmpiseq_seq.a /usr/lib/libpord_seq.a\" --with-mumps-cflags=\"-I/usr/include/mumps_seq\" --enable-static --disable-shared --enable-shared=no --enable-relocatable`\n\n  Clearly, the paths need to be adjusted to your machine and you might\n  want to use the parallel verison of Mumps (remove 'libmpiseq' and\n  remove '_seq' from the library names). Then building SCIP with\n\n  'make IPOPT=true SHARED=true USRLDFLAGS=-Wl,-Bsymbolic'\n\n  creates 'libscip.so' with no outside dependencies to Lapack or Blas.\n\n- For SCIP-SDP starting from Version 4.3 you should use\n  \"make ... LAPACKLONG=true\" or\n  \"cmake ... -DLAPACKLONG=on\"\n  to use switch to \"long long int\" in the Lapack interface within SCIP-SDP.\n\nAny further solution options are welcome.\n\n#### Error after compilation\n\nOne possible error is:\n\n`Error: Error Compiling SCIP! '/path/to/mexfile.mexext' is not a MEX file. For more information, see File is not a MEX file.`\n\nThis is a possible false-positive and can usually be ignored. It\noccurs, if the mex-extension of the mex file does not fit your system,\nor the mex-File is not recognized.  On some Linux distributions this\nerror occurs despite successfully compiling a fully functional\nmex-File.\n\n#### MEX file is not compatible with this version of the Interface\n\nIf this error is encountered, the mex file could not be determined to\nbe working.  Most likely because the links in your mex-call were not\nworking correctly. If the mex command generated a mex-file, you can\ncheck the specific error by evaluating the mex-File using the command:\n\n `eval scip`\n\n#### GLIBCXX not found\n\nEvaluating the mex-File results in:\n\n`Invalid MEX-file '/path/to/mexfile.mexext': path/to/matlab/libstdc++.so: version 'GLIBCXX_x.x.xx' not found (required by /path/to/scipinstall/lib/libscip.so).`\n\nThis error is encountered on some Linux systems using the default\ncmake-install.  It is caused by Matlab using its own separate standard\nC++ library.  To circumvent this error you can inject your systems\n``libstdc++`` by starting Matlab using the command\n\n `LD_PRELOAD=/path/to/system/libstdc++.so matlab`\n\nso that Matlab prefers your system's C++ standard library over its\nown. This has to be repeated every time you launch\nMatlab. Alternatively consider statically linking SCIP to your systems\n`libstdc++` file, to prevent this conflict.\n\n#### Symbol lookup error undefined symbol\n\nErrors like this typically occur if one of the links in the mex call\nis broken. Please check the mex call made by Matlab during the\ninstallation and verify that all paths and filenames are set correctly\nand that the referenced files are working as intended.\n\n#### Saving path changes\n\nMatlab saves changes to the path in a file called `pathdef.m` located\nin the install folder of Matlab. Depending on your enivronment, the\nMatlab instance might not have permission to write to this\nfile. Usually Matlab will create a root directory for each user\n(e.g., `/home/username/Documents/MATLAB`), where a custom `pathdef.m`\nfile can be placed (see\n[searchpath](https://de.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html)\nand\n[savepath](https://de.mathworks.com/help/matlab/ref/savepath.html)).\nAlternatively a startup.m file can be used to add new paths when\nrestarting Matlab (see\n[startup](https://de.mathworks.com/help/matlab/ref/startup.html)).\nFor determining which paths are needed in a startup file, refer to the\nfile `ReAddPaths.m`.\n\n\n## Matlab-SCIPSDP Interface\n\nMost comments for the Matlab-SCIP interface also apply to the\nMatlab-SCIP-SDP interface.\n\nEnsure that you are using the latest version of\n[SCIP](https://www.scipopt.org/) and see the comments above.  Ensure\nthat you are using the latest version of\n[SCIPSDP](http://www.opt.tu-darmstadt.de/scipsdp/).  The installation\nprocess currently supports make installs of SCIPSDP on both Linux and\nWindows platforms.  Make sure that you build the program with shared\nlibraries (see above). The mex compilation process is currently\nincompatible with static libraries. To specify the install location,\nyou can either permanently set the environment variable `SCIPSDPDIR`\nto the SCIP-SDP directory or specify the source directory during the\ninstallation process.\n\nPlease refer to the Troubleshooting section of the Matlab-SCIP\ninterface above.\n\n## License\n\nThe original OPTI toolbox was released under the 3-clause BSD\nlicense. The changes and extensions of this interface are released\nunder the same license, as detailed in the file LICENSE. It is free\nsoftware, and is released as an open-source package. Note that SCIP\nand SCIP-SDP are released under the Apache 2.0 license.\n\n## Authors\n\nThis interface is based on the OPTI Toolbox by Jonathan Currie. He\nwrote most of the Matlab-code. The interface has been adpated and\nextended by Nicolai Simon and Marc Pfetsch, TU Darmstadt.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fmatlabscipinterface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscipopt%2Fmatlabscipinterface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fmatlabscipinterface/lists"}