Problem building on OS X

Help
Anonymous
2012-05-05
2012-09-14
  • Anonymous

    Anonymous - 2012-05-05

    Hi,

    I'm having some trouble building on OS X. The error I'm getting is below. I
    see g++, make, and libpng3-dev are dependencies and I think I have them
    installed.

    On libpng3-dev, I have the latest version available in fink:

    spocker:waffles andrew$ fink list -i | grep png

    i libpng15-shlibs 1.5.10-1 Shared libraries for libpng15 package

    i libpng3 1:1.2.49-1 PNG image format handling library

    i libpng3-shlibs 1:1.2.49-1 Shared libraries for libpng3 package

    i system-pkgconfig-cairo-png 1.10.2-1

    i system-pkgconfig-libpng 1.5.4-1

    i system-pkgconfig-libpng15 1.5.4-1

    g++ is Apples C++:

    $ g++ -v

    Using built-in specs.

    Target: i686-apple-darwin11

    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure
    --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2
    --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-
    prefix=llvm- --program-transform-name=/^*$/s/$/-4.2/ --with-slibdir=/usr/lib
    --build=i686-apple-darwin11 --enable-
    llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-
    llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11-
    --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-
    dir=/usr/include/c++/4.2.1

    Thread model: posix

    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

    make is there too:

    $ make -v

    GNU Make 3.81

    Copyright (C) 2006 Free Software Foundation, Inc.

    This is free software; see the source for copying conditions.

    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

    PARTICULAR PURPOSE.

    This program built for i386-apple-darwin11.0

    Here's the error:

    ar -cr ../../lib/GClassesDbg.a ../../obj/GClasses/dbg/G3D.o
    ../../obj/GClasses/dbg/GActivation.o ../../obj/GClasses/dbg/GApp.o
    ../../obj/GClasses/dbg/GBayesianNetwork.o ../../obj/GClasses/dbg/GBezier.o
    ../../obj/GClasses/dbg/GBigInt.o ../../obj/GClasses/dbg/GBits.o
    ../../obj/GClasses/dbg/GBitTable.o ../../obj/GClasses/dbg/GBlob.o
    ../../obj/GClasses/dbg/GChess.o ../../obj/GClasses/dbg/GCluster.o
    ../../obj/GClasses/dbg/GCrypto.o ../../obj/GClasses/dbg/GDecisionTree.o
    ../../obj/GClasses/dbg/GDiff.o ../../obj/GClasses/dbg/GDirList.o
    ../../obj/GClasses/dbg/GDistance.o ../../obj/GClasses/dbg/GDistribution.o
    ../../obj/GClasses/dbg/GDom.o ../../obj/GClasses/dbg/GDynamicPage.o
    ../../obj/GClasses/dbg/GEnsemble.o ../../obj/GClasses/dbg/GError.o
    ../../obj/GClasses/dbg/GEvolutionary.o ../../obj/GClasses/dbg/GFile.o
    ../../obj/GClasses/dbg/GFourier.o ../../obj/GClasses/dbg/GFunction.o
    ../../obj/GClasses/dbg/GGraph.o ../../obj/GClasses/dbg/GHashTable.o
    ../../obj/GClasses/dbg/GHeap.o ../../obj/GClasses/dbg/GHiddenMarkovModel.o
    ../../obj/GClasses/dbg/GHillClimber.o ../../obj/GClasses/dbg/GHistogram.o
    ../../obj/GClasses/dbg/GHolders.o ../../obj/GClasses/dbg/GHtml.o
    ../../obj/GClasses/dbg/GHttp.o ../../obj/GClasses/dbg/GImage.o
    ../../obj/GClasses/dbg/GKalman.o ../../obj/GClasses/dbg/GKernelTrick.o
    ../../obj/GClasses/dbg/GKeyPair.o ../../obj/GClasses/dbg/GKNN.o
    ../../obj/GClasses/dbg/GLearner.o ../../obj/GClasses/dbg/GLinear.o
    ../../obj/GClasses/dbg/GManifold.o ../../obj/GClasses/dbg/GMath.o
    ../../obj/GClasses/dbg/GMatrix.o ../../obj/GClasses/dbg/GMixtureOfGaussians.o
    ../../obj/GClasses/dbg/GNaiveBayes.o ../../obj/GClasses/dbg/GNaiveInstance.o
    ../../obj/GClasses/dbg/GNeighborFinder.o ../../obj/GClasses/dbg/GNeuralNet.o
    ../../obj/GClasses/dbg/GOptimizer.o ../../obj/GClasses/dbg/GParticleSwarm.o
    ../../obj/GClasses/dbg/GPlot.o ../../obj/GClasses/dbg/GPolicyLearner.o
    ../../obj/GClasses/dbg/GPolynomial.o ../../obj/GClasses/dbg/GPriorityQueue.o
    ../../obj/GClasses/dbg/GRayTrace.o ../../obj/GClasses/dbg/GReverseBits.o
    ../../obj/GClasses/dbg/GRect.o ../../obj/GClasses/dbg/GRand.o
    ../../obj/GClasses/dbg/GRecommender.o ../../obj/GClasses/dbg/GRegion.o
    ../../obj/GClasses/dbg/GReinforcement.o ../../obj/GClasses/dbg/GSDL.o
    ../../obj/GClasses/dbg/GSelfOrganizingMap.o ../../obj/GClasses/dbg/GSmtp.o
    ../../obj/GClasses/dbg/GSocket.o ../../obj/GClasses/dbg/GSparseMatrix.o
    ../../obj/GClasses/dbg/GSpinLock.o ../../obj/GClasses/dbg/GStabSearch.o
    ../../obj/GClasses/dbg/GStemmer.o ../../obj/GClasses/dbg/GString.o
    ../../obj/GClasses/dbg/GSystemLearner.o ../../obj/GClasses/dbg/GText.o
    ../../obj/GClasses/dbg/GThread.o ../../obj/GClasses/dbg/GTime.o
    ../../obj/GClasses/dbg/GTokenizer.o ../../obj/GClasses/dbg/GTransform.o
    ../../obj/GClasses/dbg/GVec.o ../../obj/GClasses/dbg/GWave.o
    ../../obj/GClasses/dbg/GWidgets.o ../../obj/GClasses/dbg/GWindows.o
    ../../obj/GClasses/dbg/sha1.o ../../obj/GClasses/dbg/sha2.o

    g++ -O3 -o ../../bin/waffles_wizard ../../obj/waffles_wizard/opt/main.o
    ../../obj/waffles_wizard/opt/usage.o /sw/lib/libpng.dylib -lz -framework
    AppKit ../../lib/GClasses.a

    ld: in ../../lib/GClasses.a, archive has no table of contents for architecture
    x86_64

    collect2: ld returned 1 exit status

    make: *** Error 1

    make: *** Error 2

    Any idea what might be going wrong?

    Thanks!

     
  • Mike Gashler

    Mike Gashler - 2012-05-06

    Unfortunately, I don't actually have a Mac, so I probably can't be very
    helpful. Anyone out there know the answer to this?

    According to this forum (http://forums.nvidia.com/index.php?showtopic=105940&
    st=20),
    the
    solution might be to add an "s" to the flags used by "ar". More specifically,
    open waffles/src/GClasses/Makefile, and change line 168 from

    @ar -cr $(TARGET_PATH)/$(TARGET_NAME_OPT) $(OBJECTS_OPT)

    to

    @ar -crs $(TARGET_PATH)/$(TARGET_NAME_OPT) $(OBJECTS_OPT)

    . If that fixes it, please let me know, and I will update it in our
    repository.

    I ported Waffles to OSX using the 32-bit machines that my department used to
    provide. Unfortunately, they closed the mac lab because few people used it.
    I'll see if I can get access to a 64-bit mac in the near future, but I'm out
    of town right now, so I won't be able to try it for some time. Good luck!

     
  • Nobody/Anonymous

    Mike: Thanks a bunch. That seems to have fixed the problem since it builds now
    and all the demos I've tried are working.

    I think I'm in business.

    Thanks!

     

Anonymous
Anonymous

Cancel  Add attachments