Skip to content

Commit

Permalink
* fix compilation and linking (openmp) on mac
Browse files Browse the repository at this point in the history
* fix = / == comparison
* add some info to readme
  • Loading branch information
hiaselhans committed Oct 12, 2018
1 parent 1616e20 commit e8729dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.4)
cmake_minimum_required(VERSION 3.0)
project(paraBEM)

MESSAGE(STATUS "python version set: ${py}")
Expand All @@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# OPTIONS
set (CMAKE_CXX_STANDARD 11)
OPTION(BUILD_PYTHON_BINDINGS "create python bindings" ON)

if (BUILD_PYTHON_BINDINGS)
Expand All @@ -29,6 +30,11 @@ find_package(OpenMP)

## OPENMP
if(OPENMP_FOUND)

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
LINK_LIBRARIES(${OpenMP_libomp_LIBRARY})
LINK_LIBRARIES(${OpenMP_libomp_LIBRARY})
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif()
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ the c++ code is wrapped with pybind11 to python. This allows fast computation (e
```bash
mkdir build && cd build
cmake ..
use cmake-gui to fix not found packages or wrong versions (eg. python, pybind11, ...)
cmake -DPYTHON_EXECUTABLE=/usr/local/bin/python3 ..
```

use cmake-gui to fix not found packages or wrong versions (eg. python, pybind11, ...)

### build and install
if cmake doesn't complain, install the package. (the number at the end is the number of compile jobs)
```
Expand Down
2 changes: 1 addition & 1 deletion src/panel2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Panel2* Panel2::get_neigbour(int nr, Panel2* pan1)
pan = pan1->points[nr]->panels[1];
if (pan == this){
pan = pan1->points[1 - nr]->panels[0];
if (pan = pan1){
if (pan == pan1){
pan = pan1->points[1 - nr]->panels[1];
}
}
Expand Down

0 comments on commit e8729dd

Please sign in to comment.