Skip to content

misc/cgo/fortran, cmd/dist: Fortran Support Causing go/src/all.bash to Fail #14544

Closed
@odysseus9672

Description

@odysseus9672

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version
    go version devel +7da4ced Sat Feb 27 21:12:19 2016 +0000 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?
    go env
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH=""
    GORACE=""
    GOROOT="/Users/sean/goLang/go"
    GOTOOLDIR="/Users/sean/goLang/go/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
  3. What did you do?
    (Use play.golang.org to provide a runnable example, if possible.)
    Run $GOROOT/src/all.bash
  4. What did you expect to see?
    A successful build and run of the test suite.
  5. What did you see instead?
##### ../misc/cgo/fortran
# _/Users/sean/goLang/go/misc/cgo/fortran
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL    _/Users/sean/goLang/go/misc/cgo/fortran [build failed]
FAIL: go test
2016/02/27 14:47:14 Failed: exit status 1

The 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

I'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:

1: an explicit path to the fortran compiler to use,
2: the linker flag for things that need the standard fortran libs, and
3: a flag to disable the fortran feature if it isn't desired.

Maybe 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions