0

I want to develop an application which requires SMP. But in the Erlang makefile I am using, the options are set in non-smp mode. Hence, when I start the application, I get an error in the Shell indicating that the SMP emulator is required and that I should start with erl -smp. How can I change the Erlang makefile so that it enables the SMP mode?
PS: The erl -smp command works in the command prompt i.e. when I am not using the makefile.

  • There are thousands of different ways to write a Makefile. It's not possible to answer a question formulated this way. Well, you need to find where `erl` is executed somewhere inside Makefile, and add `-smp` – Vladimir Gordeev Apr 13 '18 at 15:53

2 Answers2

0

Note that the smp version is normally the default (except when you run on a single core machine, in which case you may want to force it), and that the non-smp version is in fact going to be dropped from the codebase starting with the next major release (OTP 21) - you'll still be able to run on a single core machine, but the code won't be specialized for the single core case. (This simplifies the emulator code a lot, removing a whole bunch of #ifdefs.)

RichardC
  • 10,412
  • 1
  • 23
  • 24
0

Don't know the exact solution for makefile but might this would help

# Makefile

.PHONY: all compile run

REBAR=./rebar3

all: compile

compile:
    $(REBAR) compile

run: compile
        erl -pa _build/default/lib/*/ebin -config config/sys.config -args_file config/vm.args -boot start_sasl -s sync -s yourawesomeapp

As for me I'm always using vm.args file with rebar3

here is the example of the code

## Name of the node
-name node@10.00.0.00

## Cookie for distributed erlang
-setcookie test_cookie

## Enable kernel poll and a few async threads
+K true
+A 2

## Force the erlang VM to use SMP
-smp enable

## Increase number of concurrent ports/sockets
-env ERL_MAX_PORTS 65535
Eugen Dubrovin
  • 888
  • 5
  • 15