Bug 215565

Summary: lang/julia Use system-defined compilers
Product: Ports & Packages Reporter: Yunchih Chen <yunchih.cat>
Component: Individual Port(s)Assignee: Li-Wen Hsu <lwhsu>
Status: Closed FIXED    
Severity: Affects Only Me CC: iblis.dif01, lantw44, lwhsu, yunchih.cat
Priority: --- Flags: bugzilla: maintainer-feedback? (iblis.dif01)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Use system-defined compilers
none
patch of files/patch-Make.inc iblis.dif01: maintainer-approval+

Description Yunchih Chen 2016-12-26 02:45:36 UTC
Created attachment 178279 [details]
Use system-defined compilers

My julia build failed with the following error:

===>  Building for julia-0.5.0
gmake[1]: Entering directory '/wrkdirs/usr/ports/lang/julia/work/julia-0.5.0'
Creating usr/etc/julia/juliarc.jl
Copying in usr/share/man/man1/julia.1
Copying in usr/share/doc/julia/examples
gmake[2]: Entering directory '/wrkdirs/usr/ports/lang/julia/work/julia-0.5.0/deps'
gmake[3]: Entering directory '/wrkdirs/usr/ports/lang/julia/work/julia-0.5.0/deps/build/openspecfun-39699a1c1824bf88410cabb8a7438af91ea98f4c'
gmake[3]: gfortran: Command not found
gmake[3]: *** [Make.inc:69: amos/d1mach.f.o] Error 127
gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/julia/work/julia-0.5.0/deps/build/openspecfun-39699a1c1824bf88410cabb8a7438af91ea98f4c'
gmake[2]: *** [/wrkdirs/usr/ports/lang/julia/work/julia-0.5.0/deps/openspecfun.mk:24: build/openspecfun-39699a1c1824bf88410cabb8a7438af91ea98f4c/libopenspecfun.so] Error 2

The patch specifies the CC, CXX, FC environment variables such that the desired compilers are used.

--
Yunchih Chen, NTUCSIE WSLAB TA
Comment 1 Iblis Lin 2016-12-26 03:30:09 UTC
I think the correct FC has been set by USE=fortran.

https://svnweb.freebsd.org/ports/head/Mk/Uses/fortran.mk?revision=419511&view=markup#l39

What is your `make -V MAKE_ENV` ?
Comment 2 Yunchih Chen 2016-12-26 15:40:50 UTC
Here's the log of failed build:
https://pkgbuild.csie.ntu.edu.tw/pkg-stat/data/freebsd10-default-workstation/2016-12-25_08h41m28s/logs/errors/julia-0.5.0.log

and here's one with the above patch, which builds successfully:
https://pkgbuild.csie.ntu.edu.tw/pkg-stat/data/freebsd10-default-workstation/2016-12-25_18h21m38s/logs/julia-0.5.0.log

`FC="gfortran49"` is in MAKE_ENV of both builds; yet in the failed one, "gfortran" is the actual one used (which is rather bizarre?).
Comment 3 Iblis Lin 2016-12-26 16:51:48 UTC
Created attachment 178293 [details]
patch of files/patch-Make.inc

It seems that julia's Makefile do not respect FC from environment.

Please try out this patch.
Comment 4 Yunchih Chen 2016-12-27 06:55:22 UTC
Thanks, the patch-Make.inc patch works for me, here's the log:

https://pkgbuild.csie.ntu.edu.tw/pkg-stat/data/freebsd10-default-workstation/2016-12-27_14h43m54s/logs/julia-0.5.0.log
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-12-27 09:59:27 UTC
A commit references this bug:

Author: lwhsu
Date: Tue Dec 27 09:59:18 UTC 2016
New revision: 429589
URL: https://svnweb.freebsd.org/changeset/ports/429589

Log:
  - Respect CC, CXX, FC

  PR:		215565
  Submitted by:	Yunchih Chen <yunchih.cat@gmail.com>
  Approved by:	Iblis Lin <iblis@hs.ntnu.edu.tw> (maintainer)

Changes:
  head/lang/julia/files/patch-Make.inc