octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #56945] mex command does not work, if external


From: anonymous
Subject: [Octave-bug-tracker] [bug #56945] mex command does not work, if external library needs to be linked
Date: Tue, 24 Sep 2019 11:20:22 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?56945>

                 Summary: mex command does not work, if external library needs
to be linked
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 24 Sep 2019 03:20:20 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: MiB_Coder
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Please see the discussion here:

https://stackoverflow.com/questions/57924381/octave-how-to-specify-arguments-for-mkoctfile/58082866#58082866

`mkoctfile` does not escape the arguments properly if they contain spaces and
it does not like backslashes in Octave's own paths. 
It creates the following two commands:

    g++ -c -I/release/mxe-octave-w64/usr/x86_64-w64-mingw32/include 
-IC:\Octave\OCTAVE~1.0\\mingw64\include\octave-5.1.0\octave\..
-IC:\Octave\OCTAVE~1.0\\mingw64\include\octave-5.1.0\octave
-IC:\Octave\OCTAVE~1.0\\mingw64\include   -fopenmp -g -O2   -I. "-IC:\Program
Files (x86)\IVI Foundation\VISA\Winnt\Include"  -DMEX_DEBUG main.cpp -o
C:\Octave\OCTAVE~1.0\tmp/oct-u4r15I.o
    g++ -IC:\Octave\OCTAVE~1.0\\mingw64\include\octave-5.1.0\octave\..
-IC:\Octave\OCTAVE~1.0\\mingw64\include\octave-5.1.0\octave
-IC:\Octave\OCTAVE~1.0\\mingw64\include   -fopenmp -g -O2 -shared
-Wl,-rpath-link,/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/qt5/lib
-Wl,--export-all-symbols  -o main.mex  C:\Octave\OCTAVE~1.0\tmp/oct-u4r15I.o 
-lvisa64.lib  -LC:\Program Files (x86)\IVI Foundation\VISA\Winnt\lib_x64\msc
-LC:\Octave\OCTAVE~1.0\\mingw64\lib\octave\5.1.0
-LC:\Octave\OCTAVE~1.0\\mingw64\lib
-LC:\Octave\OCTAVE~1.0\\mingw64\lib\octave\5.1.0 -loctinterp -loctave 
-Wl,-rpath-link,/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/qt5/lib
-Wl,--export-all-symbols 

When I change it to the following:

  - replace `\` with `/`
  - specify the library name without .lib extension
  - escape `-LC:\Program Files...` to `"-LC:\Program Files..."`

<!-- -->

    g++ -c -I/release/mxe-octave-w64/usr/x86_64-w64-mingw32/include 
-IC:/Octave/OCTAVE~1.0//mingw64/include/octave-5.1.0/octave/..
-IC:/Octave/OCTAVE~1.0//mingw64/include/octave-5.1.0/octave
-IC:/Octave/OCTAVE~1.0//mingw64/include   -fopenmp -g -O2   -I. "-IC:/Program
Files (x86)/IVI Foundation/VISA/Winnt/Include"  -DMEX_DEBUG main.cpp -o
C:/Octave/OCTAVE~1.0/tmp/oct-u4r15I.o  
    g++ -IC:/Octave/OCTAVE~1.0//mingw64/include/octave-5.1.0/octave/..
-IC:/Octave/OCTAVE~1.0//mingw64/include/octave-5.1.0/octave
-IC:/Octave/OCTAVE~1.0//mingw64/include   -fopenmp -g -O2 -shared
-Wl,-rpath-link,/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/qt5/lib
-Wl,--export-all-symbols  -o main.mex  C:/Octave/OCTAVE~1.0/tmp/oct-u4r15I.o
"-LC:/Program Files (x86)/IVI Foundation/VISA/Winnt/lib_x64/msc" -lvisa64
-LC:/Octave/OCTAVE~1.0//mingw64/lib/octave/5.1.0
-LC:/Octave/OCTAVE~1.0//mingw64/lib
-LC:/Octave/OCTAVE~1.0//mingw64/lib/octave/5.1.0 -loctinterp -loctave 
-Wl,-rpath-link,/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/lib
-L/release/mxe-octave-w64/usr/x86_64-w64-mingw32/qt5/lib
-Wl,--export-all-symbols 

It will compile without error. 




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56945>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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