Different behaviour of compiler when called in script by LaunchControl

105 views Asked by At

I'm trying to automatically compile and test code by

  1. checking it out from the repository,
  2. compiling it,
  3. running several test cases

using scripts that are called by LaunchControl every day at midnight. I'm compiling with gfortran (gcc version 4.9.2 20141029) on OS X 10.10.3 and use bash. The problem I'm running into is that I get messages like

gfortran: warning: couldn't understand kern.osversion '14.3.0
ld: library not found for -lcrt1.o

which I do not get when I run the same scripts interactively. I've tried sourcing my .profile and .bashrc files to make sure the environments and variables should be identical, but this has no effect. In particular, it does not seem to make any difference whether I have LD_LIBRARY_PATH set the same way when I run interactively or through LaunchControl.

I'm running the scripts as User Agents in LaunchControl.

What am I doing wrong?

EDIT: Here's the stripped-down script that is called by LaunchControl:

#!/bin/bash
FILENAME="/tmp/out.txt"
/Users/xxx/scripts/script1.sh > $FILENAME 2>&1

And here's script1.sh:

#!/bin/bash
cd /tmp/build-test/src
make clean
make

EDIT 2: This is a stripped-down version of the makefile:

SHELL= /bin/bash
EXEC= main
FC= gfortran
FFLAGS= -O3
LINKER= gfortran

SRCF90= file1.f90 file2.f90

%.o: %.f90
        $(FC) $(FFLAGS) -c $< -o $@
OBJF90= $(SRCF90:.f90=.o)

$(EXEC): $(OBJF90)
        $(LINKER) $(OBJF90) -o $@
0

There are 0 answers