原文:http://blog.josephmisiti.com/compiling-libffm-on-osx-10.9/

I recently tried to compile LIBFFM (Field-aware Factorization Machines) on my local machine running 10.9 and things did not work out as expected:

fmm.cpp:11:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.

So it turns out the version of GCC that ships with OSX does not support this header

I ended up getting it compiled, and here is how I did it:

First, download a new version of GCC:

wget http://prdownloads.sourceforge.net/hpc/gcc-4.9-bin.tar.gz

Next, upzip and untar it, and put it in /usr/local/bin

gunzip gcc-4.9-bin.tar.gz
sudo tar -xvf gcc-4.9-bin.tar -C /

Now, you need to update the Makefile that comes with LIBFFM to look like this

CXX = g++
CXXFLAGS = -Wall -O3 -std=c++0x # uncomment the following flags if you do not want to use OpenMP
DFLAG += -DUSEOMP
CXXFLAGS += -fopenmp all: ffm-train ffm-predict ffm-train: ffm-train.cpp ffm.o
$(CXX) $(CXXFLAGS) -o $@ $^ ffm-predict: ffm-predict.cpp ffm.o
$(CXX) $(CXXFLAGS) -o $@ $^ ffm.o: ffm.cpp ffm.h
$(CXX) $(CXXFLAGS) $(DFLAG) -c -o $@ $< clean:
rm -f ffm-train ffm-predict ffm.o timer.o

Finally, run make and you are good to go

(vor)JOSEPH-MISITI:libffm-1.0 josephmisiti$ make
g++ -Wall -O3 -std=c++0x -fopenmp -DUSEOMP -c -o ffm.o ffm.cpp
g++ -Wall -O3 -std=c++0x -fopenmp -o ffm-train ffm-train.cpp ffm.o
g++ -Wall -O3 -std=c++0x -fopenmp -o ffm-predict ffm-predict.cpp ffm.o

Compiling LIBFFM On OSX 10.9的更多相关文章

  1. Windows环境下使用Clover四叶草引导双硬盘安装OSX 10.11.5原版镜像

    作为一个穷逼大学生,想搞iOS开发 买不起Mac只能鼓捣鼓捣黑苹果啦........ 之前我的电脑通过变色龙引导的方式装了个OSX10.10和win8.1双系统,因为自学的是Swift语言之前装的OS ...

  2. XE6移动开发环境搭建之IOS篇(8):在Mac OSX 10.8中安装XE6的PAServer(有图有真相)

    网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 安装PAServer ...

  3. XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装Xcode4.6.3(有图有真相)

    网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 在安装Xcode前, ...

  4. XE6移动开发环境搭建之IOS篇(4):VMware9里安装Mac OSX 10.8(有图有真相)

    网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 以下内容比较长,我们 ...

  5. osx 10.11.5 El Capitan U盘制作安装

    osx 10.11.5 El Capitan U盘制作安装 1. 下载osx10.11.5 从mac的 appstore下载(官方原版) 2. U盘8G起(注意备份重要资料) 3. 下载完成之后在Fi ...

  6. 虚拟机VMware 9安装苹果MAC OSX 10.8图文教程

    前些天虚拟机VMware Workstation 9出来,相信大家都已经熟悉VM9了,至于MAC OSX 10.8系统,那也是出来一段时间了,本篇文章就是来讲解VMware Workstation 9 ...

  7. Install mcrypt for php on Mac OSX 10.10 Yosemite for a Development Server

    mcrypt is a file encryption method using secure techniques to exchange data. It is required for some ...

  8. Setup Tensorflow with GPU on Mac OSX 10.11

    Setup Tensorflow with GPU on OSX 10.11 环境描述 电脑:MacBook Pro 15.6 CPU: 2.7GHz 显卡: GT 650m 系统:OSX 10.11 ...

  9. OSX 10.10+Xcode5.1 无法启动或者安装应用程序到iOS 6.1 simulator

    错误症状: OSX 10.10+Xcode5.1 无法启动或者安装应用程序到iOS 6.1 simulator 错误原因: iOS Simulator 内核要使用OSX 系统内核,所以iOS Simu ...

随机推荐

  1. python opencv3 背景分割 mog2 knn

    git:https://github.com/linyi0604/Computer-Vision 使用mog2算法进行背景分割 # coding:utf-8 import cv2 # 获取摄像头对象 ...

  2. python opencv3 直线检测

    git:https://github.com/linyi0604/Computer-Vision # coding:utf8 import cv2 import numpy as np # 读入图像 ...

  3. python opencv3 获取摄像头视频

    git:https://github.com/linyi0604/Computer-Vision # coding:utf8 import cv2 """ 捕获摄像头10 ...

  4. Windows下C语言调用dll动态链接库

    dll是windows下的动态链接库文件,下面记录一下在windows下如何调用C语言开发的dll动态链接库. 1.dll动态链接库的源代码 hello_dll.c #include "st ...

  5. addEventListener 的一些好方法 简单粗暴的说给你

    function show(){ document.addEventListener("click",fn,{ "passive":false, "c ...

  6. C++反汇编-继承和多重继承

    学无止尽,积土成山,积水成渊-<C++反汇编与逆向分析技术揭秘> 读书笔记 一.单类继承 在父类中声明为私有的成员,子类对象无法直接访问,但是在子类对象的内存结构中,父类私有的成员数据依然 ...

  7. [置顶] 解决EXTJS文本框长度验证在ORACLE数据库下不正确的问题

    由于ORACLE数据库里面一个汉字和符号占2 个字节,数字和英文占1个字节,所以用EXTJS的文本框MaxLenght去限制输入的长度是不正确的,因为EXTJS只限制了输入的字数量,而不是字节数量. ...

  8. Backup your Android without root or custom recovery -- adb backup

    ecently discovered a neat new way to back up apps on my Android without having to use Titanium Backu ...

  9. C++空类产生哪些成员函数 || C++类可以自动生成的6个成员函数

    class Empty {     public:     Empty(); // 缺省构造函数     Empty( const Empty& ); // 拷贝构造函数     ~Empty ...

  10. JEECG第二期深入使用培训(报名截止2014-06-21)

    JEECG第二期深入使用培训(报名截止2014-06-21) JEECG深度研究-交流碰撞火花,你学会的不不过JEECG,很多其它的是软件架构思想 http://www.jeecg.org/forum ...