Is it possible to create a CGI executable which calls a shared library using the MATLAB Compiler to deploy my application on the Web?

조회 수: 2 (최근 30일)
I want to deploy my application on the Web. I want to compile my MATLAB application in to a shared library and write the CGI application in C.

답변 (2개)

Sanchali Purandare
Sanchali Purandare 2011년 1월 16일
Using MATLAB Compiler you can create a shared library which can be called from an executable written in C. This executable can be called by your Web server using the Common Gateway Interface (CGI).
Before attempting the following, you should verify that you have configured your Web server properly in order to run CGI programs, and that you are able to execute a CGI program that is independent of MATLAB. Consult your Web server documentation for how to do this.
An example has been created which demonstrates how to do this. The files for this example are located in the file CGI_Library.zip which can be downloaded from the bottom of this page. Perform the following steps to compile and run this example:
1. Compile the MATLAB file into a shared library. This can be done with the following command in MATLAB:
mcc -B csharedlib:libmymagic mymagic.m
2. Compile the C-file into an EXE-file which links to the library created in step 1. This can be done with the following command in MATLAB:
mbuild magicsquare.c libmymagic.lib
3. Copy HTML file to the Web server and place them in a directory with the proper permissions. Consult your Web server documentation for how to do this.
4. Copy the DLL, EXE, and CTF files to the Web server and place them in the "/cgi-bin" directory of your website. You will need to configure the Web server to have the proper permissions to be able to execute the EXE-file. Consult your Web server documentation for how to do this.
5. Install the MCR on the web server. For more information, see the "Deployment Process" section in the documentation by following the link at the bottom of this page.
6. Execute the application for the first time from the web server system itself in order to force the CTF-archive extraction.
7. Load the HTML-file in a web browser from the remote computer and submit the form to execute the CGI program.
For more information on shared libraries, see the MATLAB Compiler documentation and C shared library example:

Aurelien Queffurust
Aurelien Queffurust 2016년 6월 3일
Sorry where are the files, it is not clear where to find the zip file?

카테고리

Help CenterFile Exchange에서 Application Deployment에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by