building on macOS?

classic Classic list List threaded Threaded
56 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

bpabbott
Administrator
On Dec 20, 2018, at 7:59 PM, Carlo De Falco <[hidden email]> wrote:

On 20 Dec 2018, at 12:36, Ben Abbott <[hidden email]> wrote:

Hi Carlo,

I assume it is still necessary to install Octave in order to build oct-files? I typically only install using homebrew.

Sebastian / Andrew,

Do you have a port that I can tap which will build using the latest sources?

Ben

Yes, I think you need to install to test this ...
But you could also just share the file src/mkoctfile.cc from your build directory as the wrong flags are set in there for me.

c.

Hi Carlo, the mkoctfile.cc is attached.
Ben




mkoctfile.cc (65K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 20 Dec 2018, at 13:25, Ben Abbott <[hidden email]> wrote:
>
> Hi Carlo, the mkoctfile.cc is attached.
> Ben


Ben,

Yes, it seems the issue exists for you too:


line 304: vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
                                                "libinterp/liboctinterp.la liboctave/liboctave.la ");

By comparison in Octave 4.4.1 I have

line 248 :   vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
                                        " ");

Thanks,
c.




Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 20 Dec 2018, at 13:35, Carlo De Falco <[hidden email]> wrote:
>
>
>
>> On 20 Dec 2018, at 13:25, Ben Abbott <[hidden email]> wrote:
>>
>> Hi Carlo, the mkoctfile.cc is attached.
>> Ben
>
>
> Ben,
>
> Yes, it seems the issue exists for you too:
>
>
> line 304: vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
>                                                "libinterp/liboctinterp.la liboctave/liboctave.la ");
>
> By comparison in Octave 4.4.1 I have
>
> line 248 :   vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
>                                        " ");
>
> Thanks,
> c.
>

You should also see the same if you move to src in the build directory and type:

./mkoctfile -p OCT_LINK_DEPS

Now that I think about it, you can probably test without installing if you do the following from within your build direcoty:

cd src
echo -e "#include <octave/oct.h>\n DEFUN_DLD(pippo, args, nargout, \"\") { return octave_value_list(); }" > pippo.cc
./mkoctfile -v pippo.cc

c.



Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

bpabbott
Administrator
> On Dec 20, 2018, at 20:53, Carlo De Falco <[hidden email]> wrote:
>
>> On 20 Dec 2018, at 13:35, Carlo De Falco <[hidden email]> wrote:
>>
>>> On 20 Dec 2018, at 13:25, Ben Abbott <[hidden email]> wrote:
>>>
>>> Hi Carlo, the mkoctfile.cc is attached.
>>> Ben
>>
>>
>> Ben,
>>
>> Yes, it seems the issue exists for you too:
>>
>>
>> line 304: vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
>>                                               "libinterp/liboctinterp.la liboctave/liboctave.la ");
>>
>> By comparison in Octave 4.4.1 I have
>>
>> line 248 :   vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
>>                                       " ");
>>
>> Thanks,
>> c.
>>
>
> You should also see the same if you move to src in the build directory and type:
>
> ./mkoctfile -p OCT_LINK_DEPS
>
> Now that I think about it, you can probably test without installing if you do the following from within your build direcoty:
>
> cd src
> echo -e "#include <octave/oct.h>\n DEFUN_DLD(pippo, args, nargout, \"\") { return octave_value_list(); }" > pippo.cc
> ./mkoctfile -v pippo.cc
>
> c.

Can that be turned into a test?

Ben

Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


Il giorno gio 20 dic 2018, 14:10 Ben Abbott <[hidden email]> ha scritto:
> On Dec 20, 2018, at 20:53, Carlo De Falco <[hidden email]> wrote:
>

> You should also see the same if you move to src in the build directory and type:
>
> ./mkoctfile -p OCT_LINK_DEPS
>
> Now that I think about it, you can probably test without installing if you do the following from within your build direcoty:
>
> cd src
> echo -e "#include <octave/oct.h>\n DEFUN_DLD(pippo, args, nargout, \"\") { return octave_value_list(); }" > pippo.cc
> ./mkoctfile -v pippo.cc
>
> c.

Can that be turned into a test?

Ben

That would be nice but I'm not sure how that could be done.

If someone knows that it would be very interesting to learn.

c.
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

apjanke-floss
In reply to this post by bpabbott


On 12/20/18 6:36 AM, Ben Abbott wrote:

>> On Dec 19, 2018, at 10:59 PM, Carlo De Falco <[hidden email]> wrote:
>>
>>> On 19 Dec 2018, at 14:56, Ben Abbott <[hidden email]> wrote:
>>> Hi Pantxo,
>>>
>>> The patch for bug #55226 didn’t help with this.
>>>
>>> Ben
>> Hi Ben,
>>
>> As you tested this I assume you managed to build a recent development release on macos?
>> Can you also confirm whether or not bug #55033 ( https://savannah.gnu.org/bugs/?55033 )still exists?
>>
>> Thanks,
>> c.
> Hi Carlo,
>
> I assume it is still necessary to install Octave in order to build oct-files? I typically only install using homebrew.
>
> Sebastian / Andrew,
>
> Do you have a port that I can tap which will build using the latest sources?
>
> Ben
>
Yep!

brew tap octave-app/octave-app-bases
brew unlink octave   # if you have a regular Octave installed already
brew install -s octave-head

Then if you have a build error and want to share your full build logs:

brew gist-logs octave-head

Cheers,
Andrew


Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Mike Miller-4
In reply to this post by Carlo de Falco-2
On Thu, Dec 20, 2018 at 14:21:51 +0100, Carlo de Falco wrote:
> That would be nice but I'm not sure how that could be done.
>
> If someone knows that it would be very interesting to learn.

This isn't safe to run without running 'make install' first because the
Octave header files are not yet where they should be. There is no
problem running mkoctfile from the build tree, but there is no guarantee
that the $octincludedir exists.

One would have to add a lot of -I options to the command line to ensure
that all Octave header files are found, and the <octave/oct.h> form
would not work at all.

That said, if someone can figure out how to make this work, this would
be a nice feature to have.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Mike Miller-4
On Thu, Dec 20, 2018 at 08:42:28 -0800, Mike Miller wrote:
> That said, if someone can figure out how to make this work, this would
> be a nice feature to have.

For example, for a trivial oct file like this

    #include <oct.h>
    DEFUN_DLD (example, , , "")
    {
      return ovl ();
    }

The command line on my system needs to use the following at a minimum

    ./src/mkoctfile \
      -I. \
      -I.. \
      -I../libinterp/corefcn \
      -I../libinterp/octave-value \
      -I../liboctave/array \
      -I../liboctave/numeric \
      -I../liboctave/operators \
      -I../liboctave/system \
      -I../liboctave/util \
      -Iliboctave/operators \
      -Iliboctave \
      example.cc

But with that, the oct file is created and works correctly.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 20 Dec 2018, at 17:56, Mike Miller <[hidden email]> wrote:
>
> On Thu, Dec 20, 2018 at 08:42:28 -0800, Mike Miller wrote:
>> That said, if someone can figure out how to make this work, this would
>> be a nice feature to have.
>
> For example, for a trivial oct file like this
>
>    #include <oct.h>
>    DEFUN_DLD (example, , , "")
>    {
>      return ovl ();
>    }
>
> The command line on my system needs to use the following at a minimum
>
>    ./src/mkoctfile \
>      -I. \
>      -I.. \
>      -I../libinterp/corefcn \
>      -I../libinterp/octave-value \
>      -I../liboctave/array \
>      -I../liboctave/numeric \
>      -I../liboctave/operators \
>      -I../liboctave/system \
>      -I../liboctave/util \
>      -Iliboctave/operators \
>      -Iliboctave \
>      example.cc
>
> But with that, the oct file is created and works correctly.

Mike,

you are not building on macos, are you?

What does line 304 in src/mkoctfile.cc look like for you?
The test above works for me with Octave 4.4.1 but fails with 5.0.

My release of the default branch is not very recent, tough.
I'll update and test again.
c.


 

Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 21 Dec 2018, at 14:52, Carlo De Falco <[hidden email]> wrote:
>
> I'll update and test again.

mmmh ... this looks more complicated that expected, I tried building without QT and get a failure when building the docs:

error: __gnuplot_get_var__: Can not make FIFO (Function not implemented)
error: __gnuplot_get_var__: Can not make FIFO (Function not implemented)
error: __gnuplot_get_var__: Can not make FIFO (Function not implemented)
make[2]: *** [doc/interpreter/triplot.eps] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [doc/interpreter/convhull.eps] Error 1
make[2]: *** [doc/interpreter/griddata.eps] Error 1
error: __gnuplot_get_var__: Can not make FIFO (Function not implemented)
make[2]: *** [doc/interpreter/voronoi.eps] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


it seems this is related to the fact that in recent revisions :

>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>> err
err = -1
>> msg
msg = Function not implemented

while in Octave 4.4

>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>> err
err = 0
>> msg
msg =

Any idea what may have broken makefifo?

c.




Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Mike Miller-4
In reply to this post by Carlo de Falco-2
On Fri, Dec 21, 2018 at 13:52:14 +0000, Carlo De Falco wrote:
> you are not building on macos, are you?

Correct, just showing the minimum you would have to do to demonstrate a
working mkoctfile, assuming you get to that point.

> What does line 304 in src/mkoctfile.cc look like for you?

OCT_LINK_DEPS is an empty string.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Mike Miller-4
In reply to this post by Carlo de Falco-2
On Fri, Dec 21, 2018 at 17:20:52 +0000, Carlo De Falco wrote:

> >> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
> >> err
> err = -1
> >> msg
> msg = Function not implemented
>
> while in Octave 4.4
>
> >> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
> >> err
> err = 0
> >> msg
> msg =
>
> Any idea what may have broken makefifo?
This means HAVE_MKFIFO was set to false by your configure run. You'd
have to look into config.log for more details about why that is.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 21 Dec 2018, at 18:37, Mike Miller <[hidden email]> wrote:
>
> On Fri, Dec 21, 2018 at 17:20:52 +0000, Carlo De Falco wrote:
>>>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>>>> err
>> err = -1
>>>> msg
>> msg = Function not implemented
>>
>> while in Octave 4.4
>>
>>>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>>>> err
>> err = 0
>>>> msg
>> msg =
>>
>> Any idea what may have broken makefifo?
>
> This means HAVE_MKFIFO was set to false by your configure run. You'd
> have to look into config.log for more details about why that is.

Hi,

Actually, in my config.log I see :

HAVE_MKFIFO='1'
HAVE_MKFIFOAT='1'

so how come that mkfifo does not work?
Where else shall I look?

Thanks,
c.

Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2


> On 22 Dec 2018, at 21:55, Carlo De Falco <[hidden email]> wrote:
>
>
>
>> On 21 Dec 2018, at 18:37, Mike Miller <[hidden email]> wrote:
>>
>> On Fri, Dec 21, 2018 at 17:20:52 +0000, Carlo De Falco wrote:
>>>>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>>>>> err
>>> err = -1
>>>>> msg
>>> msg = Function not implemented
>>>
>>> while in Octave 4.4
>>>
>>>>> [err, msg] = mkfifo ("/tmp/pippo.fifo", 600);
>>>>> err
>>> err = 0
>>>>> msg
>>> msg =
>>>
>>> Any idea what may have broken makefifo?
>>
>> This means HAVE_MKFIFO was set to false by your configure run. You'd
>> have to look into config.log for more details about why that is.
>
> Hi,
>
> Actually, in my config.log I see :
>
> HAVE_MKFIFO='1'
> HAVE_MKFIFOAT='1'
>
> so how come that mkfifo does not work?
> Where else shall I look?
>
> Thanks,
> c.

Hi Mike,

By enabling QT and applying my patch to add "pause (.1); close all;" after plotting examples,
I managed to complete the build and run your proposed test :

./src/mkoctfile \
     -I. \
     -I.. \
     -I../libinterp/corefcn \
     -I../libinterp/octave-value \
     -I../liboctave/array \
     -I../liboctave/numeric \
     -I../liboctave/operators \
     -I../liboctave/system \
     -I../liboctave/util \
     -Iliboctave/operators \
     -Iliboctave \
     example.cc

but, while at it, I noticed that this, on one hand, will not detect the issue I have with mkoctfile while,
on the other hand, it will always fail without installation (unless a previous installation exists).

It will not detect the issue with mkoctfile on macos because the issue is with adding spurious libs, with
a relative path, to the link phase :

  vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
                                        "libinterp/liboctinterp.la liboctave/liboctave.la ");

these will in general not exist, UNLESS launching mkoctfile from the root of the build tree, which
is what happens with your test.

On the other hand, the link phase of mkoctfile will add "-L" otions to include installation directories to
the library search path that do not exist unless an installation has already been performed, which will cause
mkoctfile to fail with

  ld: warning: directory not found for option '-L/opt/octave/6.0.0/lib'
  ld: file not found: /opt/octave/6.0.0/bin/octave-6.0.0

In conclusion :

1) The mkoctfile issue still exists for me with the most recent revisions in mercurial

2) The only reliable way to check for it at the moment requires to run "make install"

Thanks,
c.

P.S. The mkfifo issue still exists as well, shall I file a bug about it? I suspect it may be related to this changeset
 
changeset:   20200:d9f35ceff9e1
user:        Rik <[hidden email]>
date:        Sun May 17 10:04:08 2015 -0700
summary:     Change mkfifo to use an octal argument for MODE (bug #45054).



Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

bpabbott
Administrator
In reply to this post by Pantxo
On Dec 18, 2018, at 11:43 PM, Pantxo <[hidden email]> wrote:

Did anyone post a bug report about this build failure?

Sorry for the delay. I got around to filling a bug report and including Carlo’s work around.


Ben
Reply | Threaded
Open this post in threaded view
|

Re: building on macOS?

Carlo de Falco-2
In reply to this post by Carlo de Falco-2


> On 23 Dec 2018, at 08:34, Carlo De Falco <[hidden email]> wrote:
>
> P.S. The mkfifo issue still exists as well, shall I file a bug about it?

I submitted this as bug #55273 (https://savannah.gnu.org/bugs/index.php?55273).
c.




123