bugGNU Octave - Bugs: bug #62316, building octave 7.1.0 in mac os x...

 
 

bug #62316: building octave 7.1.0 in mac os x 12.3 fails

Submitter:  S Mahesh <smahesh1>
Submitted:  Fri 15 Apr 2022 01:28:45 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Mahesh Open/Closed:  * Closed
Release:  * 7.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

Sat 23 Apr 2022 12:55:05 PM UTC, comment #13: 

No further update in about a week. I'm assuming this issue was caused by the dependencies installed on that particular build system.

Closing as invalid.

Markus Mützel <mmuetzel>
Group administrator
Sun 17 Apr 2022 03:10:35 AM UTC, comment #12: 

Thanks you for your very valuable hints. I looked around the dependencies, and found that SuiteSparse was linking to libomp.

That hopefully explains the references to openmp in Makefile.
I will dig around a little and post an update.

Mahesh

S Mahesh <smahesh1>
Sat 16 Apr 2022 01:47:49 PM UTC, comment #11: 

We are using homebrew for continuous integration checks on macOS (versions 10 and 11).
That seems to work correctly without OpenMP support. (No linker errors.) E.g.:
https://github.com/gnu-octave/octave/runs/6041819360?check_suite_focus=true#step:8:1182

I haven't seen bug reports on the trackers for Homebrew or MacPorts about a similar issue. (But they haven't updated to 7.1.0 yet afaics.)

Are you sure none of the dependencies pull in that `-fopenmp` flag?
Did something related to OpenMP change in macOS 12?
Can you upload the config.log? (It'll probably be too large for savannah. But maybe you could send a link to some other service where you could share it.)

Markus Mützel <mmuetzel>
Group administrator
Sat 16 Apr 2022 10:30:47 AM UTC, comment #10: 

Recompiling all your libraries seems like overkill just to compile Octave. If you can build with gcc on your platform, would that be more feasible?

This seems to be the opposite of bug #62144. That problem was caused because Clang was using libomp while gcc was using libgomp. This problem is caused because Clang is not using libomp. There doesn't seem to be much that Octave can do to control Clang behavior, except use gcc.

Arun Giridhar <arungiridhar>
Group Member
Sat 16 Apr 2022 05:09:02 AM UTC, comment #9: 

Thanks for your suggestions. I have tried all of them.

1. I untarred the .tar.gz file to get a clean build directory, made a 'build' sub-directory within and called ../configure from within it. "make" terminates with the same error as before.

2. Simply running ../configure without env variables fails early on, as it is not able to set appropriate LDFLAGS to find the path to libSystem.dylib.

3. My mac 2015 has an intel chip. I have built previous versions of octave on it successfully using gcc-4.9. This is my first attempt to use clang though, and may be at the root of my problems. My present plan is to re-build all the supporting libraries with clang, and retry building octave.

Mahesh

S Mahesh <smahesh1>
Fri 15 Apr 2022 06:05:20 PM UTC, comment #8: 

Was that with a clean build or did you rerun make in the preexisting directory from earlier configure runs? Can you delete that build directory and recreate it? I notice that you are running configure in the source directory, which could make the directory structure messy. If your system allows I recommend a separate build directory from which you can run "../configure". But I don't think that would cause your build error though.

One other thing you could try is if you run "../configure" with no options at all and see if the defaults pick up the known good settings for your platform.

Btw, is your Mac on x86_64 or it is arm64 ("M1" or "Apple silicon")? There have been sporadic problems reported with Octave 7.1 on arm64 Apple so far, though not a build error yet.

Arun Giridhar <arungiridhar>
Group Member
Fri 15 Apr 2022 02:58:18 AM UTC, comment #7: 

Thanks again. I corrected CPPFLAGS to CXXFLAGS, ran ./configure, ran make. Here is the output from the commands you gave:


bash-3.2$ touch libinterp/liboctinterp.la
bash-3.2$ make V=1
preserving existing HG-ID file
/bin/sh config.status oct-conf-post.h-tmp oct-conf-post.h
config.status: creating oct-conf-post.h-tmp
config.status: executing oct-conf-post.h commands
/bin/sh config.status liboctave/mk-version-h.sh-tmp liboctave/mk-version-h.sh
config.status: creating liboctave/mk-version-h.sh-tmp
config.status: executing liboctave/mk-version-h.sh commands
/bin/sh config.status libinterp/corefcn/mk-mxtypes-h.sh-tmp libinterp/corefcn/mk-mxtypes-h.sh
config.status: creating libinterp/corefcn/mk-mxtypes-h.sh-tmp
config.status: executing libinterp/corefcn/mk-mxtypes-h.sh commands
/bin/sh ./build-aux/mk-octave-config-h.sh config.h > octave-config.h-t && \
    if [ -s octave-config.h-t ]; then /bin/sh ./build-aux/move-if-change octave-config.h-t octave-config.h; else echo "octave-config.h-t is empty!" 1>&2; rm -f octave-config.h-t; exit 1; fi
/bin/sh config.status build-aux/subst-script-vals.sh-tmp build-aux/subst-script-vals.sh
config.status: creating build-aux/subst-script-vals.sh-tmp
config.status: executing build-aux/subst-script-vals.sh commands
rm -f bits/stl_algo.h
make  all-recursive
make[1]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0'
preserving existing HG-ID file
Making all in libgnu
make[2]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
make  all-recursive
make[3]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
make[4]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
make[3]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
make[2]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0/libgnu'
Making all in test
make[2]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0/test'
make  all-am
make[3]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0/test'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0/test'
make[2]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0/test'
make[2]: Entering directory '/Users/mahesh/Downloads/octave-7.1.0'
preserving existing HG-ID file
/bin/sh config.status oct-conf-post.h-tmp oct-conf-post.h
config.status: creating oct-conf-post.h-tmp
config.status: executing oct-conf-post.h commands
/bin/sh ./build-aux/mk-octave-config-h.sh config.h > octave-config.h-t && \
    if [ -s octave-config.h-t ]; then /bin/sh ./build-aux/move-if-change octave-config.h-t octave-config.h; else echo "octave-config.h-t is empty!" 1>&2; rm -f octave-config.h-t; exit 1; fi
/bin/sh config.status libinterp/corefcn/mk-mxtypes-h.sh-tmp libinterp/corefcn/mk-mxtypes-h.sh
config.status: creating libinterp/corefcn/mk-mxtypes-h.sh-tmp
config.status: executing libinterp/corefcn/mk-mxtypes-h.sh commands
/bin/sh config.status liboctave/mk-version-h.sh-tmp liboctave/mk-version-h.sh
config.status: creating liboctave/mk-version-h.sh-tmp
config.status: executing liboctave/mk-version-h.sh commands
/bin/sh config.status liboctave/external/mk-f77-def.sh-tmp liboctave/external/mk-f77-def.sh
config.status: creating liboctave/external/mk-f77-def.sh-tmp
config.status: executing liboctave/external/mk-f77-def.sh commands
/bin/sh ./libtool  --tag=CXX   --mode=link clang++ -std=gnu++11 -fPIC -pthread -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual  -I/usr/local/include/ -I/opt/X11/include/     -L/usr/local/lib -L/opt/X11/lib/ -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/ -o src/octave-cli src/octave_cli-main-cli.o src/octave_cli-octave-build-info.o libinterp/liboctinterp.la liboctave/liboctave.la libgnu/libgnu.la  -lpthread -lm
libtool:   error: 'libinterp/liboctinterp.la' is not a valid libtool archive
Makefile:15512: recipe for target 'src/octave-cli' failed
make[2]: *** [src/octave-cli] Error 1
make[2]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0'
Makefile:27442: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0'
Makefile:10847: recipe for target 'all' failed
make: *** [all] Error 2


I also find Makefile has the following reference to openmp

am__aclocal_m4_deps = ... $(top_srcdir)/m4/ax_openmp.m4 ...

I am, however,  not able to tell if this relevant to my problem.

Mahesh

S Mahesh <smahesh1>
Fri 15 Apr 2022 02:43:56 AM UTC, comment #6: 

Also I am not sure why do you need to set CPPFLAGS. Those are C preprocessor flags. For c++ it is CXXFLAGS.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 15 Apr 2022 02:40:45 AM UTC, comment #5: 

CAn you do

touch libinterp/liboctinterp.la
make V=1


and post the results?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 15 Apr 2022 02:28:21 AM UTC, comment #4: 

Thank you for your suggestion.  I did:

/configure --disable-openmp --prefix="/usr/local/" CC="clang" CXX="clang++"  LDFLAGS="-L/usr/local/lib -L/opt/X11/lib/ -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/" CFLAGS="-I/usr/local/include/ -I/opt/X11/include/ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/" CPPFLAGS="-I/usr/local/include/ -I/opt/X11/include/" --with-lapack="-llapack" --with-blas="-lblas" --disable-java --x-includes="/opt/X11/include/" --x-libraries="/opt/X11/lib/"


"make" still ends with

  CXXLD    libinterp/liboctinterp.la
clang: error: unsupported option '-fopenmp'
Makefile:12618: recipe for target 'libinterp/liboctinterp.la' failed

so my problem persists.

Here is the summary from the end of the ./configure output:

configure:

Octave is now configured for x86_64-apple-darwin21.4.0

  Source directory:              .
  Installation prefix:           /usr/local
  C compiler:                    clang  -pthread  -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -I/usr/local/include/ -I/opt/X11/include/ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
  C++ compiler:                  clang++ -std=gnu++11  -pthread  -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
  Fortran compiler:              gfortran -g -O2 -std=legacy
  CPPFLAGS:                      -I/usr/local/include/ -I/opt/X11/include/
  Fortran libraries:              -L/usr/local/lib -L/opt/X11/lib/ -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/ -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. -lgfortran -lquadmath -lm
  Lex libraries:
  LIBS:                          -lpthread -lm
  LDFLAGS:                       -L/usr/local/lib -L/opt/X11/lib/ -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/
  Extra LDFLAGS:

  AMD CPPFLAGS:
  AMD LDFLAGS:
  AMD libraries:                 -lamd
  ARPACK CPPFLAGS:               -I/usr/local/include/arpack
  ARPACK LDFLAGS:                -L/usr/local/lib
  ARPACK libraries:              -larpack
  BLAS libraries:                -lblas
  BZ2 CPPFLAGS:
  BZ2 LDFLAGS:
  BZ2 libraries:                 -lbz2
  CAMD CPPFLAGS:
  CAMD LDFLAGS:
  CAMD libraries:                -lcamd
  CARBON libraries:              -framework Carbon
  CCOLAMD CPPFLAGS:
  CCOLAMD LDFLAGS:
  CCOLAMD libraries:             -lccolamd
  CHOLMOD CPPFLAGS:
  CHOLMOD LDFLAGS:
  CHOLMOD libraries:             -lcholmod
  COLAMD CPPFLAGS:
  COLAMD LDFLAGS:
  COLAMD libraries:              -lcolamd
  CURL CPPFLAGS:
  CURL LDFLAGS:
  CURL libraries:                -lcurl
  CXSPARSE CPPFLAGS:
  CXSPARSE LDFLAGS:
  CXSPARSE libraries:            -lcxsparse
  DL libraries:                  -ldl
  FFTW3 CPPFLAGS:                -I/usr/local/include
  FFTW3 LDFLAGS:                 -L/usr/local/lib
  FFTW3 libraries:               -lfftw3_threads -lfftw3
  FFTW3F CPPFLAGS:               -I/usr/local/include
  FFTW3F LDFLAGS:                -L/usr/local/lib
  FFTW3F libraries:              -lfftw3f_threads -lfftw3f
  FLTK CPPFLAGS:
  FLTK LDFLAGS:
  FLTK libraries:
  fontconfig CPPFLAGS:
  fontconfig libraries:
  FreeType2 CPPFLAGS:
  FreeType2 libraries:
  GLPK CPPFLAGS:
  GLPK LDFLAGS:
  GLPK libraries:                -lglpk
  HDF5 CPPFLAGS:
  HDF5 LDFLAGS:
  HDF5 libraries:                -lhdf5
  Java home:
  Java JVM path:
  Java CPPFLAGS:
  Java libraries:
  KLU CPPFLAGS:
  KLU LDFLAGS:
  KLU libraries:                 -lklu
  LAPACK libraries:              -llapack
  Magick++ CPPFLAGS:             -I/usr/local/include/GraphicsMagick
  Magick++ LDFLAGS:              -L/usr/local/lib
  Magick++ libraries:            -lGraphicsMagick++ -lGraphicsMagick
  OpenGL libraries:              -framework OpenGL
  PCRE CPPFLAGS:                 -I/usr/local/include
  PCRE LDFLAGS:                  -L/usr/local/lib
  PCRE libraries:                -lpcre
  PortAudio CPPFLAGS:
  PortAudio LDFLAGS:
  PortAudio libraries:
  PTHREAD flags:                 -pthread
  PTHREAD libraries:             -lpthread
  QHULL CPPFLAGS:                -I/usr/local/include
  QHULL LDFLAGS:                 -L/usr/local/lib
  QHULL libraries:               -lqhull_r
  QRUPDATE CPPFLAGS:
  QRUPDATE LDFLAGS:
  QRUPDATE libraries:            -lqrupdate
  Qt CPPFLAGS:
  Qt LDFLAGS:
  Qt GUI libraries:
  Qt OpenGL libraries:
  Qt moc:
  Qt uic:
  Qt rcc:
  Qt lrelease:
  Qt qcollectiongenerator:
  Qt qhelpgenerator:
  READLINE libraries:            -lreadline
  Sndfile CPPFLAGS:
  Sndfile LDFLAGS:
  Sndfile libraries:
  SPQR CPPFLAGS:
  SPQR LDFLAGS:
  SPQR libraries:                -lspqr
  SuiteSparse config libraries:  -lsuitesparseconfig
  SUNDIALS IDA CPPFLAGS:
  SUNDIALS IDA LDFLAGS:
  SUNDIALS IDA libraries:
  SUNDIALS NVECTOR CPPFLAGS:
  SUNDIALS NVECTOR LDFLAGS:
  SUNDIALS NVECTOR libraries:
  SUNLINSOL KLU CPPFLAGS:
  SUNLINSOL KLU LDFLAGS:
  SUNLINSOL KLU libraries:
  TERM libraries:                -lncurses
  UMFPACK CPPFLAGS:
  UMFPACK LDFLAGS:
  UMFPACK libraries:             -lumfpack
  X11 include flags:             /opt/X11/include/
  X11 libraries:                 -L/opt/X11/lib/ -lX11
  Z CPPFLAGS:
  Z LDFLAGS:
  Z libraries:                   -lz

  Default pager:                 less
  gnuplot:                       gnuplot

  Build Octave Qt GUI:                  no (missing:Qt5Core Qt5Gui Qt5Help Qt5Network Qt5PrintSupport Qt5Xml)
  Build Java interface:                 no
  Build static libraries:               no
  Build shared libraries:               yes
  Dynamic Linking API:                  dlopen
  Include support for GNU readline:     yes
  Use push parser in command line REPL: yes
  64-bit array dims and indexing:       yes
  64-bit BLAS array dims and indexing:  no
  OpenMP SMP multithreading:            no
  Truncate intermediate FP results:     yes
  Build cross tools:                    no
  Build docs:                           no


Thanks,
Mahesh

S Mahesh <smahesh1>
Fri 15 Apr 2022 02:13:59 AM UTC, comment #3: 

I cannot reproduce on linux. I run configure with
--disable-openmp and I do not see any -openbp flags:



/bin/sh ./libtool  --tag=CXX   --mode=link clang++ -fPIC -pthread -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual  -O2 -march=native -mavx -mavx2  -flto=thin     -fuse-ld=lld -Wl,--threads=16 -o src/octave-cli src/octave_cli-main-cli.o src/octave_cli-octave-build-info.o libinterp/liboctinterp.la liboctave/liboctave.la libgnu/libgnu.la  -lpthread -lm


I wonder if your configure got confused by some other options and
disregard the rest (including --disable-openmp).
Could you move it u towards the beginning:


./configure --disable-openmp --prefix... etc.


At the end of configure run you should see something like:


configure:

Octave is now configured for x86_64-pc-linux-gnu

  Source directory:              ..
  Installation prefix:           /usr/local
  C compiler:              ....

-configure-


Could you post those results?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 15 Apr 2022 02:10:49 AM UTC, comment #2: 

Yes, my problem is likely Apple-supplied clang specific (e.g., https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave) that comes with the OS. I have verified that there is no libomp.dylib in the /usr/lib/ directory of the SDK I am linking with.

Mahesh

S Mahesh <smahesh1>
Fri 15 Apr 2022 01:46:34 AM UTC, comment #1: 

Unable to replicate with Clang 13 on Linux. Octave is configured with OpenMP and Clang does not complain. Is your no-OpenMP limitation something Apple-specific? Does it work with -fopenmp=libomp?

(Changing Unexpected error to Build Failure)

Arun Giridhar <arungiridhar>
Group Member
Fri 15 Apr 2022 01:28:45 AM UTC, original submission:  

I am trying to build octave 7.1.0 on mac os x 12.3.1 using the in-built Apple's clang v 13.1.6. Apple's clang is known not to support OpenMP. So, I have disabled openmp. My ./config command reads as:


./configure --prefix="/usr/local/" CC="clang" CXX="clang++"  LDFLAGS="-L/usr/local/lib -L/opt/X11/lib/ -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/" CFLAGS="-I/usr/local/include/ -I/opt/X11/include/ -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/" CPPFLAGS="-I/usr/local/include/ -I/opt/X11/include/" --with-lapack="-llapack" --with-blas="-lblas" --disable-java --x-includes="/opt/X11/include/" --x-libraries="/opt/X11/lib/" --disable-openmp


Even so, "make" does not complete successfully. The last few lines of output are as follows:

  CXXLD    libinterp/liboctinterp.la
clang: error: unsupported option '-fopenmp'
Makefile:12618: recipe for target 'libinterp/liboctinterp.la' failed
make[2]: *** [libinterp/liboctinterp.la] Error 1
make[2]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0'
Makefile:27442: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/Users/mahesh/Downloads/octave-7.1.0'
Makefile:10847: recipe for target 'all' failed
make: *** [all] Error 2


I appreciate any help in resolving this problem, so that I can complete the build.

Mahesh

S Mahesh <smahesh1>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by smahesh1 (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-23 mmuetzel StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2022-04-16 mmuetzel StatusNone Need Info
    2022-04-15 arungiridhar Item GroupUnexpected Error or Warning Build Failure

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code