Skip to content

For those who wish to build with LLVM (clang++) #9

@dezzeus

Description

@dezzeus

I already have LLVM 5 installed on my MacOS system with Homebrew, so I didn't really need GCC, but OpenMP doesn't get recognized when you try to build issuing Cmake with
-DCMAKE_CXX_COMPILER=$(which clang++), (please note that I've never used Cmake before) so I managed to get it work by editing the following lines in CMakeLists.txt:

Lines 17–19 (OpenMP flags hard-coded):

# require support of OpenMP
#find_package(OpenMP REQUIRED)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L/usr/local/opt/llvm/lib -I/usr/local/opt/llvm/lib/clang/5.0.0/include -fopenmp")

Line 28 (I have removed the unneeded -Wa,-q at the end):

# Compiler flags
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -Wall -march=native -mtune=native")

I hope that this may be of help for someone else… (until someone else more skilled in Cmake provides a patch).

(Both the training and testing phases of the README worked on a fold of Microsoft's LETOR 3 dataset "Ohsumed"; I haven't tested it any further for the moment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions