Trouble installing "communications"-package

Need help with package installation. I’m getting following message:

octave:7> pkg install -forge communications
C:/Users/radio/AppData/Local/Programs/GNU: line 1: [Paths]: command not found
C:/Users/radio/AppData/Local/Programs/GNU: line 2: Octave/Octave-6.2.0/: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 3: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 4: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 5: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 6: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 7: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 1: [Paths]: command not found
C:/Users/radio/AppData/Local/Programs/GNU: line 2: Octave/Octave-6.2.0/: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 3: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 4: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 5: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 6: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 7: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 1: [Paths]: command not found
C:/Users/radio/AppData/Local/Programs/GNU: line 2: Octave/Octave-6.2.0/: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 3: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 4: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 5: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 6: OctaveOctave-6.2.0\binqt.conf: No such file or directory
C:/Users/radio/AppData/Local/Programs/GNU: line 7: OctaveOctave-6.2.0\binqt.conf: No such file or directory
configure: error: in `/d/octave/temp/oct-jcWr2k/communications-1.2.2/src':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
configure: loading site script /usr/local/etc/config.site
checking for mkoctfile... C:/Users/radio/AppData/Local/Programs/GNU Octave/Octave-6.2.0/mingw64/bin/mkoctfile-6.2.0.exe
checking for octave... C:/Users/radio/AppData/Local/Programs/GNU Octave/Octave-6.2.0/mingw64/bin/octave-6.2.0.bat
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking   gripe_nonconformant or octave::err_nonconformant...   gripe_nonconformant
checking   gripe_wrong_type_arg or err_wrong_type_arg...   gripe_wrong_type_arg
checking   gripe_square_matrix_required or err_square_matrix_required...   gripe_square_matrix_required
checking   gripe_invalid_conversion or err_invalid_conversion...   gripe_invalid_conversion
checking   gripe_implicit_conversion or warn_implicit_conversion...   gripe_implicit_conversion
checking   flush_octave_stdout or octave::flush_stdout...   flush_octave_stdout
checking   is_complex_type or iscomplex...   is_complex_type
checking   is_real_type or isreal...   is_real_type
checking   is_numeric_type or isnumeric...   is_numeric_type
checking   is_empty or isempty...   is_empty
checking   oct_mach_info::float_format or octave::mach_info::float_format...   oct_mach_info::float_format
checking how to run the C++ preprocessor... /lib/cpp

error: pkg: error running the configure script for communications.
error: called from
    configure_make at line 93 column 9
    install at line 196 column 7
    pkg at line 568 column 9

It looks like the configure script of the “communication” package has issues if paths contain spaces.

However, the communication package is already part of Octave’s installer on Windows. So, you only need to load it with pkg load communication and it should be working.

just adding to what @mmuetzel said, please see the following page on the wiki for details about packages included in the windows build.

https://wiki.octave.org/Octave_for_Microsoft_Windows

Thank you both for the prompt response. :+1:

How do I solve this in Mac OS:

I get a similar error

>> ver
----------------------------------------------------------------------
GNU Octave Version: 6.2.0 (hg id: 5cfdf97c5350)
GNU Octave License: GNU General Public License
Operating System: Darwin 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64
----------------------------------------------------------------------
Package Name    | Version | Installation directory
----------------+---------+-----------------------
       control  |   3.2.0 | /Users/fayaz/octave/control-3.2.0
linear-algebra  |   2.2.3 | /Users/fayaz/octave/linear-algebra-2.2.3
        signal  |   1.4.1 | /Users/fayaz/octave/signal-1.4.1
      symbolic  |   2.9.0 | /Users/fayaz/octave/symbolic-2.9.0
>> pkg install -forge communications
configure: error: hdf5 not found
checking for mkoctfile... /opt/homebrew/Cellar/octave/6.2.0_3/bin/mkoctfile-6.2.0
checking for octave... /opt/homebrew/Cellar/octave/6.2.0_3/bin/octave-6.2.0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking   gripe_nonconformant or octave::err_nonconformant... octave::err_nonconformant
checking   gripe_wrong_type_arg or err_wrong_type_arg... err_wrong_type_arg
checking   gripe_square_matrix_required or err_square_matrix_required... err_square_matrix_required
checking   gripe_invalid_conversion or err_invalid_conversion... err_invalid_conversion
checking   gripe_implicit_conversion or warn_implicit_conversion... warn_implicit_conversion
checking   flush_octave_stdout or octave::flush_stdout... octave::flush_stdout
checking   is_complex_type or iscomplex... iscomplex
checking   is_real_type or isreal... isreal
checking   is_numeric_type or isnumeric... isnumeric
checking   is_empty or isempty... isempty
checking   oct_mach_info::float_format or octave::mach_info::float_format... octave::mach_info::float_format
checking how to run the C++ preprocessor... clang++ -std=gnu++11 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking octave/oct.h usability... yes
checking octave/oct.h presence... yes
checking for octave/oct.h... yes
checking octave/base-lu.h usability... no
checking octave/base-lu.h presence... no
checking for octave/base-lu.h... no
checking octave/lu.h usability... yes
checking octave/lu.h presence... yes
checking for octave/lu.h... yes
checking octave/gripes.h usability... no
checking octave/gripes.h presence... no
checking for octave/gripes.h... no
checking octave/errwarn.h usability... yes
checking octave/errwarn.h presence... yes
checking for octave/errwarn.h... yes
checking octave/ovl.h usability... yes
checking octave/ovl.h presence... yes
checking for octave/ovl.h... yes
checking octave/oct-obj.h usability... no
checking octave/oct-obj.h presence... no
checking for octave/oct-obj.h... no
checking octave/ls-oct-ascii.h usability... no
checking octave/ls-oct-ascii.h presence... no
checking for octave/ls-oct-ascii.h... no
checking octave/ls-oct-text.h usability... yes
checking octave/ls-oct-text.h presence... yes
checking for octave/ls-oct-text.h... yes
checking for octave/oct-obj.h... (cached) no
checking octave/interpreter.h usability... yes
checking octave/interpreter.h presence... yes
checking for octave/interpreter.h... yes
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for HDF5... no
checking for H5Fopen in -lhdf5... no

error: pkg: error running the configure script for communications.
error: called from
    configure_make at line 93 column 9
    install at line 196 column 7
    pkg at line 568 column 9
>>

That looks like a different error to me. (Please, open a new topic in such a case in the future.)

The configure output says that you don’t have a version of hdf5 installed on your system:

configure: error: hdf5 not found

I’m guessing that you are using Octave installed via homebrew. In that case, try installing the hdf5 package:

brew install hdf5

Does installing the communications package in Octave work after that?

Thank you for the prompt response.

I did have hdf5 installed earlier as well. The error persists

 % brew install hdf5
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 10 formulae.
==> Renamed Formulae
badtouch -> authoscope

Warning: hdf5 1.12.0_4 is already installed and up-to-date.
To reinstall 1.12.0_4, run:
  brew reinstall hdf5

I don’t have a system running macOS and can’t experiment myself.
But maybe you could try setting the environment variables CPPFLAGS to the folder that contains the hdf5 headers and LDFLAGS to the folder that contains the libraries.
I don’t know where homebrew installs those. The commands could maybe look similar to these:

setenv('CPPFLAGS', '-I/usr/local/opt/hdf5/include')
setenv('LDFLAGS', '-L/usr/local/opt/hdf5/lib')

Does the configure script detect the library after those environment variables are set (from the Octave prompt)?

Thank you so much.

Setting the env variables mentioned above helped.

>> pkg list
Package Name    | Version | Installation directory
----------------+---------+-----------------------
communications  |   1.2.3 | /Users/fayaz/octave/communications-1.2.3
       control  |   3.2.0 | /Users/fayaz/octave/control-3.2.0
linear-algebra  |   2.2.3 | /Users/fayaz/octave/linear-algebra-2.2.3
        signal  |   1.4.1 | /Users/fayaz/octave/signal-1.4.1
      symbolic  |   2.9.0 | /Users/fayaz/octave/symbolic-2.9.0