Opened 8 years ago

Closed 8 years ago

#53101 closed defect (fixed)

jasper fails to build +universal due to glut/OpenGL problems

Reported by: jeremyhu (Jeremy Huddleston Sequoia) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: michaelld (Michael Dickens), dershow, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: jasper cmake

Description

[ 87%] Linking C executable jiv
cd /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/src/appl && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/jiv.dir/link.txt --verbose=ON
/usr/bin/clang  -pipe -Os -DNDEBUG -arch x86_64 -arch i386 -mmacosx-version-min=10.12 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/jiv.dir/jiv.c.o  -o jiv -Wl,-rpath,/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/src/libjasper  ../libjasper/libjasper.4.0.0.dylib /opt/local/lib/libjpeg.dylib /opt/local/lib/libglut.dylib -framework OpenGL /usr/lib/libm.dylib 
ld: warning: ignoring file /opt/local/lib/libglut.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libglut.dylib
Undefined symbols for architecture i386:
  "_glutCreateWindow", referenced from:
      _main in jiv.c.o
  "_glutDisplayFunc", referenced from:
      _main in jiv.c.o
  "_glutGet", referenced from:
      _loadimage in jiv.c.o
  "_glutGetModifiers", referenced from:
      _specialfunc in jiv.c.o
  "_glutInit", referenced from:
      _main in jiv.c.o
  "_glutInitDisplayMode", referenced from:
      _main in jiv.c.o
  "_glutKeyboardFunc", referenced from:
      _main in jiv.c.o
  "_glutMainLoop", referenced from:
      _main in jiv.c.o
  "_glutPostRedisplay", referenced from:
      _specialfunc in jiv.c.o
      _keyboardfunc in jiv.c.o
      _loadimage in jiv.c.o
  "_glutReshapeFunc", referenced from:
      _main in jiv.c.o
  "_glutReshapeWindow", referenced from:
      _loadimage in jiv.c.o
  "_glutSetWindowTitle", referenced from:
      _loadimage in jiv.c.o
  "_glutSpecialFunc", referenced from:
      _main in jiv.c.o
  "_glutSwapBuffers", referenced from:
      _displayfunc in jiv.c.o
  "_glutTimerFunc", referenced from:
      _loadimage in jiv.c.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/appl/jiv] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build'
make[1]: *** [src/appl/CMakeFiles/jiv.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build'
Command failed:  cd "/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build" && /usr/bin/make -w all VERBOSE=ON 
Exit code: 2
Error: Failed to build jasper: command execution failed
Error: See /opt/local/var/macports/logs/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

The build is failing because /opt/local/lib/libglut.dylib is not +universal, but that's not the main problem.

/opt/local/lib/libglut.dylib is provided by the freeglut port and uses GLX, not CGL. If jasper should be using GLX, it needs to link against /opt/local/lib/libGL.dylib (from mesa) rather than OpenGL.framework. If jasper should be using CGL, then it should be using GLUT.framework and not libglut.dylib

Attachments (1)

main.log (174.5 KB) - added by dershow 8 years ago.
Failed build log

Download all attachments as: .zip

Change History (8)

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

Yeah, this is an upstream problem, possibly introduced in the process of switching to cmake. Pretty sure the intent is to use GLUT.framework on macOS.

comment:2 Changed 8 years ago by jmroot (Joshua Root)

Cc: michaelld added
Port: cmake added

Can I see your configure output? I think this may be a problem with FindGLUT.cmake. It seems to find the framework when freeglut is not installed.

comment:3 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

-- Found OpenGL: //System/Library/Frameworks/OpenGL.framework  
JAS_ENABLE_OPENGL: ON
OpenGL library found: TRUE
OpenGL include directory: //System/Library/Frameworks/OpenGL.framework
OpenGL libraries: //System/Library/Frameworks/OpenGL.framework
-- Found GLUT: /opt/local/lib/libglut.dylib  
GLUT library found: TRUE
GLUT include directory: //System/Library/Frameworks/GLUT.framework/Headers
GLUT libraries: /opt/local/lib/libglut.dylib;//System/Library/Frameworks/Cocoa.framework
-- Looking for include file GL/glut.h
-- Looking for include file GL/glut.h - found
-- Looking for include file glut.h
-- Looking for include file glut.h - found
JAS_HAVE_GLUT_H: 1
JAS_HAVE_GL_GLUT_H: 1
CMake Warning at CMakeLists.txt:256 (message):
  Clearing bogus value for GLUT_Xmu_LIBRARY.


CMake Warning at CMakeLists.txt:257 (message):
  Your version of CMake may be buggy.


CMake Warning at CMakeLists.txt:261 (message):
  Clearing bogus value for GLUT_Xmi_LIBRARY.


CMake Warning at CMakeLists.txt:262 (message):
  Your version of CMake may be buggy.


JAS_HAVE_OPENGL: 1
-- Configuring done
Determining if files GL/glut.h exist passed with the following output:
Change Dir: /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp

Run Build Command:"/opt/local/bin/gmake" "cmTC_400e2/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTC_400e2.dir/build.make CMakeFiles/cmTC_400e2.dir/build
gmake[1]: Entering directory '/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_400e2.dir/CheckIncludeFiles.c.o
/usr/bin/clang   -I//System/Library/Frameworks/GLUT.framework/Headers  -pipe -Os  -arch x86_64 -arch i386 -mmacosx-version-min=10.12   -o CMakeFiles/cmTC_400e2.dir/CheckIncludeFiles.c.o   -c /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
Linking C executable cmTC_400e2
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_400e2.dir/link.txt --verbose=1
/usr/bin/clang  -pipe -Os  -arch x86_64 -arch i386 -mmacosx-version-min=10.12 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_400e2.dir/CheckIncludeFiles.c.o  -o cmTC_400e2  
gmake[1]: Leaving directory '/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp'


Determining if files glut.h exist passed with the following output:
Change Dir: /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp

Run Build Command:"/opt/local/bin/gmake" "cmTC_f0767/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTC_f0767.dir/build.make CMakeFiles/cmTC_f0767.dir/build
gmake[1]: Entering directory '/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f0767.dir/CheckIncludeFiles.c.o
/usr/bin/clang   -I//System/Library/Frameworks/GLUT.framework/Headers  -pipe -Os  -arch x86_64 -arch i386 -mmacosx-version-min=10.12   -o CMakeFiles/cmTC_f0767.dir/CheckIncludeFiles.c.o   -c /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
Linking C executable cmTC_f0767
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f0767.dir/link.txt --verbose=1
/usr/bin/clang  -pipe -Os  -arch x86_64 -arch i386 -mmacosx-version-min=10.12 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_f0767.dir/CheckIncludeFiles.c.o  -o cmTC_f0767  
gmake[1]: Leaving directory '/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_jasper/jasper/work/build/CMakeFiles/CMakeTmp'

comment:4 Changed 8 years ago by dershow

Cc: dershow added

comment:5 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: MarcusCalhoun-Lopez added

Marcus committed a fix to the jasper port in changeset:caae5b2254cc2926741d09b222c9483b13515ed0/macports-ports

comment:6 Changed 8 years ago by dershow

I'm still not able to get it to build. My log is attached. It appears that the bug that I'm seeing is different, so I've created a different ticket:https://trac.macports.org/ticket/53119

Last edited 8 years ago by dershow (previous) (diff)

Changed 8 years ago by dershow

Attachment: main.log added

Failed build log

comment:7 Changed 8 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.