libfm_with_BPR icon indicating copy to clipboard operation
libfm_with_BPR copied to clipboard

Makefile not working

Open paoloRais opened this issue 8 years ago • 1 comments

Hi Fabio,

Thanks for the nice piece of software, I am really looking forward to use it.

I had issues to install this software on my laptop (Ubuntu 14 LTS 64 bit).

I had no issue whatsoever to install the standard libfm package (it compiled right out of the box), but I had to edit the makefile in ./src/libfm/. Here is the makefile I am using:

BIN_DIR := ../../bin/

OBJECTS := \
    libfm.o \
    tools/transpose.o \
    tools/convert.o \

all: libFM transpose convert

libFM: libfm.o
    mkdir -p $(BIN_DIR)
    g++ -std=c++11 -pthread -O3 -Wall libfm.o -o $(BIN_DIR)libFM

%.o: %.cpp
    g++ -std=c++11 -pthread -O3 -Wall -c $< -o $@

clean:  clean_lib
    mkdir -p $(BIN_DIR)
    rm -f $(BIN_DIR)libFM $(BIN_DIR)convert $(BIN_DIR)transpose

clean_lib:
    rm -f $(OBJECTS)


transpose: tools/transpose.o
    mkdir -p $(BIN_DIR)
    g++ -std=c++11 -pthread -O3 tools/transpose.o -o $(BIN_DIR)transpose

convert: tools/convert.o
    mkdir -p $(BIN_DIR)
    g++ -std=c++11 -pthread -O3 tools/convert.o -o $(BIN_DIR)convert

The '-std=c++11' flag has been added due to an error:

src/fm_learn_sgd_element_BPR_blocks_compute_ranked_list_parallel.h:158:28: error: ‘to_string’ is not a member of ‘std’ file_name = file_name + std::to_string(td[t].fixed_block_id);

The '-pthread' flag has been added to avoid a bunch of errors such as:

libfm.cpp:(.text+0x778b): undefined reference to pthread_create' libfm.cpp:(.text+0x7992): undefined reference topthread_join'

Just recording this not knowing if it may be useful to anybody (as I am not an expert in makefiles).

Let me know if you want me to make a pull request!

paoloRais avatar Mar 31 '16 13:03 paoloRais

Hi,

Many thanks for your email. Yes, you can prepare a pull request!

Thank you, :) Fabio.

On 31 March 2016 at 15:40, paoloRais [email protected] wrote:

Hi Fabio,

Thanks for the nice piece of software, I am really looking forward to use it.

I had issues to install this software on my laptop (Ubuntu 14 LTS 64 bit).

I had no issue whatsoever to install the standard libfm package (it compiled right out of the box), but I had to edit the makefile in ./src/libfm/. Here is the makefile I am using:

BIN_DIR := ../../bin/

OBJECTS :=
libfm.o
tools/transpose.o
tools/convert.o \

all: libFM transpose convert

libFM: libfm.o mkdir -p $(BIN_DIR) g++ -std=c++11 -pthread -O3 -Wall libfm.o -o $(BIN_DIR)libFM

%.o: %.cpp g++ -std=c++11 -pthread -O3 -Wall -c $< -o $@

clean: clean_lib mkdir -p $(BIN_DIR) rm -f $(BIN_DIR)libFM $(BIN_DIR)convert $(BIN_DIR)transpose

clean_lib: rm -f $(OBJECTS)

transpose: tools/transpose.o mkdir -p $(BIN_DIR) g++ -std=c++11 -pthread -O3 tools/transpose.o -o $(BIN_DIR)transpose

convert: tools/convert.o mkdir -p $(BIN_DIR) g++ -std=c++11 -pthread -O3 tools/convert.o -o $(BIN_DIR)convert

The '-std=c++11' flag has been added due to an error:

src/fm_learn_sgd_element_BPR_blocks_compute_ranked_list_parallel.h:158:28: error: ‘to_string’ is not a member of ‘std’ file_name = file_name + std::to_string(td[t].fixed_block_id);

The '-pthread' flag has been added to avoid a bunch of errors such as:

libfm.cpp:(.text+0x778b): undefined reference to pthread_create' libfm.cpp:(.text+0x7992): undefined reference topthread_join'

Just recording this not knowing if it may be useful to anybody.

Let me know if you want me to make a pull request!

Since I don't know much about makefiles, I didn't submit a pull request

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/fabiopetroni/libfm_with_BPR/issues/1

fabiopetroni avatar Mar 31 '16 17:03 fabiopetroni