原文: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. C# 字符串处理小工具

    之前刚上大学时沉迷于安全方面,当时一直想写一个处理字符串的小程序. 无奈当时没有太多时间,一直拖延到这寒假. 寒假闲来无事,所以就写写小程序来练手,顺便复习一下窗体和基础. 实现的功能有以下: 转换为 ...

  2. hihocoder 1866 XOR

    题面在这里 拆位分析一下就OK啦 /* y + (y xor x) */ #include<bits/stdc++.h> #define ll long long using namesp ...

  3. BZOJ 4726 POI 2017 Sabota? 树形DP

    4726: [POI2017]Sabota? Time Limit: 20 Sec  Memory Limit: 128 MBSec  Special JudgeSubmit: 128  Solved ...

  4. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) A. Bear and Game 水题

    A. Bear and Game 题目连接: http://www.codeforces.com/contest/673/problem/A Description Bear Limak likes ...

  5. ROS知识(17)----Actionlib使用的例子

    1.Actionlib原理 英文版:DetailedDescription 翻译版:actionlib的身世之谜 2.Actionlib官方教程 Actionlib是ros的重要部件,对于复杂动作的执 ...

  6. FT232H USB转串口,I2C,JTAG高速芯片

    随着FT232H USB2.0高速芯片的发布,英商飞特蒂亚公司(FTDI)进一步巩固了其在USB接口集成电路产品的地位.此款多功能的单通道USB转UART/FIFO接口设备可通过EEPROM配置为各种 ...

  7. 浅析Windows系统调用——2种切换到内核模式的方法

    http://shayi1983.blog.51cto.com/4681835/1710861/

  8. CentOS7部署Nginx

    CentOS7部署Nginx 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要openssl库,直接通过yu ...

  9. UITextView 详解

    UITextView 边框的设置   设置光标的位置   导入QuartzCote框架: #import <QuartzCore/QuartzCore.h> textView.layer. ...

  10. SpringMVC @RequestBody 接收Json数组对象

    @RequestMapping(value="/signIn",method=RequestMethod.POST) public int saveUser(@RequestBod ...