Building Catalina on the Mac

I tried building Catalina on the Mac today and so far haven't had any success. I tried running the Linux build but when I follow the instructions I get an error indicating that it can't find catalina_env. Where is that file supposed to come from? It isn't in the distribution that I downloaded.

Comments

  • RossHRossH Posts: 4,609
    edited 2020-07-30 - 03:26:52
    Hi @David Betz

    Sorry, I answered in the original thread.

    If you have not installed Catalina to the default location (/opt/catalina) then you need to manually set the LCCDIR environment variable.

    There are additional instructions (albeit brief!) in the README.Linux file.

    The catalina_env batch file is in the bin directory. You may need to set permissions. There is a Set_Linux_Permissions batch script in the same directory that works on Linux. You may need to do some manual tweaking on MacOS.

    Ross.
  • David BetzDavid Betz Posts: 14,063
    edited 2020-07-30 - 13:28:30
    RossH wrote: »
    Hi @David Betz

    Sorry, I answered in the original thread.

    If you have not installed Catalina to the default location (/opt/catalina) then you need to manually set the LCCDIR environment variable.

    There are additional instructions (albeit brief!) in the README.Linux file.

    The catalina_env batch file is in the bin directory. You may need to set permissions. There is a Set_Linux_Permissions batch script in the same directory that works on Linux. You may need to do some manual tweaking on MacOS.

    Ross.
    I did define the LCCDIR environment variable as described in the README.Linux file. There is no catalina_env file in the bin directory in the tar file I downloaded from SourceForge. I created a dummy catalina_env file in my bin directory containing an echo command so I could tell it was invoked and then got a bit further but I get lots of errors saying "lcc" isn't found.

    Here are the steps I took:
       cd catalina
       LCCDIR=$PWD
       export LCCDIR
       source use_catalina
       cd source
       ./build_all
    
    FYI, it does get as far as building the catalina, catbind, and spinnaker executables.
  • In looking at this a bit further it seems that the build scripts are trying to pass the -E option to the linker but that isn't supported in the Xcode linker. I'll have to figure out what that is supposed to do and if it is safe to remove it.
  • David Betz wrote: »
    I did define the LCCDIR environment variable as described in the README.Linux file. There is no catalina_env file in the bin directory in the tar file I downloaded from SourceForge. I created a dummy catalina_env file in my bin directory containing an echo command so I could tell it was invoked and then got a bit further but I get lots of errors saying "lcc" isn't found.

    I just downloaded Catalina 4.3_Linux.tar.gz again from SourceForge and catalina_env is definitely in there.

    What version did you download?
    Here are the steps I took:
       cd catalina
       LCCDIR=$PWD
       export LCCDIR
       source use_catalina
       cd source
       ./build_all
    
    FYI, it does get as far as building the catalina, catbind, and spinnaker executables.

    That looks right. What happens after that? Can you post the output?
  • RossHRossH Posts: 4,609
    edited 2020-07-31 - 00:41:40
    David Betz wrote: »
    In looking at this a bit further it seems that the build scripts are trying to pass the -E option to the linker but that isn't supported in the Xcode linker. I'll have to figure out what that is supposed to do and if it is safe to remove it.

    I am by no means a Mac expert, but I just read that Xcode now uses Clang as its default compiler. You may have to download and install gcc manually.

    EDIT: Also, Clang apparently "pretends" to be gcc - i.e. it can be invoked via the command "gcc". But you will probably need the "real" gcc.
  • Yes, Xcode uses clang but I figured Catalina was probably just pretty vanilla C and should compile with any ANSI compiler. I guess that isn't true. Also, you are correct that bin/catalina_env exists in the downloaded archive. I'm not sure why I couldn't find it the first time I downloaded the sources. In any case, it looks like this is going to be more work than I have time for at the moment. Do you eventually plan to get back to making a Macintosh version?
  • David Betz wrote: »
    Yes, Xcode uses clang but I figured Catalina was probably just pretty vanilla C and should compile with any ANSI compiler. I guess that isn't true. Also, you are correct that bin/catalina_env exists in the downloaded archive. I'm not sure why I couldn't find it the first time I downloaded the sources. In any case, it looks like this is going to be more work than I have time for at the moment. Do you eventually plan to get back to making a Macintosh version?

    Catalina itself will probably compile, but possibly not some of the additional software it uses. For instance, I think your linker issue with "-E" may have been compiling Lua? I have no idea why Lua would need that particular linker option, but I wouldn't be confident I could ever change it, so I think you have to use gcc.

    The last time I tried compiling on a Mac (with gcc), everything compiled except Code::Blocks, which just required too much other software to be bothered with! I haven't tried compiling Geany on a Mac, but that is supposed to be possible.

    Next time I have access to a Macintosh, I will try it again. I almost bought one about a year ago, but we were short of money at the time, and I couldn't figure out how I could smuggle it in past my wife!

    In the meantime, you could just run Linux in a virtual machine on a Mac - https://www.wikihow.com/Run-Linux-on-a-Mac

    Ross.
  • RossH wrote: »
    David Betz wrote: »
    Yes, Xcode uses clang but I figured Catalina was probably just pretty vanilla C and should compile with any ANSI compiler. I guess that isn't true. Also, you are correct that bin/catalina_env exists in the downloaded archive. I'm not sure why I couldn't find it the first time I downloaded the sources. In any case, it looks like this is going to be more work than I have time for at the moment. Do you eventually plan to get back to making a Macintosh version?

    Catalina itself will probably compile, but possibly not some of the additional software it uses. For instance, I think your linker issue with "-E" may have been compiling Lua? I have no idea why Lua would need that particular linker option, but I wouldn't be confident I could ever change it, so I think you have to use gcc.

    The last time I tried compiling on a Mac (with gcc), everything compiled except Code::Blocks, which just required too much other software to be bothered with! I haven't tried compiling Geany on a Mac, but that is supposed to be possible.

    Next time I have access to a Macintosh, I will try it again. I almost bought one about a year ago, but we were short of money at the time, and I couldn't figure out how I could smuggle it in past my wife!

    In the meantime, you could just run Linux in a virtual machine on a Mac - https://www.wikihow.com/Run-Linux-on-a-Mac

    Ross.
    Yeah, it was while compiling Lua that most of the problems seemed to occur. Why is Lua needed anyway? In any case, I'll just run Catalina on Linux until you have the time to try to resolve these issues. Actually, would it be possible to separate Catalina into a number of different builds? All I really need is the compiler and linker and libraries. I don't need the IDE or debugger. When I use fastspin, I don't ever both with the GUI, I just build the command line tools.

  • Can you compile a separate standalone Lua under clang?
  • Can you compile a separate standalone Lua under clang?
    I suspect my problem is trying to use the Linux build script for building a Mac version. It could be that Lua has a Mac-specific makefile that would work just fine.

  • Yeah, you need to run `make macosx` to build it on a mac.
  • Lua is not required by Catalina itself - it is included in the payload loader to support scripting, which I use for compiler validation. I could make that capability optional, since many people probably won't ever use it - I will add that as a "to do" for the next release.

    But it is possible there are also other bits of software that won't compile using Clang.
  • RossH wrote: »
    Lua is not required by Catalina itself - it is included in the payload loader to support scripting, which I use for compiler validation. I could make that capability optional, since many people probably won't ever use it - I will add that as a "to do" for the next release.

    But it is possible there are also other bits of software that won't compile using Clang.
    I'll try eliminating Lua from the build to see if I can get further.

Sign In or Register to comment.