Modify

Opened 5 years ago

Last modified 4 months ago

#1471 new enhancement

Cactus should auto-detect newer versions of GCC from MacPorts

Reported by: Ian Hinder Owned by:
Priority: minor Milestone:
Component: Cactus Version: development version
Keywords: Cc:

Description

Currently, during Cactus configuration without an optionlist on Mac OS, I get

checking for gcc-mp-4.4... no
checking for gcc-mp-4.3... no
checking for gcc-mp-4.2... no
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes

I have gcc-mp-4.6, and 4.7 and 4.8 are also available in macports. The configure script should be updated to detect these versions.

Attachments (0)

Change History (10)

comment:1 Changed 5 months ago by Roland Haas

Does MacPorts still call its compilers like this? If so then we should also add the homebrew equivalents ie gcc-6, gc-7 etc.

comment:2 Changed 5 months ago by Steven R. Brandt

Actually, I'm wondering if we need to bother with any of these checks. While "gcc" on Mac is clang, the ET compiles and the test suite runs (apart from the memory test thorn).

comment:3 Changed 5 months ago by Roland Haas

I guess the danger that would come to my mind would be if some of macports' packages are compiled with its own gcc or g++ and need a runtime library (eg C++ STL or something similar) that is not compatible with libraries that clang uses.

In your test code did you build some (all, a few) of the ExternalLibraries from the tarball in the ET or use them from macports (eg the ones that Ian's instructions ask to install)?

comment:4 Changed 5 months ago by anonymous

Good point, Roland. Not sure.

comment:5 Changed 4 months ago by Ian Hinder

Steve, are you sure that the full ET can be compiled on a Mac with Apple's gcc? What does it use for Fortran compiler? It would be great to be able to compile without needing MacPorts' or HomeBrew's compilers installed, but I was never able to get this to work, and in the end gave up because I couldn't find a clean working solution better than what we currently have.

comment:6 Changed 4 months ago by Roland Haas

It will use gfortran from HomeBrew or MacPorts (the later I don't know). So you end up with a mixed compile of clang+gfortran.

You still need HomeBrew or MacPorts.

Last edited 4 months ago by Roland Haas (previous) (diff)

comment:7 Changed 4 months ago by Erik Schnetter

Mixing Clang and GCC in this way leads to trouble. In particular, their OpenMP implementations are different, leading to link errors last time I checked. If linking worked, it is likely there would be segfaults at run time. You can make it work if you disable OpenMP.

I also don't see a good reason to mix compilers this way. If you install gfortran, you already have gcc and g++ as well, so you might as well use them to simplify things.

comment:8 Changed 4 months ago by Steven R. Brandt

Sorry, I meant to reply to Ian's earlier comment and clarify.

I checked out a Mac from CCT, installed brew, then installed gcc, g++, gfortran, etc. (all the packages we recommend) then compiled the ET with generic.cfg and ran the test suite. Everything worked except for the Memory Test thorn.

I have not repeated this test for port as yet.

comment:9 Changed 4 months ago by Ian Hinder

Do you know if it was using gcc from Homebrew, or if it was using the Apple-provided clang (named "gcc")? Regardless, if this is true, then it would simplify things for Homebrew users, if they didn't need to use a custom optionlist, and could instead use generic.cfg.

comment:10 Changed 4 months ago by Steven R. Brandt

Ian, gcc -version showed that it was clang.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
Next status will be 'confirmed'.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.