{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/14544","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14544/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14544/comments","events_url":"https://api.github.com/repos/golang/go/issues/14544/events","html_url":"https://github.com/golang/go/issues/14544","id":136979643,"number":14544,"title":"misc/cgo/fortran, cmd/dist: Fortran Support Causing go/src/all.bash to Fail","user":{"login":"odysseus9672","id":4352294,"avatar_url":"https://avatars.githubusercontent.com/u/4352294?v=3","gravatar_id":"","url":"https://api.github.com/users/odysseus9672","html_url":"https://github.com/odysseus9672","followers_url":"https://api.github.com/users/odysseus9672/followers","following_url":"https://api.github.com/users/odysseus9672/following{/other_user}","gists_url":"https://api.github.com/users/odysseus9672/gists{/gist_id}","starred_url":"https://api.github.com/users/odysseus9672/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odysseus9672/subscriptions","organizations_url":"https://api.github.com/users/odysseus9672/orgs","repos_url":"https://api.github.com/users/odysseus9672/repos","events_url":"https://api.github.com/users/odysseus9672/events{/privacy}","received_events_url":"https://api.github.com/users/odysseus9672/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/31","html_url":"https://github.com/golang/go/milestones/Go1.7","labels_url":"https://api.github.com/repos/golang/go/milestones/31/labels","id":1414133,"number":31,"title":"Go1.7","description":"","creator":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"open_issues":216,"closed_issues":66,"state":"open","created_at":"2015-11-16T16:57:07Z","updated_at":"2016-02-29T02:34:10Z","due_on":"2016-07-31T07:00:00Z","closed_at":null},"comments":17,"created_at":"2016-02-27T23:08:22Z","updated_at":"2016-02-29T03:37:54Z","closed_at":null,"body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n1. What version of Go are you using (`go version`)?\r\ngo version\r\ngo version devel +7da4ced Sat Feb 27 21:12:19 2016 +0000 darwin/amd64\r\n\r\n\r\n2. What operating system and processor architecture are you using (`go env`)?\r\ngo env\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOEXE=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\nGOOS=\"darwin\"\r\nGOPATH=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/Users/sean/goLang/go\"\r\nGOTOOLDIR=\"/Users/sean/goLang/go/pkg/tool/darwin_amd64\"\r\nCC=\"clang\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common\"\r\nCXX=\"clang++\"\r\nCGO_ENABLED=\"1\"\r\n\r\n\r\n3. What did you do?\r\n(Use play.golang.org to provide a runnable example, if possible.)\r\nRun $GOROOT/src/all.bash\r\n\r\n\r\n4. What did you expect to see?\r\nA successful build and run of the test suite.\r\n\r\n5. What did you see instead?\r\n```\r\n##### ../misc/cgo/fortran\r\n# _/Users/sean/goLang/go/misc/cgo/fortran\r\nld: library not found for -lgfortran\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\nFAIL\t_/Users/sean/goLang/go/misc/cgo/fortran [build failed]\r\nFAIL: go test\r\n2016/02/27 14:47:14 Failed: exit status 1\r\n```\r\n\r\nThe root of the problem is that the gfortran I use is supplied by the Fink software distribution (gcc5 package). Because of that, I need to find a way to get this into the LDFLAGS for the build process: -L/sw/lib/gcc5/lib\r\n\r\nI've tried setting the environment variable before running all.bash, and that doesn't help. Ideally, there should three options that can be passed in to the build process to address this issue:\r\n\r\n1: an explicit path to the fortran compiler to use,\r\n2: the linker flag for things that need the standard fortran libs, and\r\n3: a flag to disable the fortran feature if it isn't desired.\r\n\r\nMaybe a set of environment variables (eg. GoFortran, GoFortranLibDir), where the fortran feature only kicks in if the first is set to the path of the fortran compiler and the second is a (list of?) directories to include in the linker's search space for fortran related builds."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/190024583","html_url":"https://github.com/golang/go/issues/14544#issuecomment-190024583","issue_url":"https://api.github.com/repos/golang/go/issues/14544","id":190024583,"user":{"login":"odysseus9672","id":4352294,"avatar_url":"https://avatars.githubusercontent.com/u/4352294?v=3","gravatar_id":"","url":"https://api.github.com/users/odysseus9672","html_url":"https://github.com/odysseus9672","followers_url":"https://api.github.com/users/odysseus9672/followers","following_url":"https://api.github.com/users/odysseus9672/following{/other_user}","gists_url":"https://api.github.com/users/odysseus9672/gists{/gist_id}","starred_url":"https://api.github.com/users/odysseus9672/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odysseus9672/subscriptions","organizations_url":"https://api.github.com/users/odysseus9672/orgs","repos_url":"https://api.github.com/users/odysseus9672/repos","events_url":"https://api.github.com/users/odysseus9672/events{/privacy}","received_events_url":"https://api.github.com/users/odysseus9672/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T03:37:54Z","updated_at":"2016-02-29T03:37:54Z","body":"I've also applied the patch mentioned, and here's the output.\r\n\r\n```\r\n##### ../misc/cgo/fortran\r\n[gfortran -I /Users/sean/goLang/go/misc/cgo/fortran -fPIC -m64 -pthread -fmessage-length=0 -gno-record-gcc-switches -fno-common -I /var/folders/75/tsmllrjr8xl81b0059bfyyd00000gs/T/go-build122949776/_/Users/sean/goLang/go/misc/cgo/fortran/_test/_obj_test/ -g -O2 -o /var/folders/75/tsmllrjr8xl81b0059bfyyd00000gs/T/go-build122949776/_/Users/sean/goLang/go/misc/cgo/fortran/_test/_obj_test/answer.f90.o -c /Users/sean/goLang/go/misc/cgo/fortran/answer.f90]\r\n[MANPATH=/sw/share/man:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Library/TeX/texbin/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man:/sw/lib/perl5/5.18.2/man TERM_PROGRAM=Apple_Terminal XDG_DATA_HOME=/Users/sean/.local/share GNUPLOT_DEFAULT_GDFONT=Arial SHELL=/bin/bash TERM=dumb HGENCODING=UTF-8 TMPDIR=/var/folders/75/tsmllrjr8xl81b0059bfyyd00000gs/T/ PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.dz7wyAWdKm/Render TERM_PROGRAM_VERSION=343.7 TERM_SESSION_ID=BF74C4EF-BB90-4561-AD2F-A61262C190F4 ac_cv_path_INTLTOOL_PERL=/usr/bin/perl XAPPLRESDIR=/sw/etc/app-defaults/ GOROOT_BOOTSTRAP=/Users/sean/golang/go1.4.3 SGML_CATALOG_FILES=/sw/etc/sgml/catalog USER=sean GDK_USE_XFT=1 GDFONTPATH=/Library/Fonts SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.aRfIhVGsJj/Listeners __CF_USER_TEXT_ENCODING=0x1F9:0x0:0x0 GNOME_DISABLE_CRASH_DIALOG=1 XDG_CONFIG_DIRS=/sw/etc/xdg PATH=/Users/sean/goLang/go/bin:/Users/sean/mybin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Users/sean/goLang/go/bin HG=/sw/bin/hg XML_CATALOG_FILES=/sw/etc/xml/catalog PWD=/Users/sean/goLang/go/misc/cgo/fortran LANG=C XPC_FLAGS=0x0 IRCNAME=BlackGriffen IRCUSER=BlackGriffen GOMAXPROCS=4 XPC_SERVICE_NAME=0 IRCNICK=BlackGriffen SHLVL=2 HOME=/Users/sean bc03=/Users/sean/AstroTools/bc03/src GOROOT=/Users/sean/goLang/go XDG_CONFIG_HOME=/Users/sean/.config XDG_CACHE_HOME=/Users/sean/.cache PYTHONPATH=/Users/sean/lib LOGNAME=sean XDG_DATA_DIRS=/sw/share DBUS_SESSION_BUS_ADDRESS=launchd:env=DBUS_FINK_SESSION_BUS_SOCKET GOHOSTOS=darwin INFOPATH=/sw/share/info:/sw/info:/usr/share/info CC=clang XDG_RUNTIME_DIR=/var/folders/75/tsmllrjr8xl81b0059bfyyd00000gs/C/ DISPLAY=/private/tmp/com.apple.launchd.5ZSuFRU7vW/org.macosforge.xquartz:0 LADSPA_PATH=/sw/lib/ladspa SECURITYSESSIONID=186a5 GOARCH=amd64 GOHOSTARCH=amd64 GOOS=darwin GOTOOLDIR=/Users/sean/goLang/go/pkg/tool/darwin_amd64 GOGCCFLAGS=-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common CXX=clang++ CGO_ENABLED=1 GO386=sse2 GOARM=7 LANGUAGE=en_US.UTF8]\r\n# _/Users/sean/goLang/go/misc/cgo/fortran\r\nld: library not found for -lgfortran\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\nFAIL\t_/Users/sean/goLang/go/misc/cgo/fortran [build failed]\r\n2016/02/28 19:37:03 Failed: exit status 2\r\n```"}}