Getting gcc command not found when running the Makefile on travis CI

Filipe

I have an C project on github, I`m trying to build the code in Travis-CI but I get this error:

Using worker: worker-linux-9-2.bb.travis-ci.org:travis-linux-2
$ export CC=gcc
git.1
$ git clone --depth=50 --branch=someDevs git://github.com/luizfilipe/ffb-cglib.git     luizfilipe/ffb-cglib
Cloning into 'luizfilipe/ffb-cglib'...
remote: Counting objects: 114, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 114 (delta 27), reused 80 (delta 12)
Receiving objects: 100% (114/114), 2.53 MiB | 0 bytes/s, done.
Resolving deltas: 100% (27/27), done.
Checking connectivity... done.
$ cd luizfilipe/ffb-cglib
git.3
$ git checkout -qf f76cd622418a75003d1aa6326c38039c1f556ee8
$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
gcc -c -pendantic examples/environment/main.c -I/usr/bin/Mesa-5.0/include -g
make: gcc: Command not found
make: *** [main.o] Error 127
The command "make" exited with 2.
Done. Your build exited with 1.

Reading the error i notice that gcc wasn't found, but the .travis.yml is cofigured like following:

language: c
compiler:
   - gcc
script: make

Makefile is configured like follows:

# Variables
MESA = /usr/bin/Mesa-5.0
PATH = examples/environment/main
EXAMPLE_ENVIRONMENT = examples/environment/main.c
INCPATH = -I$(MESA)/include
LIBPATH = -L$(MESA)/lib
LIBS        = -lglut -lGLU -lGL -lm
CFLAGS  = $(INCPATH) -g
LFLAGS  = $(LIBPATH) $(LIBS)

# Main targets
all: main.o
    $(CC) -o $(PATH) main.o $(LFLAGS)

# Source targets
main.o: $(EXAMPLE_ENVIRONMENT)
    $(CC) -c -pendantic $(EXAMPLE_ENVIRONMENT) $(CFLAGS)

Any thoughts?

UPDATE: I just cut off the clang and put the Makefile more agnostic and I still getting the same issue.

user1937198

The problem is that you hard code your compiler then ask travis to build against two compilers. This means that travis will try to build your code with gcc then again with clang. You have two options remove clang as a compiler from your .travis.yml or change your makefile to be compiler agnostic. To change you makefile just replace all instances of gcc with $(CC)

Also $PATH contains the locations to look in for executables. If you overwrite it make can't find anything. so you need to rename $PATH to something like example_path eg

# Variables
MESA = /usr/bin/Mesa-5.0
example_path = examples/environment/
EXAMPLE_ENVIRONMENT = examples/environment/main.c
INCPATH = -I$(MESA)/include
LIBPATH = -L$(MESA)/lib
LIBS        = -lglut -lGLU -lGL -lm
CFLAGS  = $(INCPATH) -g
LFLAGS  = $(LIBPATH) $(LIBS)

# Main targets
all: main.o
    $(CC) -o $(example_path)/main.o $(LFLAGS)

# Source targets
main.o: $(EXAMPLE_ENVIRONMENT)
    $(CC) -c -pendantic $(EXAMPLE_ENVIRONMENT) $(CFLAGS)

You will also need to add a before_install section to your .travis.yml file to install Mesa as the travis images are very minimal.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Getting gcc command not found when running the Makefile on travis CI

From Dev

Grails: command not found with Travis-CI

From Dev

Travis CI suddenly fails: conda command not found

From Dev

Travis CI - Running Command on Job Cancellation

From Dev

Travis CI: line 57 error: pytest#: command not found

From Dev

running sh script on travis CI: The command exited with 1

From Dev

Running Redis on Travis CI

From Dev

Travis-CI: Class not found even when using autoloader

From Dev

Travis CI No Binary for 2.1.0 Found

From Dev

Travis CI No Binary for 2.1.0 Found

From Dev

Getting "No tests were found" when running unittest

From Java

grunt: command not found when running from terminal

From Dev

"command not found" when running a script via cron

From Dev

"command not found" when running "lessc" from bash

From Dev

Alias command not found when running .bashrc

From Dev

'command not found' error when running shell script

From Dev

Rename command not found when running a script

From Dev

command not found when running in docker bash script

From Dev

"command not found" when running a script via cron

From Dev

pyenv command not found when running with sudo

From Dev

Command not found error in Makefile

From Dev

Makefile: python: command not found

From Dev

cygwin gcc: command not found

From Dev

command not found error on Mac when running mfp from command line

From Dev

Travis-CI running two android emulators

From Dev

Travis-CI running two android emulators

From Dev

getting "command not found" when using source command on Fedora

From Dev

Getting "command not found" when trying to run rvm command as sudo

From Dev

Getting the Travis CI build status of a GitHub commit

Related Related

HotTag

Archive