bugGNU Octave - Bugs: bug #61668, [octave-forge] (gsl) configure...

 
 

bug #61668: [octave-forge] (gsl) configure tests fail because main is defined with no return type

Submitter:  Carlo de Falco <cdf>
Submitted:  Mon 13 Dec 2021 03:25:59 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Patch Submitted Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 7.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 06 Feb 2024 11:48:16 AM UTC, comment #24: 

Dmitri, your compiler might only issue a warning for implicit int function return types but newer compilers like llvm.org clang 16 and later consider it an error so it is essential and astronomically overdue to specify all function return types explicitly. Implicit int return types have been forbidden ever since C99, so there's been about a quarter century to fix it… how much longer shall we wait?

Ryan Carsten Schmidt <ryandesign>
Wed 31 Jan 2024 10:01:02 PM UTC, comment #23: 

Markus,

Indeed the mxe-octave patch helps!

Now, I'm seeing the same feval issue that Dimitri mentioned.

However, I already had a patch for that.So all IO had to do is enable it.  Not particularly elegant, but it does fix the build.

https://github.com/macports/macports-ports/blob/master/octave/octave-gsl/files/patch-src-gsl_sf.cc.diff

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 06:20:51 PM UTC, comment #22: 

Here the permalink to the file at the current head:
https://hg.octave.org/mxe-octave/file/25a0aca9bbad/src/of-gsl-1-cross-fixes.patch

(in case the file disappears in a future commit)

Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 06:17:20 PM UTC, comment #21: 

There is the following patch in MXE Octave that also changes the configure tests that are failing for you:
https://hg.octave.org/mxe-octave/file/tip/src/of-gsl-1-cross-fixes.patch

Maybe, applying it also helps in your case?

Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 06:08:17 PM UTC, comment #20: 


comment #19:

>
> comment #17:
> > So, `$octave_include_dir` was empty before and after you ran the command?
>
> Yes


Only before, not after.

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 06:07:44 PM UTC, comment #19: 


comment #17:

> So, `$octave_include_dir` was empty before and after you ran the command?


Yes

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 06:07:03 PM UTC, comment #18: 


comment #16:

Oops, I copied and pasted. It should have said

> I did indeed get
>
> echo $octave_include_dir
> /opt/local/include/octave-8.4.0/octave

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 06:06:20 PM UTC, comment #17: 

So, `$octave_include_dir` was empty before and after you ran the command?

Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 06:04:41 PM UTC, comment #16: 


comment #14:

> > Both give /opt/local/include/octave-8.4.0/octave
>
> I assume that you are referring to the `echo` command. Or did the first command already print that to the shell and the second didn't echo anything?
>


I just re-ran the second command on a new shell (SHELL=/bin/zsh). Initially,

echo $octave_include_dir was empty

after running

octave_include_dir=`/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "if exist ('__octave_config_info__') disp  (_octave_config_info_ ('octincludedir')) else disp  (octave_config_info ('octincludedir')) end"`

I did indeed get

echo $octave_include_dir was empty
/opt/local/include/octave-8.4.0/octave

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 05:59:12 PM UTC, comment #15: 

Could it be that user shell and /bin/sh are different?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 31 Jan 2024 05:52:13 PM UTC, comment #14: 


> Both give /opt/local/include/octave-8.4.0/octave


I assume that you are referring to the `echo` command. Or did the first command already print that to the shell and the second didn't echo anything?

Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 05:34:14 PM UTC, comment #13: 

Both give /opt/local/include/octave-8.4.0/octave

comment #12:

> If I understand the configure script correctly, it tries to execute that command and catch its output in a shell variable.
> But, looking at your config.log, that shell variable seems to be empty.
> Does the following work in a shell?


> octave_include_dir=`/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "disp(__octave_config_info__('octincludedir'))"`
> echo $octave_include_dir


>
> That is a stripped down version of the actual command that the configure script runs. The actual command is closer to this:


> octave_include_dir=`/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "if exist ('__octave_config_info__') disp  (__octave_config_info__ ('octincludedir')) else disp  (octave_config_info ('octincludedir')) end"`
> echo $octave_include_dir


>
> Does that also work?
>

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 03:59:19 PM UTC, comment #12: 

If I understand the configure script correctly, it tries to execute that command and catch its output in a shell variable.
But, looking at your config.log, that shell variable seems to be empty.
Does the following work in a shell?

octave_include_dir=`/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "disp(__octave_config_info__('octincludedir'))"`
echo $octave_include_dir


That is a stripped down version of the actual command that the configure script runs. The actual command is closer to this:

octave_include_dir=`/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "if exist ('__octave_config_info__') disp  (__octave_config_info__ ('octincludedir')) else disp  (octave_config_info ('octincludedir')) end"`
echo $octave_include_dir


Does that also work?

Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 02:37:19 PM UTC, comment #11: 

I also see warnings about main w/o return type, but those do not look detrimental:

...
conftest.cpp:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 | main()
      | ^~~~
configure:3166: $? = 0
configure:3189: g++ -c -g -O2 -I/usr/local/include/octave-9.0.1/octave  conftest.cpp >&5
conftest.cpp:24:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   24 | main()
      | ^~~~
configure:3189: $? = 0
configure:3209: checking for cos in -lm
configure:3234: g++ -o conftest -g -O2   conftest.cpp -lm   >&5
conftest.cpp:28:6: warning: declaration of 'char cos()' conflicts with built-in declaration 'double cos(double)' [-Wbuiltin-declaration-mismatch]
   28 | char cos ();
      |      ^~~
configure:3234: $? = 0
configure:3243: result: yes
...


Dmitri
--

Dmitri A. Sergatskov <dasergatskov>
Wed 31 Jan 2024 01:54:53 PM UTC, comment #10: 

Both work:

% /usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "disp  (_octave_config_info_ ('octincludedir'))"
/opt/local/include/octave-8.4.0/octave

% /opt/local/bin/octave-8.4.0 -qf --eval "disp  (_octave_config_info_ ('octincludedir'))"
/opt/local/include/octave-8.4.0/octave

And yes, I've seen the namespace error in other Octave packages. I would need to look this up.

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 12:37:48 PM UTC, comment #9: 

Not sure if this is a different problem or related. I tried to
compile with clang (against octave compiled with clang) and I see:

...
checking for gsl_sf_hzeta_e... yes
checking for gsl_sf_hzeta_e... (cached) yes
GSL special functions: all available
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
make[1]: Entering directory '/tmp/oct-E7hFoN/gsl-2.1.1/src'
/usr/local/bin/mkoctfile-9.0.1 --verbose  gsl_sf.cc -lgsl
clang++ -std=gnu++17 -c  -fPIC -I/usr/local/include/octave-9.0.1/octave/.. -I/usr/local/include/octave-9.0.1/octave -I/usr/local/include  -pthread -fopenmp -ggdb3 -O2 -march=native -mtune=native -mavx -mavx2 -flto=thin    gsl_sf.cc -o /tmp/oct-T2n2tD.o
gsl_sf.cc:53:3: error: use of undeclared identifier 'feval'; did you mean 'octave::feval'?
  feval ("help", octave_value ("gsl_sf"));
  ^~~~~
  octave::feval
/usr/local/include/octave-9.0.1/octave/../octave/parse.h:915:1: note: 'octave::feval' declared here
feval (const char *name,
^
gsl_sf.cc:124:11: error: no member named 'is_real_type' in 'octave_value'
    if (! ISREAL(args(i)))
          ^~~~~~~~~~~~~~~
gsl_sf.cc:32:24: note: expanded from macro 'ISREAL'
#define ISREAL(x) ((x).is_real_type ())
                   ~~~ ^
gsl_sf.cc:222:11: error: no member named 'is_real_type' in 'octave_value'
    if (! ISREAL(args(i)))
...


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 31 Jan 2024 12:24:27 PM UTC, comment #8: 

For whatever reason, the configure script doesn't seem to capture Octave's include directory.

Does the following return anything for you when executed from a shell?

/usr/bin/arch -arch arm64 /opt/local/bin/octave-8.4.0 -qf --eval "disp  (__octave_config_info__ ('octincludedir'))"


If that doesn't work, does the following?

/opt/local/bin/octave-8.4.0 -qf --eval "disp  (__octave_config_info__ ('octincludedir'))"


Markus Mützel <mmuetzel>
Group administrator
Wed 31 Jan 2024 01:33:17 AM UTC, comment #7: 


comment #5:

> configure: error: gslcblas library not found


This library is present in the default MacPorts lib path:

% locate libgslcblas
/opt/local/lib/libgslcblas.0.dylib
/opt/local/lib/libgslcblas.a
/opt/local/lib/libgslcblas.dylib

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 01:31:06 AM UTC, comment #6: 

Here is the config.log file related to this issue.

(file #55646)

Marius Schamschula <mschamschula>
Wed 31 Jan 2024 01:30:03 AM UTC, comment #5: 

This is a different error that I see when building using MacPorts:

GNU Octave, version 8.4.0
Copyright (C) 1993-2023 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "aarch64-apple-darwin22.6.0".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

>> pkg install -forge -verbose gsl

downloading tarball(s) from:
- https://packages.octave.org/download/gsl-2.1.1.tar.gz
mkdir (/var/folders/wp/pwsddx5n5p513r6z73qfsf440000gn/T/oct-JWQt61)
untar (/var/folders/wp/pwsddx5n5p513r6z73qfsf440000gn/T/gsl-2.1.1-xTsCIn.tar.gz, /var/folders/wp/pwsddx5n5p513r6z73qfsf440000gn/T/oct-JWQt61)
checking for mkoctfile... /opt/local/bin/mkoctfile-8.4.0 --verbose
checking for octave... /opt/local/bin/octave-8.4.0
checking for Octave's canonical_host_type...
aarch64-apple-darwin22.6.0
checking for Octave's include directory...
/opt/local/include/octave-8.4.0/octave
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 /usr/bin/clang++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... /usr/bin/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 ov-scalar.h usability... yes
checking ov-scalar.h presence... yes
checking for ov-scalar.h... yes
checking for cos in -lm... yes
checking for cblas_dgemm in -lgslcblas... no
configure: error: gslcblas library not found

error: pkg: error running the configure script for gsl
error: called from
    configure_make at line 107 column 9
    install at line 202 column 7
    pkg at line 619 column 9

>>

Marius Schamschula <mschamschula>
Tue 30 Jan 2024 11:16:25 PM UTC, comment #4: 

Can you run

pkg install -forge -verbose gsl

and post the logs?

On linux/octave9.0.1 it installs with just some warnings:

gsl_sf.cc:30733:31: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
30733 |              "for type int: %lu.", std::numeric_limits<int>::max ());
      |                             ~~^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                               |                                  |
      |                               long unsigned int                  int
      |                             %u


(using gcc/g++)

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Tue 30 Jan 2024 10:55:11 PM UTC, comment #3: 

As I'm in the process of cleaning the MacPorts Octave package Portfiles to include the move to GitHub, I again ran into this issue.

The patch file was applied, but the configure error persists (configure.ac.in is never used). I then applied the same patch to configure itself: same result.

In my current Octave installation the path to ov-scalar.h is

/opt/local/include/octave-8.4.0/octave/ov-scalar.h


Marius Schamschula <mschamschula>
Wed 11 Jan 2023 09:49:48 AM UTC, comment #2: 

Has the patch been applied?
Who is maintaining the GSL package?

Carlo de Falco <cdf>
Group Member
Mon 13 Dec 2021 03:28:43 PM UTC, comment #1: 

original submission:

> the following change fixes the problem for me


the patch didn't show in the original submission, trying again ...



$ diff -u configure.ac.in configure.ac.in.new
--- configure.ac.in        2021-12-13 16:16:41.000000000 +0100
+++ configure.ac.in.new        2021-12-13 16:15:25.000000000 +0100
@@ -82,7 +82,7 @@
   [AC_LANG_SOURCE(
      [[
 #include "ov-scalar.h"
-main()
+int main()
 {
   octave_scalar x (1.234);
   bool y = x.isreal ();
@@ -102,7 +102,7 @@
 #include "ov-scalar.h"
 #include "ovl.h"
 #include "parse.h"
-main()
+int main()
 {
   octave_value_list ovl = octave::feval ("sin", octave_value (1.234));
   return 0;


Carlo de Falco <cdf>
Group Member
Mon 13 Dec 2021 03:25:59 PM UTC, original submission:  

Installing the gsl on Octave 6.3 fails because
the configure script fails to detect 6.3 features.

the reason for the failure is that the tests defined
in configure define main with no return type, which causes
the tests to fail with the error


 error: C++ requires a type specifier for all declarations


regardless of the Octave version being used

I tested this with clang++ on macos but suspect the same
would happen on other systems

the following change fixes the problem for me


$ diff -u configure.ac.in configure.ac.in.new
--- configure.ac.in        2021-12-13 16:16:41.000000000 +0100
+++ configure.ac.in.new        2021-12-13 16:15:25.000000000 +0100
@@ -82,7 +82,7 @@
   [AC_LANG_SOURCE(
      [[
 #include "ov-scalar.h"
-main()
+int main()
 {
   octave_scalar x (1.234);
   bool y = x.isreal ();
@@ -102,7 +102,7 @@
 #include "ov-scalar.h"
 #include "ovl.h"
 #include "parse.h"
-main()
+int main()
 {
   octave_value_list ovl = octave::feval ("sin", octave_value (1.234));
   return 0;
-varbatim-

Carlo de Falco <cdf>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55646:  config.log added by mschamschula (18KiB - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by ryandesign (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mschamschula (Posted a comment)
  • -email is unavailable- added by cdf (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.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-31 mschamschula Attached File- Added config.log, #55646
    2023-01-11 mmuetzel Dependencies- bugs #59159 is dependent

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code