help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkoctave MSVC 2008 Express


From: Michael Goffioul
Subject: Re: mkoctave MSVC 2008 Express
Date: Tue, 11 Mar 2008 10:13:18 +0100

This is a runtime library problem/mismatch, due to the fact that I compiled
the octave binary package with MSVC2005, which uses a different runtime
lib than MSVC2008. This may not be a problem, except for 2 things (at
least):

1) specific runtime objects will not cross DLL boundaries: for instance a
FILE* created in one runtime lib will not be valid in the other one

2) runtime lib location/finding (the problem you actually have): WinXP uses
a mechanism based on manifest files to find and load the correct runtime
lib. This new mechanism allows MS to have several versions of the same
library installed side-by-side; the manifest file is then a XML file stating
which version of the DLL should be loaded for a given executable. There
2 ways to deal with manifest files:
    - the manifest file is a separate file installed along the executable: for
      an executable called prog.exe, the manifest file is prog.exe.manifest
    - the manifest file is embedded into the executable; I use this option to
      create the binary package as it does not require installing additional
      files. As a consequence, octave.exe is "ready" to find and load the
      MSVC2005 runtime libs (msvcr80.dll and msvcp80.dll); but it is not
      ready for the MSVC2009 runtime libs.

DLL's that uses this mechanism are located in a subdir of C:\WINDOWS\WinSxS,
which is the location you should look for when searching for msvcp90.dll. The
DLL's found in the MSVC2009 installation dir are just provided for
redistribution.
However, you can't just add the DLL dir to your PATH variable, this is not the
way WinXP expects to load those libs and it ends up with the error you see.
The correct way is through manifest files.

Now, having said that, I'm not sure if there's a way to solve your
problem: using
MSVC2008 with the binary package that is compiled with MSVC2005. The only
way I can think of is to provide a manifest file
(octave.exe.manifest); but even that
I'm not sure it'll work, because octave.exe has already an embedded manifest
file. However, here's what you can try:

1) create a file test.c with this content:

int main(void) { return 0; }

2) compile this file with: cl -MD test.c

3) this creates a manifest file test.exe.manifest

4) copy the manifest file as: <octave_root>\bin\octave.exe.manifest

5) restart octave and try again

The other solution is to rebuild octave with MSVC2008. If anybody wants to give
it a try, there is a compilation script in octave-forge
(admin/Windows/msvc/run_compilation.sh)
that automates almost everything, including downloading and compiling
dependencies.

Michael.

2008/3/11 Tatsuro MATSUOKA <address@hidden>:
> Dear Huaizu You
>
>  I first ask you that you to subscribe to address@hidden from
>
>  https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>  Because this is complicated problem so that only I myself cannot solve this.
>  So you should be involved in the open discussion as a questioner.
>
>  ****
>  This time, I have also failed.
>  I cannot figure out why my first trail was successful.
>
>  I checked the oregonator.oct created in the same directry in testOrego2.m.
>
>  So I executed
>
>  octave>testOrego2
>  The windows message
>  "msvcp90.dll was not found" .....
>  appeared.  I passed by it and get the error in octave screen pointed out 
> from the questioner
>
>  >> error: could not find library or dependents: 
> C:\xxxxx\octave\oregonator.oct
>  >> error: lsode: expecting first argument to be a string
>  >> error: evaluating assignment expression near line 6, column 3
>  >> error: near line 6 of file 'C:\xxxx\octave\testOrego2.m'
>
>
>  I checked where msvcp90.dll is.
>  The msvcp90.dll exists in
>  "C:\Program Files\Microsoft Visual Studio 
> 9.0\VC\redist\x86\Microsoft.VC90.CRT"
>
>  I checked the path that "vcvarsall.bat" created
>
>  PATH=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program 
> Files\Microsoft Visual Studio
>  9.0\VC\BIN;C:\Program Files\Microsoft Visual Studio
>  
> 9.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program
>  Files\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program Files\Microsoft
>  SDKs\Windows\v6.0A\bin;c:\program
>  
> files\imagemagick-6.3.5-q8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program
>  Files\Microsoft SQL 
> Server\90\Tools\binn\;D:\usr\Tatsu\program\ScriptTools;C:\Program
>  Files\ckw;C:\Program Files\gawk-mbcs-win32-20070407;C:\Program 
> Files\wscite;C:\Program
>  Files\Hidemaru;C:\Program 
> Files\gnuplot-43pl0w32\gnuplot;C:\gs\gs8.60\bin;C:\gs\gs8.60\lib
>
>  There is no
>  "C:\Program Files\Microsoft Visual Studio 
> 9.0\VC\redist\x86\Microsoft.VC90.CRT".
>
>  So I added to
>  add path to
>  "C:\Program Files\Microsoft Visual Studio 
> 9.0\VC\redist\x86\Microsoft.VC90.CRT"
>
>  *****
>  @echo off
>  "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" > nul
>  path %path%;C:\Program Files\Microsoft Visual Studio 
> 9.0\VC\redist\x86\Microsoft.VC90.CRT
>  rem "C:\Programs\Octave-3.0.0" is the folder where the octave has been 
> installed.
>  "C:\Programs\Octave-3.0.0\bin\octave"
>  **************
>
>  path %path%;C:\Program Files\Microsoft Visual Studio 
> 9.0\VC\redist\x86\Microsoft.VC90.CRT
>  is added.
>
>  After that I tried
>  octave>testOrego2
>
>
>  This time, another runtime error occurred.
>  ++++++++++++++++++++++++++++++
>  Runtime Error!
>
>  Program: C:\Programs\Octave-3.0.0\bin\octave.exe
>
>  R6034
>  An application has made an attempt to load the Cruntime library incorrectly.
>  Please contact the application's support team for more information.
>  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>  I remember the threds.
>
>  
> http://www.nabble.com/FW%3ARe%3A-note-for-mkoctfile-for-MSVC-%28MSVC2008%29-tt15126532.html#a15126532
>
>  In addtion, I cannot find the reason why my first trial was no problem.
>  Perhaps something is different but I cannot find the reason at the moment.
>
>  Regards
>
>  Tatsuro
>
>  ******************
>  Message from the questioner
>  ******************
>  "Huaizu You <address@hidden>" wrote
>
>
>  >Dear Prof. Matsuoka
>  >
>  >I tried the attachment, and still the same error showed up. Though I don't 
> understand why it can't
>  work, I got a clue which might be the cause of failure. When I typed 'help 
> oregonator' in Octave, it
>  showed up an error message:
>  >error: could not find library or dependents: C:\Documents and 
> Settings\hyou\octave\oregonator.oct
>  >
>  >It is strange that in that directory there is the oregonator.oct file and 
> all others oregonator.lib,
>  oregonator.exp, but it just can't find the library. I was thinking maybe 
> it's because the white space
>  in the path that results in the failure of searching. However, if so, why 
> can I successfully compile
>  the .cc file to .oct file using mkoctfile? It indeed generated the 
> oregonator.oct from oregonator.cc.
>  >
>  >Or is it because there is something different between Octave-Forge-3.0.0 
> and Octave-MSVC-3.0.0? I
>  installed octave forge 3.0.0 for Windows. And when I clicked on the link of 
> downloading octave-msvc,
>  it also directed to octave forge for Windows.
>  >
>  >Thank you very much for spending time understanding my problem and helped 
> me solved it. I appreciate
>  your help.
>  >
>  >
>  >Best regards,
>  >Huaizu You
>  >
>  >-----Original Message-----
>  >From: Tatsuro MATSUOKA [mailto:address@hidden
>  >Sent: Saturday, March 08, 2008 12:10 AM
>  >To: Huaizu You
>  >Cc: address@hidden; 松岡辰郎
>  >Subject: Re: mkoctave MSVC 2008 Express
>  >
>  >Hello
>  >
>  >Thank you for your looking for my page
>  >Mmmm....
>  >I have tested that the what was decribed worked.
>  >
>  >> error: lsode: expecting first argument to be a string
>  >Is there any typing mistake in testOrego2.m?
>  >The error said that the octave recognised the testOrego2.m but the script 
> file has a bug.
>  >
>  >Please try the file attached.
>  >
>  >Regards
>  >
>  >Tatsuro
>  >
>  >--- Huaizu You <address@hidden> wrote:
>  >
>  >> Dear Prof. Matsuoka,
>  >>
>  >> I tried your method of making OCT files on octave from your website (
>  >> http://www.geocities.jp/tmoctwin/msvcoct.html ).
>  >> I'm using Microsoft Visual Studio 2008 Express, and Forge Octave 3.0.0. 
> The startup batch file
>  >> ran successfully, and so did the mkoctfile command which generated 
> oregonator.lib,
>  >> oregonator.exp, oregonator.o, and oregonator.oct files in the same folder 
> as oregonator.cc and
>  >> testOrego2.m. (My current path was exactly the folder which contained 
> oregonator.cc and
>  >> testOrego2.m) However, later when I tried to run testOrego2.m on Octave, 
> it kept saying
>  >>
>  >> error: could not find library or dependents: 
> C:\xxxxx\octave\oregonator.oct
>  >> error: lsode: expecting first argument to be a string
>  >> error: evaluating assignment expression near line 6, column 3
>  >> error: near line 6 of file 'C:\xxxx\octave\testOrego2.m'
>  >>
>  >> Can you figure out what is the problem? I appreciate your help.
>  >>
>  >> Sincerely,the
>  >> Huaizu You
>
>
>
>  --------------------------------------
>  Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
>  http://pr.mail.yahoo.co.jp/toolbar/
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]