Skip to content

Octave extensions#1113

Merged
tgamblin merged 2 commits intospack:developfrom
davydden:octave_extensions
Jun 29, 2016
Merged

Octave extensions#1113
tgamblin merged 2 commits intospack:developfrom
davydden:octave_extensions

Conversation

@davydden
Copy link
Copy Markdown
Member

@davydden davydden commented Jun 24, 2016

UPDATE: does install now, octave seems to pick up the installed package:

octave:1> pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     specfun  |   1.1.0 | /Users/davydden/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/octave-specfun-1.1.0-z4jrho7a7tnkiflm4d6s373yzpavrj3h/specfun-1.1.0
     splines  |   1.2.7 | /Users/davydden/octave/splines-1.2.7

relevant documentation
https://www.gnu.org/software/octave/doc/v4.0.1/Installing-and-Removing-Packages.html
https://www.gnu.org/software/octave/doc/v4.0.1/Command-Line-Options.html#Command-Line-Options

TODO if possible:

  • on uninstallation i need to call octave --eval pkg uninstall <name>. Otherwise octave still consider the package to be installed.

outdated:
I can install packages from Spack's env bash:

$ spack env octave-specfun bash
bash-3.2$ octave --texi-macros-file=/dev/null --eval "pkg install /Users/davydden/Downloads/specfun-1.1.0.tar.gz"

but i can't make it work from within Spack:

$ spack install octave-specfun
==> Installing octave-specfun
==> octave is already installed in /Users/davydden/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/octave-4.0.2-3odgkplg75v5myrzy3bgyme425p64l4j
==> Already downloaded /Users/davydden/spack/var/spack/stage/octave-specfun-1.1.0-z4jrho7a7tnkiflm4d6s373yzpavrj3h/specfun-1.1.0.tar.gz
==> Already staged octave-specfun-1.1.0-z4jrho7a7tnkiflm4d6s373yzpavrj3h in /Users/davydden/spack/var/spack/stage/octave-specfun-1.1.0-z4jrho7a7tnkiflm4d6s373yzpavrj3h
==> No patches needed for octave-specfun
==> Building octave-specfun
==> Error: Install failed for octave-specfun.  Nothing was installed!
==> Error: Installation process had nonzero exit code : 256

whereas from log you see that it did something

==> '/Users/davydden/spack/opt/spack/darwin-elcapitan-x86_64/clang-7.3.0-apple/octave-4.0.2-3odgkplg75v5myrzy3bgyme425p64l4j/bin/octave' '--quiet' '--norc' '--built-in-docstrings-file=/dev/null' '--texi-macros-file=/dev/null' '--eval' 'pkg install /Users/davydden/spack/var/spack/stage/octave-specfun-1.1.0-z4jrho7a7tnkiflm4d6s373yzpavrj3h/specfun-1.1.0.tar.gz'
mkoctfile: stripping disabled on this platform
clang: warning: argument unused during compilation: '-pthread'
warning: function /Users/davydden/octave/specfun-1.1.0/ellipke.m shadows a core library function
warning: function /Users/davydden/octave/specfun-1.1.0/erfcinv.m shadows a built-in function
warning: function /Users/davydden/octave/specfun-1.1.0/expint.m shadows a core library function
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-9OPCdN:13: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-9OPCdN:13: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-9OPCdN:13: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'Ci'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-WRdpHY:13: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-WRdpHY:13: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-WRdpHY:13: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'cosint'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-HeNvrN:6: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-HeNvrN:6: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-HeNvrN:6: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'dirac'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-cnbSxE:14: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-cnbSxE:14: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-cnbSxE:14: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'ellipke'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-FGVA9x:6: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-FGVA9x:6: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-FGVA9x:6: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'erfcinv'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-omRfau:13: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-omRfau:13: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-omRfau:13: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'expint'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XeOy1r:13: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XeOy1r:13: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XeOy1r:13: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'expint_E1'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-u0HNCs:13: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-u0HNCs:13: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-u0HNCs:13: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'expint_Ei'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XHmHqv:18: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XHmHqv:18: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-XHmHqv:18: Misplaced }.
warning: doc_cache_create: unusable help text found in file 'heaviside'
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-ai08hV:27: Unknown command `seealso'.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-ai08hV:27: Misplaced {.
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/octave-help-ai08hV:27: Misplaced }.
warning: doc_cache_create:

and actually installed the package

$ octave
octave:1> pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     specfun  |   1.1.0 | /Users/davydden/octave/specfun-1.1.0
     splines  |   1.2.7 | /Users/davydden/octave/splines-1.2.7
octave:2>

Any advices/ideas?

p.s. ideally fixes #1111

@davydden
Copy link
Copy Markdown
Member Author

@adamjstewart ping.

@adamjstewart
Copy link
Copy Markdown
Member

Looks good to me. Is there a particular file found in the tar that is indicative of Octave extensions? If so one of us can add logic to create.py to automatically detect the build system, add extends('octave'), add the install logic, and prefix the name of the package with "octave-". I'm already working on create.py so I'm willing to do it if you want.

@davydden
Copy link
Copy Markdown
Member Author

judging from the list of packages http://octave.sourceforge.net/packages.php , they are have the same prefix in the url http://downloads.sourceforge.net/octave/<package>-<version>.tar.gz?download. Otherwise, each package appears to unarchive into a single folder inside which there is DESCRIPTION

Name: splines
Version: 1.3.1
Date: 2016-06-02
Author: various authors
Maintainer: Nir Krakauer <[email protected]>
Title: Splines.
Description: Additional spline functions.
Categories: Splines
Depends: octave (>= 3.6.0)
Autoload: no
License: GPLv3+, public domain
Url: http://octave.sf.net

with octave in Depends.

@davydden davydden changed the title [WIP] Octave extensions Octave extensions Jun 27, 2016
@davydden davydden force-pushed the octave_extensions branch from 1332575 to 0faa6dd Compare June 27, 2016 11:45
Octave('--eval', 'pkg install %s' % self.stage.archive_file)
"""
# Octave extension builds can have a global Octave executable function
module.Octave = Executable(join_path(self.spec.prefix.bin, 'octave'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Octave and not octave (like the binary it is tied to)?

@tgamblin tgamblin merged commit 7df8989 into spack:develop Jun 29, 2016
@adamjstewart
Copy link
Copy Markdown
Member

I think spack create can handle the octave build system. I don't really want to expand the file and check the contents, but I think I can search for files from that particular URL. What should the default install() look like for an octave package?

@davydden
Copy link
Copy Markdown
Member Author

@adamjstewart as far as i can tell, this should work for majority of cases

     def install(self, spec, prefix):
         octave('--quiet',
                '--norc',
                '--built-in-docstrings-file=/dev/null',
                '--texi-macros-file=/dev/null',
                '--eval', 'pkg prefix %s; pkg install %s' %
                (prefix, self.stage.archive_file))

.

@adamjstewart
Copy link
Copy Markdown
Member

Will do.

@davydden davydden deleted the octave_extensions branch May 28, 2017 21:01
olupton pushed a commit to olupton/spack that referenced this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[octave] can not install packages

4 participants