Opened 5 years ago

Last modified 5 years ago

#59347 assigned defect

gildas @201910b build failure: ld: framework not found CoreFoundation

Reported by: isabellemontoya Owned by: bardeau
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: Cc: claudia.cicone@…, nxrq67, jpinedaf (Jaime Pineda)
Port: gildas

Description

My operating system is macOS Mojave version 10.14.6. Xcode version 11.1(11A1027)

--->  Building gildas
Error: Failed to build gildas: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gildas/gildas/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gildas failed

Attachments (1)

main.log (378.8 KB) - added by isabellemontoya 5 years ago.
main log file

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by isabellemontoya

Attachment: main.log added

main log file

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Keywords: Gildas port Mojave removed
Owner: set to bardeau
Port: gildas added; Gildas removed
Status: newassigned
Summary: Gildas : processing of port Gildas failed - building failuregildas @201910b build failure: ld: framework not found CoreFoundation

comment:2 Changed 5 years ago by jpinedaf (Jaime Pineda)

following... I have the same issue.

comment:3 Changed 5 years ago by nxrq67

following.

comment:4 Changed 5 years ago by nxrq67

Cc: nxrq67 added

comment:5 Changed 5 years ago by jpinedaf (Jaime Pineda)

Cc: jpinedaf added

comment:6 Changed 5 years ago by kfkaplan

I am also having the same problem. Following. Let me know if it would be useful for me to post my main.log.

comment:7 Changed 5 years ago by smaret (Sebastien Maret)

@jpinedaf and @kfkaplan : are you also on Mojave and XCode 11.1 ?

comment:8 Changed 5 years ago by bardeau

Sorry for the late answer. You will find below a detailed description of the problem and workaround(s). Your feedback (success/failure) is welcome.

  • Symptom

Gildas build fails. The end of the main.log file shows:

  :info:build /opt/local/bin/gfortran-mp-9  -Wl,-commons,use_dylibs   -L/opt/local/lib -Wl,-headerpad_max_install_names  built/x86_64-darwin-gfortran/hlp2tex.o  -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gildas/gildas/work/gildas-src-oct19b/integ/x86_64-darwin-gfortran/bin/hlp2tex \
  :info:build           -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gildas/gildas/work/gildas-src-oct19b/integ/x86_64-darwin-gfortran/lib -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib   -L/opt/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -lgio-2.0 -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -lX11 -lXext -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lfontconfig -lfreetype -lgthread-2.0 -lglib-2.0 -lintl -L/opt/local/lib -lpng16  -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib -ldl -framework CoreFoundation -lpython2.7 -L/opt/local/lib -lcfitsio -lcurl  -lm -ldl
  :info:build ld: framework not found CoreFoundation
  :info:build collect2: error: ld returned 1 exit status

The framework named CoreFoundation is not found while it is present in the linker default search paths (see man ld):

Users/bardeau> ls -ld /System/Library/Frameworks/CoreFoundation.framework/
drwxr-xr-x  7 root  wheel  224 Nov  5 18:22 /System/Library/Frameworks/CoreFoundation.framework/
  • Context

The bug is reported under MacOSX Mojave 10.14 in conjunction with Xcode 11. Other combinations do not seem to fail.

  • Explanation

The linker is not correctly invoked by the compiler (gfortran-mp-9). It uses and/or misses options (in particular default paths) which are not suited for Xcode 11. This has been identified e.g. in this bug report: #58895 Basically, the installed version of compiler (mp-gcc9) is pre-compiled by a buildbot on MacPorts servers, but the resulting binaries do not seem correctly configured for Xcode 11.

  • Workarounds (choose only one of the 3 proposed solutions)

1) If possible, stick to Xcode 10. But it is unclear if downgrading Xcode is possible.

2) If possible, go for MacOSX Catalina. We have been reported the bug is not present in that version (to be confirmed).

3) Reinstall the compilers FROM SOURCES (i.e. taking correctly into account your environment) thanks to the -s flag:

     sudo port uninstall gcc9
     sudo port -v -s install gcc9

This process will take about 1 or 2 HOURS. The same is also true for Python 2.7: the default binaries won't be able to compile the Gildas-Python binary modules (pygreg.so etc). The solution is also to reinstall Python from sources:

     sudo port uninstall python27

Answer yes even if MacPorts warns this will leave broken ports. This is temporary for Python to be rebuilt. Then rebuild it

     sudo port -v -s install python27

This will take 1 or 2 minutes. Finally, reinstall Gildas. For safety restart the compilation from scratch:

     sudo port uninstall gildas
     sudo port install gildas
  • Permanently fixing the issue

We are documenting or creating tickets to MacPorts. It is unclear yet if a decent fix will be found.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 Changed 5 years ago by jpinedaf (Jaime Pineda)

thanks! I can confirm that fix #3 worked for me.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 5 years ago by kfkaplan

I was using Mac OS Mojave (10.14.6) and the Command Line Tools for Xcode 11.

Method 3, reinstalling from the sources, did not work for me but I was able to downgrade Command Line Tools (method 2) and that worked.

Here is what I did to install Gildas:

Delete or rename /Library/Developer/CommandLineTools I renamed it to CommandLineTools_backup

Go to https://developer.apple.com/account/ and log in. You might have to sign up for an Apple ID and/or change it to be a developer (if you have not done so).

Go to https://developer.apple.com/download/more/

Search for "command line tools (macOS 10.14) for Xcode 10.3"

Download and run the installer.

Open a new terminal and then run:

     sudo port uninstall gildas
     sudo port install gildas

You might already have it installed but if not, install XQuartz https://www.xquartz.org/index.html and then restart your machine

comment:11 Changed 5 years ago by bardeau

That's good to know that one other workaround (downgrading Xcode) can be used.

I should add also that since a few hours or so, MacPorts distributes pre-compiled versions (binaries) of Gildas (at least for the default installation). This means that you should have no more compilation issues, and no more need to reinstall the compilers or downgrading Xcode. The installation is just a decompression of an archive, so it takes a few seconds only. In other words, for those of you who still have an issue, trying to reinstall Gildas might work now.

Note: See TracTickets for help on using tickets.