Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on MacOS #9

Open
mohawk2 opened this issue May 10, 2022 · 4 comments
Open

Build failure on MacOS #9

mohawk2 opened this issue May 10, 2022 · 4 comments

Comments

@mohawk2
Copy link
Contributor

mohawk2 commented May 10, 2022

https://gist.githubusercontent.com/oalders/bf99678279926568fdd02d574705489d/raw/bb556d5652585558f89e53c0c03bbf20971b60c1/gistfile1.txt shows:

In file included from GLUT.xs:550:
In file included from ./gl_util.h:27:
./glext_procs.h:9886:9: warning: 'GL_TRIANGLE_STRIP_ADJACENCY_EXT' macro redefined [-Wmacro-redefined]
#define GL_TRIANGLE_STRIP_ADJACENCY_EXT   0x000D
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:1120:9: note: previous definition is here
#define GL_TRIANGLE_STRIP_ADJACENCY_EXT                      0xD
        ^
In file included from GLUT.xs:550:
In file included from ./gl_util.h:27:
./glext_procs.h:10915:21: error: conflicting types for 'glTexParameterIivEXT'
GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3227:13: note: previous declaration is here
extern void glTexParameterIivEXT( GLenum target, GLenum pname, GLint *params );
            ^
In file included from GLUT.xs:550:
In file included from ./gl_util.h:27:
./glext_procs.h:10916:21: error: conflicting types for 'glTexParameterIuivEXT'
GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3228:13: note: previous declaration is here
extern void glTexParameterIuivEXT( GLenum target, GLenum pname, GLuint *params );
            ^
@oalders
Copy link

oalders commented May 10, 2022

Summary of my perl5 (revision 5 version 34 subversion 1) configuration:
   
  Platform:
    osname=darwin
    osvers=21.4.0
    archname=darwin-2level
    uname='darwin imac.local 21.4.0 darwin kernel version 21.4.0: mon feb 21 20:34:37 pst 2022; root:xnu-8020.101.4~2release_x86_64 x86_64 '
    config_args='-Dprefix=/Users/olaf/.plenv/versions/5.34.1 -de -Dversiononly -A'eval:scriptdir=/Users/olaf/.plenv/versions/5.34.1/bin''
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=12.3 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV'
    optimize='-O3'
    cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=12.3 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='Apple LLVM 13.1.6 (clang-1316.0.21.2)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -mmacosx-version-min=12.3 -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/lib /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/lib /Library/Developer/CommandLineTools/usr/lib /usr/lib
    libs=-lgdbm -ldb
    perllibs=
    libc=
    so=dylib
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=bundle
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' -mmacosx-version-min=12.3 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Built under darwin
  Compiled at Mar 21 2022 15:39:00
  @INC:
    /Users/olaf/.plenv/versions/5.34.1/lib/perl5/site_perl/5.34.1/darwin-2level
    /Users/olaf/.plenv/versions/5.34.1/lib/perl5/site_perl/5.34.1
    /Users/olaf/.plenv/versions/5.34.1/lib/perl5/5.34.1/darwin-2level
    /Users/olaf/.plenv/versions/5.34.1/lib/perl5/5.34.1

@mohawk2
Copy link
Contributor Author

mohawk2 commented May 11, 2022

The key difference between your setup and mine is that OpenGL::GLUT's Makefile.PL on mine finds "FREEGLUT", while yours finds AGL (near the top of the gist). That's Homebrew (I think Free)GLUT, which also pulls in a dependency on XQuartz. Since it's too much to ask for you to install Homebrew, FreeGLUT, and XQuartz, it looks to me like I need to get it working on AGL (the Apple-supplied OpenGL and GLUT), which really ought to work anyway. I'm actually a little baffled that's even really a "thing", but the Perl OpenGL stuff last got worked in about 10 years ago, and I suspect the MacOS world has improved its availability of OpenGL/GLUT since.

@d-lamb
Copy link

d-lamb commented Sep 11, 2024

When I build PDL 2.090 (and prior versions as well) on my Mac, during the Makefile.PL stage I get warnings:

Warning (mostly harmless): No library found for -lAGL.framework
Warning (mostly harmless): No library found for -lOpenGL.framework

I think it comes from OpenGL-GLUT's Makefile.PL. In addition to the "improved availability" mentioned above, it's likely that the frameworks have moved around substantially on MacOS since that Makefile.PL was written. See for example the question, answer, and updated answers to this Stack Overflow question (which is about the headers, not the libraries). I'm not using the OpenGL or PDL::Graphics::TriD so this is not too important to me, but since I did the digging I figured I'd post the links here so that they are easily found later.

@mohawk2
Copy link
Contributor Author

mohawk2 commented Sep 11, 2024

Thank you for making the effort! I haven't forgotten about this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants