Opened 5 years ago

Last modified 5 years ago

#58925 assigned defect

octave +fltk @5.1.0_1 build failure: ld: framework not found OpenGL

Reported by: prbuen Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: octave

Description

Hi, I am trying to build octave with the +fltk variant. It fails as it seems ld doesn't find OpenGL. Here is the error in main.log:

:info:build   CXXLD    libinterp/dldfcn/__eigs__.la
:info:build   CXXLD    libinterp/dldfcn/__delaunayn__.la
:info:build   CXXLD    libinterp/dldfcn/__fltk_uigetfile__.la
:info:build   CXXLD    libinterp/dldfcn/__glpk__.la
:info:build   CXXLD    libinterp/dldfcn/__init_fltk__.la
:info:build   CXXLD    libinterp/dldfcn/__init_gnuplot__.la
:info:build   CXXLD    libinterp/dldfcn/__voronoi__.la
:info:build   CXXLD    libinterp/dldfcn/__ode15__.la
:info:build ld: framework not found OpenGL
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [libinterp/dldfcn/__init_fltk__.la] Error 1

Earlier, however, the configure script (which include --with-fltk --with-framework-opengl) seems to have tested for OpenGL successfully:

:info:configure checking whether /opt/local/libexec/llvm-8.0/bin/ld accepts -framework OpenGL... yes
:info:configure configure: adding -framework OpenGL to OPENGL_LIBS

and also

:info:configure checking for OpenGL support in FLTK... yes

As far as I can see, the FLTK LDFLAGS include the OpenGL framework:

:info:configure   FLTK LDFLAGS:                  -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -framework OpenGL -framework Cocoa

but it looks like these flags are not taken into account when linking libinterp/dldfcn?

I must say that I am trying to build without XCode being installed, and the flag above includes the .sdk from XCode.app. Still, the error I get seems related to -framework OpenGL or to a wrong library search path in ld.

I can compile from source fine without the +fltk variant. Any idea how to fix the library search path above?

When I compile a "hello world" with gcc-mp-9 -v I get the following:

Library search paths:
	/usr/local/lib
	/opt/local/lib/gcc9/gcc/x86_64-apple-darwin18/9.2.0
	/opt/local/lib/gcc9
	/usr/lib
	/usr/local/lib
Framework search paths:
	/Library/Frameworks/
	/System/Library/Frameworks/

and I have OpenGL.framework at

/System/Library/Frameworks/OpenGL.framework/

Attachments (1)

octave-5.1.0_1+fltk.main.log (1.0 MB) - added by prbuen 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by prbuen

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Owner: set to MarcusCalhoun-Lopez
Port: octave added
Status: newassigned

comment:2 Changed 5 years ago by prbuen

Seems similar to https://trac.macports.org/ticket/47062, although that one was eventually due to a cmake issue with using command line tools rather than XCode, see https://trac.macports.org/ticket/44581

Last edited 5 years ago by prbuen (previous) (diff)

comment:3 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

You seem to have a system configuration that is not quite the norm, so we have to figure out which aspect is causing the problem.

The issues seems to be that -isysroot and -syslibroot were never added to compiler/linker flags.
The only way I can see that not happening is if /usr/include exists but does not have the system headers installed.
Is that possible?

comment:4 Changed 5 years ago by prbuen

I do have /usr/include, which was created by installing the system headers with /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg. Which includes do you think should be there but are not?

I am working from a fresh install of everything on Mac OS 10.14. The only unusual thing for MacPorts is that I didn't install XCode, only command line tools. But usually everything works ok except for compiling Aqua GUIs.

The flag -syslibroot is added to FLTK LDFLAGS, but not -isysroot indeed. Would e.g. reinstalling ld64 from source help? Is there a way I could simply add this flag somewhere?

Note: See TracTickets for help on using tickets.