Need help compiling file that requires X11...

Discussion in 'Mac Programming' started by ArtOfWarfare, Jan 27, 2014.

  1. ArtOfWarfare, Jan 27, 2014
    Last edited: Jan 27, 2014

    ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #1
    I'm trying to make the blackfin toolchain on OS X (normally it's for RedHat) and I'm hitting a snag when running the build script. It tries including X11/Xlib.h, but it's not finding it. I heard this file gets downloaded as part of the Xcode Command Line tools, which I've installed, but the file still isn't found.

    The specific line trying to import the file is:

    #include <X11/Xlib.h>

    Where is X11/Xlib.h on my computer, currently (if at all... if it's not, it prompts the question, where can I get it?) and further, where do I need to put it or what do I need to change for the file to properly get imported?

    Here's the blackfin toolchain source forge page, for those interested:
    http://sourceforge.net/projects/adi-toolchain/files/2013R1/2013R1-RC1/src/

    Edit:

    Okay, after some more searching I found out that X11's library gets installed in /opt/X11.

    Further, I found a suggestion to make a symlink to it like this:

    ln -s /opt/X11/include/X11 /usr/local/include/X11

    I did that, but I'm still running into these problems:

    Code:
    Checking for development packages (skip checks with the -D option)
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
           mktemp [-d] [-q] [-u] -t prefix 
    ld: warning: directory not found for option '-L/sw/lib'
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
           mktemp [-d] [-q] [-u] -t prefix 
    ld: warning: directory not found for option '-L/sw/lib'
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
           mktemp [-d] [-q] [-u] -t prefix 
    ld: warning: directory not found for option '-L/sw/lib'
    ld: library not found for -lX11
    Any idea what I'm missing now?

    I found a suggestion that it might mean /usr/X11/lib/libX11.so or .a is missing. I checked that directory and didn't see either of those files, but I found these two:

    /usr/X11/lib/libX11.6.dylib
    /usr/X11/lib/libX11-xcb.1.dylib
     
  2. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #2
    It is looking for libraries in the /sw/lib & X11 directories. My copy of the file you originally needed is in the sdk directory of Xcode.

    Code:
    MacUser2525:~$ locate Xlib.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/Xlib.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/Xlib.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/Xlib.h
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/Xlib.h
    
     
  3. ArtOfWarfare, Jan 27, 2014
    Last edited: Jan 27, 2014

    ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    I don't see an sw directory anywhere on my computer...? How can I help it find them? Is there something I need to install, move, or link? Or maybe I need to change the build script (I haven't even tried peaking inside it yet.)

    Edit: I was able to clean up all of the X11 related errors by installing Homebrew and updating XQuartz. Regrettably, the build script got further along and then hit this new roadblock:

    "you must use a case sensitive filesystem"

    Why the hell did they make that a requirement of all things? That sounds so completely arbitrary... but... whatever, guess that rules out compiling this from OSX. And Windows. I wonder if this contributes to why nobody bothers with blackfin.
     
  4. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #4
    The reason is because a lot of Unix and Linux apps assume a case-sensitive file system. You could have README and readme as two different files, and you can't do that on a case-insensitive file system. Once in a while I'll run into this with git, and pull/push some changes that don't quite do what I expected them since I use a Mac.

    Remember that OS X only uses the case-insensitive file system by default, because the classic OS wasn't case-sensitive and they needed to be backwards-compatible. The Adobe apps are the canonical example of applications that will not work on a case-sensitive file system.

    Can't you just make a disk image, move your project to it, and use the case-sensitive file system for it?
     
  5. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #5
    All but Apples implementation of *nix require case sensitive files. Don't know how many times I have cursed not being able to rename This to this and don't get me started on spaces in file names...
     
  6. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #6
    I wasn't sure of any solutions that would work, but that sounds like a pretty simple one. Should I need to compile this in the future, I'll give it a shot. (I gave up and just used a Linux machine at school that already had the project compiled.)
     
  7. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #7
    It's not a requirement, if that's the case then it's not becuase of the Unix specification. As another example, ZFS has a case insensitive option, just like HFS+. There are applications that makes assumptions about case, which makes porting them harder as we have seen here. In this case I would categorize this as a bug, because it's unreasonable to expect a case sensitive filesystem on a Mac by default.
     
  8. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #8
    Not only unreasonable it is impossible OSX defaults to case insensitive unlike other *nix that default to case sensitive is/was the point of my post.
     
  9. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #9
    The default depends on filesystem, and settings, you can set up HFS+ to be case sensitive, it's not impossible but it's unreasonable to expect that on OS X. My point is that the error message should therefore be considered a bug on OS X.
     
  10. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #10
    You said default Apple installed defaults to case insensitive so it is impossible, anyways enough of this foolishness PLONK.
     
  11. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #11
    It does, but you can reformat the drive and install the OS again, this time with case sensitivity. It would be unreasonable to expect anyone to do that only to install a library, but not impossible.
     

Share This Page