2

I am very new to both FreeBSD and compiling code from source and would really appreciate any help. I am trying to compile fastText from source. When I execute the make command it returns the following message:

make don't know how to make CXXFLAGS. Stop

Here are first few lines from Makefile(complete file is available on the fastText github repo mentioned above):

CXX = c++
CXXFLAGS = -pthread -std=c++0x
OBJS = args.o dictionary.o matrix.o vector.o model.o utils.o
INCLUDES = -I.

opt: CXXFLAGS += -O3 -funroll-loops
opt: fasttext

debug: CXXFLAGS += -g -O0 -fno-inline
debug: fasttext

FreeBSD version: 10.3
FreeBSD clang version: 3.4.1
gmake version: 4.1_2

Mateusz Piotrowski
  • 4,623
  • 5
  • 36
  • 70
Imran Ali
  • 123
  • 7

1 Answers1

4

Your problem is lines like this:

opt: CXXFLAGS += -O3 -funroll-loops

While BSD make honors some += operations, this is generally a GNU make feature. On FreeBSD, GNU make is (almost always) installed as a port, and its name is gmake.

You can see this on the command-line using

make --version

which prints

usage: make [-BeikNnqrstWwX] 
            [-C directory] [-D variable] [-d flags] [-f makefile]
            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]
            [-V variable] [variable=value] [target ...]

(not GNU make) versus

gmake --version

which prints

GNU Make 3.82
Built for amd64-portbld-freebsd10.0
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

(GNU make).

Most makefiles are written so that running one or another of these flavors will rely upon the MAKE variable being set, and (for instance) when calling successive makefiles, it will "just work". So you can usually just do

gmake

and the rest of the details are done automatically.

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268