Opened 10 years ago

Closed 10 years ago

#45003 closed defect (worksforme)

Cannot install control package in Octave 3.8.1 on Mac OSX

Reported by: MacPorts@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc:
Port: octave octave-control

Description

After MacPorts upgraded octave to 3.8.1, octave could no longer load the .oct files that came with the control package. (There was no path problem, but dlopen() failed anyway, with "Reason: image not found", but the binary file was there, dated April 18, meaning it's the same one that used to work.) I uninstalled octave* and rebuilt like this (as I usually do):

> uname -a 
Darwin mycomputer.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64 
> sudo port install -f octave +fltk +atlas +gcc48 
... 
---> No broken files found. 
> port list installed | grep octave 
octave @3.8.1 math/octave 
> octave 
... 
octave:1> help tf 
error: help: the 'tf' function belongs to the control package from Octave Forge which 
seems to not be installed in your system. 
... 
octave:1> pkg -forge install control 
/bin/sh: line 0: cd: sltmp: No such file or directory 
gfortran-mp-4.8: error: *.f: No such file or directory 
gfortran-mp-4.8: fatal error: no input files 
compilation terminated. 
ar: ./sltmp/*.o: No such file or directory 
make: *** [slicotlibrary.a] Error 1 
tar -xzf slicot.tar.gz 
mkdir sltmp 
mv slicot/src/*.f ./sltmp 
mv slicot/src_aux/*.f ./sltmp 
cp TG04BX.fortran ./sltmp/TG04BX.f 
cd sltmp; /opt/local/bin/mkoctfile-3.8.1 -c *.f 
ar -rc slicotlibrary.a ./sltmp/*.o 
pkg: error running `make' for the control package. 
error: called from 'configure_make' in file /opt/local/share/octave/3.8.1/m/pkg/private/configure_make.m near line 82, column 9 
error: called from: 
error: /opt/local/share/octave/3.8.1/m/pkg/private/install.m at line 199, column 5 
error: /opt/local/share/octave/3.8.1/m/pkg/pkg.m at line 394, column 9 
octave:1> exit 
> sudo port install octave-control 
... 
---> Activating octave-control @2.6.0_0 
... 
---> No broken files found. 
> octave 
octave:1> tf(1) 
error: tf: /opt/local/lib/octave/packages/control-2.6.0/x86_64-apple-darwin13.0.0-api-v48+/is_real_matrix.oct: failed to load: dlopen(/opt/local/lib/octave/packages/control-2.6.0/x86_64-apple-darwin13.0.0-api-v48+/is_real_matrix.oct, 2): Library not loaded: /opt/local/lib/octave/3.6.4/liboctinterp.1.dylib 
Referenced from: /opt/local/lib/octave/packages/control-2.6.0/x86_64-apple-darwin13.0.0-api-v48+/is_real_matrix.oct 
Reason: image not found 
error: called from: 
error: /opt/local/share/octave/packages/control-2.6.0/@tf/tf.m at line 200, column 7 
octave:1> ls -l /opt/local/lib/octave/packages/control-2.6.0/x86_64-apple-darwin13.0.0-api-v48+/is_real_matrix.oct 
-rwxr-xr-x 1 root admin 30716 Nov 29 2013 /opt/local/lib/octave/packages/control-2.6.0/x86_64-apple-darwin13.0.0-api-v48+/is_real_matrix.oct 

I originally reported this to the GNU Octave bugtracker, and got this reply: ... "With either Octave 3.8.1 and 3.8.2 compiled manually on Mavericks I cannot reproduce your problem so this appears to be a MacPorts rather than an Octave problem:"

>> pkg install -forge control 
For information about changes from previous versions of the control package, run 'news control'. 
>> tf (1) 

Transfer function 'ans' from input 'u1' to output ... 
y1: 1 
Static gain. 
>> version 
ans = 3.8.1 

"... If I have to guess, though, a possible cause could be mixing clang and gfortran which, according to my experience, never worked properly on OSX. When building OSX binaries I use gcc for Octave and ALL its dependencies. In MacPorts you can do that by specifying the gccXX variant when available or specifying the compiler explicitly."

Change History (8)

comment:1 Changed 10 years ago by MacPorts@…

Cc: MacPorts@… added

Cc Me!

comment:2 Changed 10 years ago by MacPorts@…

In my original post to GNU Octave, I had octave-control-2.4.1 installed, and the failing file date was April 18 for that. The output above is for octave-control-2.6.0, where the file date is clearly Nov 29. The behavior was identical for both octave-control versions. (Just to head off any possible confusion...)

comment:3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: MacPorts@… removed
Keywords: octave control removed

Please note that "port list installed" does not do what you think it does; see wiki:FAQ#portlist.

comment:4 Changed 10 years ago by MacPorts@…

I downloaded the latest octave-control package from Octave Forge, and it fails to make as follows:

> cd control/src
> make
tar -xzf slicot.tar.gz
mkdir sltmp
mv slicot/src/*.f ./sltmp
mv slicot/src_aux/*.f ./sltmp
cp TG04BX.fortran ./sltmp/TG04BX.f
cd sltmp; mkoctfile -c *.f
/bin/sh: line 0: cd: sltmp: No such file or directory
gfortran-mp-4.8: error: *.f: No such file or directory
gfortran-mp-4.8: fatal error: no input files
compilation terminated.
ar -rc slicotlibrary.a ./sltmp/*.o
ar: ./sltmp/*.o: No such file or directory
make: *** [slicotlibrary.a] Error 1

This is similar to the "pkg -forge install control" failure. Interestingly, slicotlibrary.a is there, but only 8 bytes, so clearly not really there. I repeated the above by hand and it worked fine, then rewrote the Makefile until it worked also. It appears the problem is simply missing parens to put the mkoctfile line in its own subshell. The following patch works for me (Darwin localhost 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64):

diff -rcb control/src/Makefile control-jos/src/Makefile
*** control/src/Makefile	2014-06-16 12:26:55.000000000 -0600
--- control-jos/src/Makefile	2014-09-17 00:48:12.000000000 -0600
***************
*** 31,37 ****
  	mv slicot/src/*.f ./sltmp
  	mv slicot/src_aux/*.f ./sltmp
  	cp TG04BX.fortran ./sltmp/TG04BX.f
! 	cd sltmp; $(MKOCTFILE) -c *.f
  	ar -rc slicotlibrary.a ./sltmp/*.o
  	rm -rf sltmp slicot
  
--- 31,37 ----
  	mv slicot/src/*.f ./sltmp
  	mv slicot/src_aux/*.f ./sltmp
  	cp TG04BX.fortran ./sltmp/TG04BX.f
! 	(cd ./sltmp; $(MKOCTFILE) -c *.f)
  	ar -rc slicotlibrary.a ./sltmp/*.o
  	rm -rf sltmp slicot

comment:5 Changed 10 years ago by MacPorts@…

Cc: MacPorts@… added

Cc Me!

comment:6 Changed 10 years ago by MacPorts@…

I copied the .oct files where they belong and the failure was the same, which pointed to a missing /opt/local/lib/octave/3.6.4/liboctinterp.1.dylib . It appears the octave-control package is calling for the wrong one, since what was installed by octave is /opt/local/lib/octave/3.8.1/liboctinterp.2.dylib . I tried making an alias using symlinks but it didn't work.

comment:7 Changed 10 years ago by mf2k (Frank Schima)

Cc: MacPorts@… removed
Owner: changed from macports-tickets@… to michaelld@…
Port: octave, octave-controloctave octave-control

In the future, please Cc the port maintainers (port info --maintainers octave octave-control). As reporter, you do not need to Cc yourself.

comment:8 Changed 10 years ago by michaelld (Michael Dickens)

Resolution: worksforme
Status: newclosed

Please use MacPorts to install new stuff, not the build-in methods. Instead of issuing "pkg -forge install control" from within Octave, try "sudo port install octave-control" ... changes are the forge module exists in MacPorts; and, if MacPorts can install it it'll work better this way. If you need a new Octave module that MacPorts does not provide, try creating a new Portfile modeled after one of the existing octave-* modules.

I just updated the octave-control package to 2.6.5 in revision [125649]. It installs cleanly for me as is on OSX 10.8, and I can then do:

octave> pkg load control
octave> pkg unload control

cleanly too.

I think the issue here is not a failure of MacPorts or Octave itself; rather, it's knowing how to use the MacPorts package system to do installations.

I'm closing this ticket as "works for me". If you feel otherwise, please reopen it and provide the log files for octave and octave-control that show otherwise.

Note: See TracTickets for help on using tickets.