Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matlab compiler for Linux 1

Status
Not open for further replies.

Legionaire

Technical User
May 8, 2003
33
US
Ok here's the situation:

I have very complicated programs written in Matlab, windows version. I need to compile those and have it run on a machine using Linux. I do not have a matlab compiler for linux.

Having matlab generate the code and then compiling it on linux using something such as g++ doesn't work because the matlab compiler uses matlab libraries which I don't know how to convert to linux.

Has anyone had this problem before? Any suggestions?
 
I did not see that page, but unfortunately it still does not solve my problem.

I have matlab for windows and I have the matlab compiler for that. What I need to do is get those programs to run on Linux.

Ok, let me rephrase my question.



How do I compile programs on PC running windows, and get it to run properly on linux?

Recompilation is not assumed to be an option because the libraries cannot be transferred to linux.

Also, I can't use any third party software such as wine or whichever to run this executable because it is designed to be directly connected to another larger program.


If you're curious as to why I have to do this. I have many complicated algorithms developed, but the standards for the testing (benchmark) of these algorithms requires linux.
 
no, I said I couldn't use wine.

I need to connect this to a larger system, and I don't think it will work properly if I use wine.
 
What means 'the standards for the testing (benchmark) of these algorithms requires linux'?

If the lib is compiled for win, and you don't have the sources, you may not run it on linux, or you find a very good mathlab-emulation.

If you run wine on linux, your linux-benchmarks will not run in wine, and if you run cygwin, a linux-emulator under win, mathlab will still be in a separate environment, not in the linux-environment.

Perhaps we find a solution, where two computers are working, one running the mathlab, and one the linux-benchmark, with a network-protocol between them?

Since I don't know mathlab I don't know if there is an interface, to do such things. Perhaps an answer to my first question leads us forward...

seeking a job as java-programmer in Berlin:
 
I am working as a research assistant for a professor at my university. We are developing algorithms for image based automatic targeting. There are several other groups researching this topic as well at other universities.

We are funded by the government which just recently contracted another university and another company to develope a benchmark to test these targetting algorithms that we are developing.

But for some strange reason they chose linux as the platform to develope the benchmark on. The benchmark is a large program, which we must connect our algorithms into, whether through direct code editing or black box modules.

Matlab is a high level interpreted language which is very useful for programming complicated mathematical algorithms very easily.


You can compile matlab code but our compiler is on windows, not linux.

So now we have to figure out how to get our programs to run on Linux.

I am just checking around to see if anyone has any experience in this field.
 
Another note is that I cannot rewrite the entire matlab code myself in C++.

There are some extremely complicated functions that we must use from the matlab library such as eigenvector extraction, fast fourier transformations and so on.

The algorithms are too complicated to be rewritten from scratch at this point in a lower level language like C++. We do not have the time for it.

I can translate to C++ from the matlab code automatically by using their compiler toolbox, but there is the big issue of the matlab libraries which are not so easily transferred.

Typically, if you wanted to transfer large programs from PC to Linux, how would you accomplish this?
 
I guess this will be your first test in cross-platform communications.
 
Porting a program from PC to Linux would depend on several questions:

If you don't use a GUI-LIB (mfc, borland? ...) chances are better.
If it was developped with Borland Builder, it might work with Kylix (Borland Linux C++ IDE).

Are there makefiles?

I thought you don't can migrate the libs?

If there are Makefiles, I would run 'make' and 'make -k' ("keep going on error"), look at the errors, group and count them, to evaluate, whether it is possible in time to create a solution.
a) rewriting the code which doesn't work.
b) writing adapter-code for often used Methods.

greping for 'include'-statements, and sorting them could help to give a fast overview.

Perhaps it's more easy to migrate the benchmark-code?

To recapitulate the situation:
Code:
Windows			Windows		linux
-----------       ------------       -------------
| mathlab | <---- | yourCode | <---- | benchmark |
-----------       ------------       -------------
no Source		Source		no Source
with arrows showing dependencies.
Is this correct?

seeking a job as java-programmer in Berlin:
 
Yes steffan, your intepretation is correct.
Except, I have the source for the Linux benchmark.
This is an open source project, it is circulated only to a specially funded group, all members are university research groups.

And my code doesn't depend on matlab code, it is matlab code. Matlab is a language on its own, with it's own libraries. But I can convert some of this code into C++ using the matlab compiler.

I will have to do go through the matlab generate code and try to find the individual include files myself then.

I was hoping for an easier solution, but if there is none then I will get started in this direction.
 
...so your matlab-code depends on the matlab-compiler (which is running on win but available on linux)?
...and generates c++ - code which is in your case dependent on win/c++ - libs/headers?

...and the benchmark-code depends on linux-libs/headers?

So could try to compile the benchmark-code on Win, and see how much work it would be, to convert it, fix incompatibilities.

seeking a job as java-programmer in Berlin:
 
It might be possible to convert the benchmark program to windows but that will take some major effort.

This problem isn't a deadend for us, we are just looking for the simplest solution.

I think I will just work on getting the windows generated C++ code to work on Linux, trying to move the libraries over to linux and so on.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top