Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile not working #1

Open
paoloRais opened this issue Mar 31, 2016 · 1 comment
Open

Makefile not working #1

paoloRais opened this issue Mar 31, 2016 · 1 comment

Comments

@paoloRais
Copy link
Contributor

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!

@fabiopetroni
Copy link
Owner

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 $&lt; -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
#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants