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

Compilation without OMP support not working #37

Open
pavanakumar opened this issue Jan 21, 2020 · 1 comment
Open

Compilation without OMP support not working #37

pavanakumar opened this issue Jan 21, 2020 · 1 comment

Comments

@pavanakumar
Copy link

Hi

The latest ColPack git version does not compile on clang without OMP support.

$> cmake . -DENABLE_OPENMP=OFF
$> make
....
In file included from /opt/sources/ColPack/src/SMPGC/SMPGCColoring.cpp:7:
In file included from /opt/sources/ColPack/build/cmake/../../src/SMPGC/SMPGCColoring.h:11:
In file included from /opt/sources/ColPack/build/cmake/../../src/SMPGC/SMPGCOrdering.h:12:
/opt/sources/ColPack/build/cmake/../../src/SMPGC/SMPGCGraph.h:12:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^~~~~~~
1 error generated.

Looks like many headers have # include <omp.h> that are not ifdef'ed to protect against non-omp builds.

--
Kumar

@pavanakumar
Copy link
Author

pavanakumar commented Jan 21, 2020

The following changes to the file ColPack/build/cmake/CMakeLists.txt fixed the compilation problems without OMP support (fixes issue #33 )

diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index 6c171c9..a4a42c3 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -90,16 +90,16 @@ file(GLOB HEADERS
     ${COLPACK_ROOT_DIR}/src/BipartiteGraphBicoloring/*.h
     ${COLPACK_ROOT_DIR}/src/BipartiteGraphPartialColoring/*.h
     ${COLPACK_ROOT_DIR}/src/GeneralGraphColoring/*.h
-    ${COLPACK_ROOT_DIR}/src/Recovery/*.h
-    ${COLPACK_ROOT_DIR}/src/SMPGC/*.h)
+    ${COLPACK_ROOT_DIR}/src/Recovery/*.h)
+    #${COLPACK_ROOT_DIR}/src/SMPGC/*.h)
     #${COLPACK_ROOT_DIR}/src/PartialD2SMPGC/*.h)
 file(GLOB SOURCES
     ${COLPACK_ROOT_DIR}/src/Utilities/*.cpp
     ${COLPACK_ROOT_DIR}/src/BipartiteGraphBicoloring/*.cpp
     ${COLPACK_ROOT_DIR}/src/BipartiteGraphPartialColoring/*.cpp
     ${COLPACK_ROOT_DIR}/src/GeneralGraphColoring/*.cpp
-    ${COLPACK_ROOT_DIR}/src/Recovery/*.h
-    ${COLPACK_ROOT_DIR}/src/SMPGC/*.cpp)
+    ${COLPACK_ROOT_DIR}/src/Recovery/*.cpp)
+    #${COLPACK_ROOT_DIR}/src/SMPGC/*.cpp)
     #${COLPACK_ROOT_DIR}/src/PartialD2SMPGC/*.cpp)


@@ -110,7 +110,7 @@ set(COLPACK_SOURCE_INCLUDE_DIRS
     "${COLPACK_ROOT_DIR}/src/BipartiteGraphPartialColoring"
     "${COLPACK_ROOT_DIR}/src/BipartiteGraphBicoloring"
     "${COLPACK_ROOT_DIR}/src/GeneralGraphColoring"
-    "${COLPACK_ROOT_DIR}/src/SMPGC"
+    #"${COLPACK_ROOT_DIR}/src/SMPGC"
     "${COLPACK_ROOT_DIR}/src/Recovery")

There should be an if conditional in the CMakeList.txt file to include the shared-memory colouring routines SMPGC only if ENALBLE_OPENMP=ON. Will try to fix this and throw a pull request. Until such time I am placing the hack so that it will be useful to others.

Cheers,

--
Kumar

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

1 participant