I have a Makefile to compile several fortran files, most of which are module files. Whenever I changed the module file and initiate make command, the make says:
make: `PRM' is up to date.
PRM is the executable name. No such problem when I changed the main file. Another problem is that sometimes I also get:
make: m2c: Command not found
error. My makefile looks like:
.SUFFIXES: .f90
F90 = pgf90
NETCDF_DIR = /opt/netcdf
F90_FLAGS = -Mbackslash -Mlarge_arrays
LIBS = -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf
INCLUDE_MODULES = -I$(NETCDF_DIR)/include
VPATH = /path/FORTRAN
util_module = \
precmod.o \
strings.o
EXEC = PRM
OBJS = \
${util_module} \
mo_date.o \
mo_utils.o \
module_metcro_lib.o \
module_plumerise1.o \
module_finn_lib.o \
main_plm.o
${EXEC} : ${OBJS}
${F90} -o $# ${OBJS} ${LIBS}
.f90.o:
${F90} -c ${F90_FLAGS} ${INCLUDE_MODULES} $<
clean:
rm -f ${EXEC} ${OBJS} *.mod
thanks for answering!
Related
I am following a code from GitHub (https://github.com/dmalhotra/pvfmm).
There is a Fortran file in ./examples/src/example-f.f90. I have created a subroutine from this example-f.f90 so that I can make an object file out of it and can call this subroutine in our in-house code. The installation guide is given here (https://github.com/dmalhotra/pvfmm/blob/develop/INSTALL).
The Makefile to compile the example-f.f90 is as (https://github.com/dmalhotra/pvfmm/blob/develop/examples/Makefile):
ifndef PVFMM_DIR
PVFMM_DIR=./..
endif
-include $(PVFMM_DIR)/MakeVariables
ifndef CXX_PVFMM
$(error Cannot find file: MakeVariables)
endif
# FC=$(FC_PVFMM) # TODO: for now, FC must be provided by user
# CC=$(CC_PVFMM) # TODO: for now, CC must be provided by user
CXX=$(CXX_PVFMM)
CXXFLAGS=$(CXXFLAGS_PVFMM)
LDLIBS=$(LDLIBS_PVFMM)
RM = rm -f
MKDIRS = mkdir -p
BINDIR = ./bin
SRCDIR = ./src
OBJDIR = ./obj
INCDIR = ./include
TARGET_BIN = \
$(BINDIR)/example1 \
$(BINDIR)/example2 \
$(BINDIR)/example-sctl \
$(BINDIR)/fmm_pts \
$(BINDIR)/fmm_cheb
all : $(TARGET_BIN)
$(BINDIR)/%: $(SRCDIR)/%.f90
-#$(MKDIRS) $(dir $#)
$(PVFMM_DIR)/libtool --mode=link --tag=FC $(FC) $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $#
...
The MakeVariables can be found in the above link.
I changed this make file so that I can make an object file of example-f.f90 (subroutine, I converted as I told before to link it in our in-house code) and also other files in our in-house code and link at the end. The new makefile looks like:
ifndef PVFMM_DIR
PVFMM_DIR=./..
endif
-include $(PVFMM_DIR)/MakeVariables
ifndef CXX_PVFMM
$(error Cannot find file: MakeVariables)
endif
FC_PVMM = mpif90
FC = mpif90
FC=$(FC_PVFMM) # TODO: for now, FC must be provided by user
CC=$(CC_PVFMM) # TODO: for now, CC must be provided by user
CXX=$(CXX_PVFMM)
CXXFLAGS=$(CXXFLAGS_PVFMM)
LDLIBS=$(LDLIBS_PVFMM)
RM = rm -f
MKDIRS = mkdir -p
BINDIR = ./bin
SRCDIR = ./src
OBJDIR = ./obj
INCDIR = ./include
all : $(project_final)
project_final: $(project)
$(PVFMM_DIR)/libtool --mode=link --tag=FC mpif90 $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $#
project: example-f.o
cd ./src && $(MAKE)
example-f.o: $(SRCDIR)/example-f.f90
$(PVFMM_DIR)/libtool --mode=link --tag=FC mpif90 $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -c $#
...
Kindly note 'project: example-f.o
cd ./src && $(MAKE)' doing to make object files of our inhouse code. In src we have separate makefile to create object files for out in-house code.
But it gives me the following:
cd ./examples && make;
make[1]: Entering directory '/home/bidesh/Coding/FMM/pvfmm-1.3.0/examples'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/bidesh/Coding/FMM/pvfmm-1.3.0/examples'
How can I modify the makefile so that I can compile the whole code that includes example-f.f90 (subroutine) along with other subroutines (in-house code)?
Thanks a lot.
I am trying to make a code called iPIC3D and it has some prerequisite libraries such as HDF5, H5hut etc. I did everything as instructed. One has to install all the prerequisites and then run the "make" command. But while running the make command, I get a series of errors such as
/usr/local/hdf5/1.8.11-par/lib/libhdf5.a(H5Zdeflate.o): In function `H5Z_filter_deflate':
H5Zdeflate.c:(.text+0xf1): undefined reference to `compress2'
H5Zdeflate.c:(.text+0x1af): undefined reference to `inflateInit_'
H5Zdeflate.c:(.text+0x1c9): undefined reference to `inflate'
H5Zdeflate.c:(.text+0x27a): undefined reference to `inflateEnd'
H5Zdeflate.c:(.text+0x2dc): undefined reference to `inflateEnd'
H5Zdeflate.c:(.text+0x3de): undefined reference to `inflateEnd'
collect2: error: ld returned 1 exit status
make: *** [main] Error 1
Here is a copy of my makefile for reference
PIC_HOME = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
## SECTION THAT DEPENDS ON THE SYSTEM
# -- Modify this variables according
# -- to your system options.
# -- Possible flags:
# -DPARALLEL_IO Use parallel HDF5
# -DUSEH5HUT Use H5hut (must include also -DPARALLEL_IO)
# -DBATSRUS Coupling with BATS-R-US
CXX = mpicxx
HDF5_HOME = /usr/local/hdf5/1.8.11-par
H5HUT_HOME = /usr/local/H5hut/1.8.11
IPIC_FLAGS = "-DUSEH5HUT -DPARALLEL_IO"
## END OF SECTION
OPTIM = -O3
HDF5_LIB = $(HDF5_HOME)/lib/libhdf5_hl.a $(HDF5_HOME)/lib/libhdf5.a
H5HUT_LIB = $(H5HUT_HOME)/lib/libH5hut.a
H5HUTIO_LIB = $(IPIC_HOME)/H5hut-io/libH5hut-io.a
INC_DIR = ./include
INC_H5HUT = $(H5HUT_HOME)/include
INC_H5HUTIO = $(IPIC_HOME)/H5hut-io/include
INC_HDF5 = $(HDF5_HOME)/include
.SUFFIXES:
.SUFFIXES: .cpp .o .h
SRC = \
$(IPIC_HOME)/grids/Grid3DCU.cpp \
$(IPIC_HOME)/fields/BCStructure.cpp \
$(IPIC_HOME)/fields/EMfields3D.cpp \
$(IPIC_HOME)/inputoutput/phdf5.cpp \
$(IPIC_HOME)/inputoutput/Restart3D.cpp \
$(IPIC_HOME)/inputoutput/ParallelIO.cpp \
$(IPIC_HOME)/inputoutput/Collective.cpp \
$(IPIC_HOME)/performances/Timing.cpp \
$(IPIC_HOME)/PSKOutput3D/PSKhdf5adaptor.cpp \
$(IPIC_HOME)/bc/BcParticles.cpp \
$(IPIC_HOME)/bc/BcFields3D.cpp \
$(IPIC_HOME)/mathlib/EllipticF.cpp \
$(IPIC_HOME)/solvers/CG.cpp \
$(IPIC_HOME)/solvers/GMRES.cpp \
$(IPIC_HOME)/ConfigFile/src/ConfigFile.cpp \
$(IPIC_HOME)/main/iPic3Dlib.cpp \
$(IPIC_HOME)/particles/Particles3Dcomm.cpp \
$(IPIC_HOME)/particles/Particles3D.cpp \
$(IPIC_HOME)/communication/ComNodes3D.cpp \
$(IPIC_HOME)/communication/ComParser3D.cpp \
$(IPIC_HOME)/communication/ComInterpNodes3D.cpp \
$(IPIC_HOME)/communication/ComParticles3D.cpp \
ALLOBJ = $(subst .cpp,.o,$(SRC))
IPIC3D_EXE = $(IPIC_HOME)/iPic3D
IPIC3D_LIB = $(IPIC_HOME)/libiPic3Dlib.a
LDLIBS = $(IPIC3D_LIB) $(H5HUTIO_LIB) $(H5HUT_LIB) $(HDF5_LIB) -ldl
all : io lib main
io :
CXX=$(CXX) HDF5_HOME=$(HDF5_HOME) H5HUT_HOME=$(H5HUT_HOME) IPIC_FLAGS=$(IPIC_FLAGS) $(MAKE) -C $(IPIC_HOME)/H5hut-io
lib : $(ALLOBJ)
$(AR) sr $(IPIC3D_LIB) $(ALLOBJ)
ranlib $(IPIC3D_LIB)
main : iPic3D.o
$(CXX) $(LDFLAGS) -I$(INC_DIR) -I$(INC_HDF6) iPic3D.cpp -o $(IPIC3D_EXE) $(LDLIBS)
clean : cleanio
$(RM) $(ALLOBJ)
$(RM) $(IPIC3D_LIB)
$(RM) iPic3D.o
$(RM) $(IPIC3D_EXE)
cleanio :
$(MAKE) -C $(IPIC_HOME)/H5hut-io clean
%.o : %.cpp
echo " Compiling " $#
$(CXX) $(CXXFLAGS) $(OPTIM) $(IPIC_FLAGS) -I$(INC_DIR) -I$(INC_H5HUTIO) -I$(INC_H5HUT) -I$(INC_HDF5) -c $< -o $#
I am unable to understand what exactly is causing this problem.
I would say you are missing linking in the libz library as this is where the compress2 function should come from. Try adding -lz to your LDLIBS.
yesterday I wrote a Makefile to build a Programm which works fine.
Now, I try to build different build configurations.
What is the recommended way to build different configurations which differ in the list of source files and output paths?
I tried to use target specific variables...
Executables of the compiler toolchain.
COMPILER := ccrl
LINKER := rlink
ASSEMBLER := asrl
DEVICE_FILE := DR5F100LL.DVF
Compiler flags used to generate *.d files.
DFLAGS := \
-MM \
-MP \
-cpu=S2 \
-dev="$(DEVICE_FILE)" \
-no_warning_num=11179,11180 \
-g \
-Onothing
Compiler flags used to generate *.obj files from c source files.
CFLAGS := \
-cpu=S2 \
-c \
-dev="$(DEVICE_FILE)" \
-no_warning_num=11179,11180 \
-g \
-Onothing
Compiler flags used to generate *.obj files from assembler files.
ASMFLAGS := $(CFLAGS)
Linker flags
LDFLAGS := \
-library="${COMPILER_PATH}/lib/rl78cm4s.lib" \
-library="${COMPILER_PATH}/lib/rl78cm4r.lib" \
-library="./FFT_Library/libfft_rl78g13.lib" \
-nooptimize \
-entry=_start \
-security_id=00000000000000000000 \
-ocdbg=04 \
-user_opt_byte=EEFFE9 \
-debug \
-nocompress \
-memory=high \
-vectn=2=ffff \
-rom=.data=.dataR \
-rom=.sdata=.sdataR \
-nomessage \
-device="$(DEVICE_FILE)" \
-nologo \
-start=.const,.text,.RLIB,.SLIB,.textf,.constf,.data,.sdata/03000,.dataR,.bss/0F7F00,.sdataR,.sbss/0FFE20
Include directories
C_INCS := \
-I${COMPILER_PATH}/inc \
...
C source files used build the program.
C_SRCS_FFT_TEST := \
CodeGenerator/r_cg_cgc.c \
...
C_SRCS_HISTORY_TEST := \
CodeGenerator/r_cg_cgc.c \
...
C_SRCS_IOLINK_TEST := \
CodeGenerator/r_cg_cgc.c \
...
Assembler files used to build the program.
ASM_SRCS := \
...
Root directories of the build results.
OUT_ROOT_DIR := build
PUBLISH_ROOT_DIR := publish
.SECONDEXPANSION:
Name of the build configuration.
BUILD_CONFIG = Unknown
OUT_DIR =$(OUT_ROOT_DIR)/$(BUILD_CONFIG)
PUB_DIR =$(PUBLISH_ROOT_DIR)/$(BUILD_CONFIG)
Determine file paths of generated files.
OBJS = $(patsubst %.c,$(OUT_DIR)/%.obj,$(C_SRCS))
OBJS += $(patsubst %.asm,$(OUT_DIR)/%.obj,$(ASM_SRCS))
DEPS = $(OBJS:.obj=.d)
Filenames of the output files.
OUT_FILE = $(PUB_DIR)/MyFile.abs
MAP_FILE = $(OUT_DIR)/MyFile.map
.PHONY: build-definitions
build-definitions: fft-test history-test iolink-test
fft-test: BUILD_CONFIG=FFT_Test
fft-test: C_SRCS=$(C_SRCS_FFT_TEST)
.PHONY: fft-test
fft-test: $$(OUT_FILE)
history-test: BUILD_CONFIG=History_Test
history-test: C_SRCS=$(C_SRCS_HISTORY_TEST)
.PHONY: history-test
history-test:
#echo -e "Building $(BUILD_CONFIG)."
iolink-test: BUILD_CONFIG=IOLink_Test
iolink-test: C_SRCS=$(C_SRCS_IOLINK_TEST)
.PHONY: iolink-test
iolink-test:
#echo -e "Building $(BUILD_CONFIG)."
.PHONY: all
all: pre-build $(OUT_FILE) post-build
.PHONY: pre-build
pre-build:
#echo -e "Run pre-build target."
.PHONE: post-build
post-build:
#echo -e "Run post-build target."
.PHONY: clean
clean:
#echo -e "Run clean target."
#rm -f -v $(OUT_DIR)/LinkerSubCommand.tmp
#rm -f -v $(OBJS)
#rm -f -v $(DEPS)
#rm -f -v $(OUT_FILE)
#rm -f -v $(MAP_FILE)
How to build the dependency file from a c source file.
$(OUT_DIR)/%.d : %.c
#echo 'Building d file: $<'
#mkdir -p "$(dir $#)"
$(COMPILER) $(DFLAGS) $(C_INCS) -o "$(#:%.obj=%.d)" -MT="$#" -MT="$(#:%.obj=%.d)" "$<"
How to build the dependency file from an asm file.
$(OUT_DIR)/%.d : %.asm
#echo 'Building d file: $<'
#mkdir -p "$(dir $#)"
$(COMPILER) $(DFLAGS) $(C_INCS) -o "$(#:%.obj=%.d)" -MT="$#" -MT="$(#:%.obj=%.d)" "$<"
How to build the object file from a c source file.
$(OUT_DIR)/%.obj : %.c
#echo 'Building obj file: $<'
#mkdir -p "$(dir $#)"
$(COMPILER) $(CFLAGS) $(C_INCS) -o "$#" "$<"
#echo -e $(#:%=-input=\"%\") >> $(OUT_DIR)/LinkerSubCommand.tmp
How to build the object file from an asm file.
$(OUT_DIR)/%.obj : %.asm
#echo 'Building asm file: $<'
#mkdir -p "$(dir $#)"
$(COMPILER) $(CFLAGS) $(C_INCS) -o "$#" "$<"
#echo -e $(#:%=-input=\"%\") >> $$(OUT_DIR)/LinkerSubCommand.tmp
#
$(OBJ): %.obj: %.c $(DEPS)
How to build the output file from all object files.
%.abs : $(OBJS)
#echo -e "Building $(BUILD_CONFIG)."
#echo -e "The output directory is $(OUT_DIR)."
#echo -e "The publish directory is $(PUB_DIR)."
#echo -e "The source files are $(C_SRCS)."
#echo -e "The assembler files are $(ASM_SRCS)."
#echo -e "The generated object files are $(OBJS)."
#echo -e "Building output file is $#."
#mkdir -p "$(PUB_DIR)"
#mkdir -p "$(OUT_DIR)"
$(LINKER) $(LDFLAGS) -subcommand="$(OUT_DIR)/LinkerSubCommand.tmp" -list="$(MAP_FILE)" -output="$(OUT_FILE)"
I know that I should use private as scope of the target specific variables but than I have to download/compile a newer make Version...
I would like to know the recommended way to build such configurations.
Maybe someone can provide a simple (and complete) example?
Thanks a lot!
Michael
Makefile:
ifeq ($(config), debug)
CFLAGS := -DDEBUG -g
OUT_PATH := ./build/debug/
else ifeq ($(config), light_debug)
CFLAGS := -g
OUT_PATH := ./build/light_debug/
else #release config by default
OUT_PATH := ./build/release
endif
#...
Then make invokation is like this:
make confg=debug
or
make config=light_debug
or
make config=release
I am trying to rewrite a Makefile for gfortran instead of g77. If I include the line
FCFLAGS += -I./include
then it looks for a .mod file that I do not have, but if I omit that line it can't find a file it needs in the ./include directory. Not sure how to fix this...
CMD = tomoDD2
CC = gcc
FC = /usr/local/bin/gfortran
FCFLAGS = -g -fbounds-check
FCFLAGS = -O2
FCFLAGS += -I./include
SRCS = $(CMD).f \
aprod.f cluster_tomoDD.f covar.f datum.f \
delaz.f delaz2.f direct1.f dist.f exist.f \
freeunit.f getinp_tomoDD.f ifindi.f \
indexxi.f juliam.f syn_time_new.f\
lsqr.f matmult1.f matmult2.f matmult3.f mdian1.f \
normlz.f ran.f redist.f refract.f \
resstat_tomoDD.f scopy.f sdc2.f setorg.f \
snrm2.f sort.f sorti.f sscal.f \
svd.f tiddid.f trialsrc_tomoDD.f trimlen.f \
ttime.f vmodel.f Ray3VD.f \
getdata_tomoDD.f add_sta.f find_id.f \
dtres_tomoDD.f weighting_tomoDD_lw.f lsfitH_tomoDD_lsqrn.f
CSRCS = atoangle_.c atoangle.c ndatetime_.c nhypot_.c nrpad_.c \
sscanf3_.c
OBJS = $(SRCS:%.f=%.o) $(CSRCS:%.c=%.o)
INCLDIR = ./include
all: $(CMD)
$(CMD): $(OBJS)
$(FC) $(OBJS) $(LIBS) -o $#
%.o: %.f
$(FC) $(FCFLAGS) -c $(#F:.o=.f) -o $#
# $(FC) $(FCFLAGS) -c $<
clean:
-rm -f $(CMD) *.o core a.out *.fln junk
Because the modules have to be compiled first individually before compiling the main file in fortran.
I found a bare-metal example for a board different from mine so I will have to modify the loader script but for now I just want to be able to compile and link the example as it is.
I copied the arm-none-eabi cross-compiler to the directory just above c_blinky which is where the source files are.
(I have a diagram of the directory structure on a page on my website)
Here's the makefile:
ifeq ($(GNU_ARM),)
GNU_ARM = ../arm-none-eabi/bin
endif
CC := $(GNU_ARM)/arm-none-eabi-gcc
CPP := $(GNU_ARM)/arm-none-eabi-g++
ASM := $(GNU_ARM)/arm-none-eabi-as
LINK := $(GNU_ARM)/arm-none-eabi-gcc
BIN := $(GNU_ARM)/arm-none-eabi-objcopy
RM := rm -rf
MKDIR := mkdir
BLDDIR = .
CCINC = -I$(BLDDIR)
APP_DEP = $(BLDDIR)/bsp.h \
$(BLDDIR)/arm_exc.h \
$(BLDDIR)/isr.h
APP_NAME = blinky
ARM_CORE = arm7tdmi
ifeq (rel, $(CONF)) # Release configuration
BINDIR = rel
CCFLAGS = -c -mcpu=$(ARM_CORE) -mthumb-interwork -Os \
-mlong-calls -ffunction-sections -Wall -DNDBEBUG -o$#
ASMFLAGS = -mcpu=$(ARM_CORE) -mthumb-interwork -o$#
LINKFLAGS = -T .\$(APP_NAME).ld -o $(BINDIR)\$(APP_NAME).elf \
-Wl,-Map,$(BINDIR)\$(APP_NAME).map,--cref,--gc-sections
else # default Debug configuration
BINDIR = dbg
CCFLAGS = -g -c -mcpu=$(ARM_CORE) -mthumb-interwork -O \
-mlong-calls -ffunction-sections -Wall -o$#
ASMFLAGS = -g -mcpu=$(ARM_CORE) -mthumb-interwork -o$#
LINKFLAGS = -T .\$(APP_NAME).ld -o $(BINDIR)\$(APP_NAME).elf \
-Wl,-Map,$(BINDIR)\$(APP_NAME).map,--cref,--gc-sections
endif
all: $(BINDIR)/$(APP_NAME).bin
$(BINDIR)/$(APP_NAME).bin : $(BINDIR)/$(APP_NAME).elf
$(BIN) -O binary $(BINDIR)/$(APP_NAME).elf $(BINDIR)/$(APP_NAME).bin
$(BINDIR)/$(APP_NAME).elf : \
./$(APP_NAME).ld \
$(BINDIR)/startup.o \
$(BINDIR)/arm_exc.o \
$(BINDIR)/low_level_init.o \
$(BINDIR)/isr.o \
$(BINDIR)/bsp.o \
$(BINDIR)/blinky.o
$(LINK) \
$(BINDIR)/startup.o \
$(BINDIR)/arm_exc.o \
$(BINDIR)/low_level_init.o \
$(BINDIR)/isr.o \
$(BINDIR)/bsp.o \
$(BINDIR)/blinky.o \
$(LINKFLAGS)
$(BINDIR)/startup.o: $(BLDDIR)/startup.s
$(ASM) $(ASMFLAGS) $<
$(BINDIR)/arm_exc.o: $(BLDDIR)/arm_exc.s
$(ASM) $(ASMFLAGS) $<
# choose the ARM or THUMB compilation for each module...
$(BINDIR)/low_level_init.o: $(BLDDIR)/low_level_init.c $(APP_DEP)
$(CC) -marm $(CCFLAGS) $(CCINC) $<
$(BINDIR)/isr.o: $(BLDDIR)/isr.c $(APP_DEP)
$(CC) -marm $(CCFLAGS) $(CCINC) $<
$(BINDIR)/bsp.o: $(BLDDIR)/bsp.c $(APP_DEP)
$(CC) -mthumb $(CCFLAGS) $(CCINC) $<
$(BINDIR)/blinky.o: $(BLDDIR)/blinky.c $(APP_DEP)
$(CC) -mthumb $(CCFLAGS) $(CCINC) $<
I set GNU_ARM in the makefile to ../arm-none-eabi/bin and ran make and got the following error:
(the file blinky.ld does exist in the source directory)
../arm-none-eabi/bin/arm-none-eabi-gcc \
dbg/startup.o \
dbg/arm_exc.o \
dbg/low_level_init.o \
dbg/isr.o \
dbg/bsp.o \
dbg/blinky.o \
-T .\blinky.ld -o dbg\blinky.elf -Wl,-Map,dbg\blinky.map,--cref,--gc-sections
/home/dan/dev/compile/bare-metal/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot open linker script file .blinky.ld: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [dbg/blinky.elf] Error 1
I thought the LINK assignment at the beginning should be:
LINK := $(GNU_ARM)/arm-none-eabi-ld
and not
LINK := $(GNU_ARM)/arm-none-eabi-gcc
and I got:
../arm-none-eabi/bin/arm-none-eabi-ld \
dbg/startup.o \
dbg/arm_exc.o \
dbg/low_level_init.o \
dbg/isr.o \
dbg/bsp.o \
dbg/blinky.o \
-T .\blinky.ld -o dbg\blinky.elf -Wl,-Map,dbg\blinky.map,--cref,--gc-sections
../arm-none-eabi/bin/arm-none-eabi-ld: cannot open linker script file .blinky.ld: No such file or directory
make: *** [dbg/blinky.elf] Error 1
It looks like arm-none-eabi-gcc is calling collect2 in lib/gcc/arm-none-eabi/4.9.3 which in turn calls ld which is not in the main bin directory:
/home/dan/dev/compile/bare-metal/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld:
I tried making a symbolic link to arm-none-eabi-ld as ld and got the same error.