bugGNU Octave - Bugs: bug #65497, fits 1.0.7: type cast issue

 
 

bug #65497: fits 1.0.7: type cast issue

Submitter:  Marius Schamschula <mschamschula>
Submitted:  Wed 20 Mar 2024 08:46:50 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 9.1.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 20 Mar 2024 11:16:47 PM UTC, comment #6: 

I think most of fits compile issues are already documented on

61925 57818 55374

John Donoghue <lostbard>
Group Member
Wed 20 Mar 2024 11:13:24 PM UTC, comment #5: 

The released fits package just provides some of the high level functions from the matlab documentation.

cfitsio was a new rewrite and tries to implement both the high and level functionality to mimic the matmab apis.




John Donoghue <lostbard>
Group Member
Wed 20 Mar 2024 09:55:35 PM UTC, comment #4: 

I filled a bug for tisean in a separate report:

https://savannah.gnu.org/bugs/index.php?65498

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 20 Mar 2024 09:46:08 PM UTC, comment #3: 

On somewhat related note -- I think fits has been pretty much abandoned and cfitsio is a (kind of) replacement for it.

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Wed 20 Mar 2024 09:20:31 PM UTC, comment #2: 

I also see this same issue for the tisean package (0.2.3):

/usr/bin/clang++ -c -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -fPIC -I/opt/local/include/octave-9.1.0/octave/.. -I/opt/local/include/octave-9.1.0/octave -I/opt/local/include  -pthread -pipe -Os -std=c++11 -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64  -pipe -Os -std=c++11 -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64   __lzo_test__.cc -o /opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_octave_octave-tisean/octave-tisean/work/.tmp/oct-Q24NTu.o
__lzo_test__.cc:84:12: error: 'this' argument to member function 'fortran_vec' has type 'const Matrix', but function is not marked const
      help=series.fortran_vec()+j*len+istep;
           ^~~~~~
/opt/local/include/octave-9.1.0/octave/Array.h:666:20: note: 'fortran_vec' declared here
  OCTARRAY_API T * fortran_vec ();
                   ^
1 error generated.


It also suffers from the set_warning_state issue, which can be easily patched.

Marius Schamschula <mschamschula>
Wed 20 Mar 2024 08:58:08 PM UTC, comment #1: 

Can reproduce on linux:

octave:1> pkg install -forge -verbose fits
downloading tarball(s) from:
- https://packages.octave.org/download/fits-1.0.7.tar.gz
mkdir (/tmp/oct-eW8yCj)
untar (/tmp/fits-1.0.7-BHbOTU.tar.gz, /tmp/oct-eW8yCj)
make: Entering directory '/tmp/oct-eW8yCj/fits-1.0.7/src'
mkoctfile --verbose -Wall -I/usr/include/cfitsio -lcfitsio  read_fits_image.cc
g++ -std=gnu++17 -c  -fPIC -I/usr/local/include/octave-9.1.1/octave/.. -I/usr/local/include/octave-9.1.1/octave -I/usr/local/include  -pthread -fopenmp -Wall -ggdb3 -O2 -march=native -mtune=native -mavx -mavx2 -flto=auto  -Wall  -I/usr/include/cfitsio  read_fits_image.cc -o /tmp/oct-K0kcKT.o
mkoctfile --verbose -Wall -I/usr/include/cfitsio -lcfitsio  save_fits_image.cc
g++ -std=gnu++17 -c  -fPIC -I/usr/local/include/octave-9.1.1/octave/.. -I/usr/local/include/octave-9.1.1/octave -I/usr/local/include  -pthread -fopenmp -Wall -ggdb3 -O2 -march=native -mtune=native -mavx -mavx2 -flto=auto  -Wall  -I/usr/include/cfitsio  save_fits_image.cc -o /tmp/oct-SJBDBU.o
mkoctfile --verbose -Wall -I/usr/include/cfitsio -lcfitsio  save_fits_image_multi_ext.cc
g++ -std=gnu++17 -c  -fPIC -I/usr/local/include/octave-9.1.1/octave/.. -I/usr/local/include/octave-9.1.1/octave -I/usr/local/include  -pthread -fopenmp -Wall -ggdb3 -O2 -march=native -mtune=native -mavx -mavx2 -flto=auto  -Wall  -I/usr/include/cfitsio  save_fits_image_multi_ext.cc -o /tmp/oct-oGy6z9.o
save_fits_image.cc: In function ‘octave_value_list Fsave_fits_image(const octave_value_list&, int)’:
save_fits_image.cc:84:12: error: ‘D_NINT’ was not declared in this scope
   84 |       if( (D_NINT( val ) ==  val) )
      |            ^~~~~~
save_fits_image.cc:132:58: error: passing ‘const NDArray’ as ‘this’ argument discards qualifiers [-fpermissive]
  132 |   double * datap = const_cast<double*>( image.fortran_vec() );
      |                                         ~~~~~~~~~~~~~~~~~^~
In file included from /usr/local/include/octave-9.1.1/octave/../octave/Array-util.h:31,
                 from /usr/local/include/octave-9.1.1/octave/../octave/MSparse.h:31,
                 from /usr/local/include/octave-9.1.1/octave/../octave/MatrixType.h:33,
                 from /usr/local/include/octave-9.1.1/octave/../octave/mx-base.h:33,
                 from /usr/local/include/octave-9.1.1/octave/../octave/Matrix.h:34,
                 from /usr/local/include/octave-9.1.1/octave/../octave/oct.h:33,
                 from save_fits_image.cc:19:
/usr/local/include/octave-9.1.1/octave/../octave/Array.h:666:20: note:   in call to ‘T* Array<T, Alloc>::fortran_vec() [with T = double; Alloc = std::pmr::polymorphic_allocator<double>]’
  666 |   OCTARRAY_API T * fortran_vec ();
      |                    ^~~~~~~~~~~
make: *** [Makefile:9: save_fits_image.oct] Error 1
make: *** Waiting for unfinished jobs....
read_fits_image.cc: In function ‘bool any_bad_argument(const octave_value_list&)’:
read_fits_image.cc:197:10: error: ‘D_NINT’ was not declared in this scope
  197 |     if( (D_NINT( val ) !=  val) || (val < 0) )
      |          ^~~~~~
save_fits_image_multi_ext.cc: In function ‘octave_value_list Fsave_fits_image_multi_ext(const octave_value_list&, int)’:
save_fits_image_multi_ext.cc:81:12: error: ‘D_NINT’ was not declared in this scope
   81 |       if( (D_NINT( val ) ==  val) )
      |            ^~~~~~
save_fits_image_multi_ext.cc:140:60: error: passing ‘const NDArray’ as ‘this’ argument discards qualifiers [-fpermissive]
  140 |     double * datap = const_cast<double*>( image.fortran_vec() );
      |                                           ~~~~~~~~~~~~~~~~~^~
In file included from /usr/local/include/octave-9.1.1/octave/../octave/Array-util.h:31,
                 from /usr/local/include/octave-9.1.1/octave/../octave/MSparse.h:31,
                 from /usr/local/include/octave-9.1.1/octave/../octave/MatrixType.h:33,
                 from /usr/local/include/octave-9.1.1/octave/../octave/mx-base.h:33,
                 from /usr/local/include/octave-9.1.1/octave/../octave/Matrix.h:34,
                 from /usr/local/include/octave-9.1.1/octave/../octave/oct.h:33,
                 from save_fits_image_multi_ext.cc:19:
/usr/local/include/octave-9.1.1/octave/../octave/Array.h:666:20: note:   in call to ‘T* Array<T, Alloc>::fortran_vec() [with T = double; Alloc = std::pmr::polymorphic_allocator<double>]’
  666 |   OCTARRAY_API T * fortran_vec ();
      |                    ^~~~~~~~~~~
make: *** [Makefile:9: read_fits_image.oct] Error 1
make: *** [Makefile:9: save_fits_image_multi_ext.oct] Error 1
make: Leaving directory '/tmp/oct-eW8yCj/fits-1.0.7/src'

error: pkg: error running 'make' for the fits package
error: called from
    configure_make at line 117 column 9
    install at line 202 column 7
    pkg at line 619 column 9


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 20 Mar 2024 08:46:50 PM UTC, original submission:  

While rebuilding fits 1.0.7 against octave 9.1.0 (under MacPorts) I get the following error:

/usr/bin/clang++ -c -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -fPIC -I/opt/local/include/octave-9.1.0/octave/.. -I/opt/local/include/octave-9.1.0/octave -I/opt/local/include  -pthread -pipe -Os -std=c++11 -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64  -Wall   save_fits_image.cc -o /opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_octave_octave-fits/octave-fits/work/.tmp/oct-eam4YP.o
save_fits_image.cc:132:41: error: 'this' argument to member function 'fortran_vec' has type 'const NDArray', but function is not marked const
  double * datap = const_cast<double*>( image.fortran_vec() );
                                        ^~~~~
/opt/local/include/octave-9.1.0/octave/Array.h:666:20: note: 'fortran_vec' declared here
  OCTARRAY_API T * fortran_vec ();
                   ^
1 error generated.


Marius Schamschula <mschamschula>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mschamschula (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code