Code Blocks Mac Catalina



CODEBLOCKS CATALINA UPDATE: If you have upgraded your macOS to the latest Catalina version you won’t be able to run CodeBlocks since it is not updated to be compatible with Catalina. Apple ended its support for 32-bit apps with this update. Due to lack of active developers by the Code::Blocks team there is currently no native Code::Blocks version available for the macOS platform which is newer than v13.12 (Published 2013). Code Blocks For Mac Os Catalina 10 As we say goodbye to iTunes, macOS Catalina brings in new apps and features to the table, including Apple Music, Podcasts Books, and TV. Another major feature is Sidecar, which can turn your iPad into another display. For ordinary users, this means getting a secondary display for free. Jan 07, 2019 Due to lack of active developers by the Code::Blocks team there is currently no native Code::Blocks version available for the macOS platform which is newer than v13.12 (Published 2013).

in Propeller 2
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

Code blocks mac catalina version
  • edited 2020-07-30 03:26
    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.
  • edited 2020-07-30 13:28
    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: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.
  • 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: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?
  • edited 2020-07-31 00:41
    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?
  • 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.
  • 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.
  • 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.
  • Lua build/install on macOS:

Posted on October 12, 2019 by Paul

Updated 8 May 2020

In this tutorial, I will show you how to compile from source and install the current stable version of GCC on your macOS computer. The instructions from this tutorial were tested on Catalina (macOS 10.15).

Clang, the default compiler for macOS, supports only C, C++, Objective-C and Objective-C++. If you are interested in a modern Fortran compiler, e.g. you will need gfortran that comes with GCC. Another reason to have the latest stable version of GCC on your macOS is that it provides you with an alternative C and C++ compiler. Testing your code with two different compilers is always a good idea.

Building GCC 10 from sources could take some time, in my case it took about two hours on a MacBook Air with a 16GB of RAM.

In order to compile GCC from sources you will need a working C++ compiler. In the remaining of this article I will assume that you have installed the Command Line Tools for Xcode. At the time of this writing Apple’s Command Line Tools maps the gcc and g++ to clang and clang++. If you don’t have the Command Line Tools installed, open a Terminal and write:

which will guide you through the installation process.

Let’s start by creating a working folder:

Next, we can download and extract the latest stable version of GCC:

GCC 10 depends on a couple of other libraries (GSL, GMP, MPFR and ISL) that can be downloaded with:

the above four prerequisites will be built during the GCC build.

We are ready to compile GCC now. Be prepared that this could take some time … Since I’m interested only in the C, C++ and Fortran compilers, this is the configure command I’ve used on my machine:

The above command instructs the configure app to add a prefix to all the resulting executable programs, so for example if you want to invoke GCC 10.1.0 you will write gcc-10.1, the gcc command will invoke Apple’s version of clang.

If you are interested in building more compilers available in the GCC collection modify the –enable-languages configure option.

And now, the final touches:

Grab a coffee, maybe a book, and wait … this should take approximately, depending on your computer configuration, an hour … or more … and about 4.15GB of your disk space for the build folder.

Install the compiled gcc in /usr/local/gcc-10.1.0:

Now, you can keep the new compiler completely isolated from your Apple’s gcc compiler and, when you need to use it, just modify your path by writing in Terminal:

If you want to avoid writing the above command each time you open a Terminal, save the above command in the file .zshrc from your Home folder, e.g:

You should be able to invoke any of the newly built compilers C, C++, Fortran …, invoking g++ is as simple as writing in your Terminal:

Remember to erase the working folder from your HOME if you want to recover some space:

Mac

Next, I’ll show you how to check if the compiler was properly installed by compiling and running a few examples. GCC 10 uses by default the C++14 standard and C11 for the C coders, you should be able to compile any valid C++14 code directly. In your favorite text editor, copy and save this test program (I’ll assume you will save the file in your Home directory):

Compiling and running the above lambda example:

We could also compile a C++ code that uses threads:

Next, we present a simple C++ code that uses regular expressions to check if the input read from stdin is a floating point number:

If you are a Fortran programmer, you can use some of the Fortran 2008 features like doconcurrent with gfortran-10.1:

The above code can be compiled with (assuming you’ve saved it as tst_concurrent_do.f90):

If you are interested in learning more about the new C++11/C++14 syntax I would recommend reading The C++ Programming Language by Bjarne Stroustrup.

or, Professional C++ by M. Gregoire, N. A. Solter, S. J. Kleper 2nd edition:

If you need to brush your Fortran knowledge a good book is Modern Fortran Explained by M. Metcalf, J. Reid and M. Cohen:

Code Blocks Mac Catalina Update


How To Install Code Blocks In Mac

Show Comments