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

  • so you're only running make at the command line? no other flags? – schaiba Aug 22 '16 at 8:21
  • which version of make are you using? check using "make -v" – nagu Aug 22 '16 at 8:21
  • This is most likely because you are using BSD make instead of GNU make (gmake). – schaiba Aug 22 '16 at 8:22
  • both make -v and make --version do not return any information regarding make version. I guess schaiba is right. How do i find out the version of make on BSD? – Imran Ali Aug 22 '16 at 8:38
  • 2
    Then running gmake instead of make should do the trick. – schaiba Aug 22 '16 at 8:47
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.