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

Small change needed to build by default on RHEL / Fedora / CentOS #6

Open
frival opened this issue Jan 22, 2018 · 0 comments
Open

Small change needed to build by default on RHEL / Fedora / CentOS #6

frival opened this issue Jan 22, 2018 · 0 comments

Comments

@frival
Copy link

frival commented Jan 22, 2018

I'm not sure why, but RHEL / Fedora / CentOS split their libraries and headers into separate directory structures in the openmpi / openmpi-devel packages. The below patch makes things work by default; perhaps MPI_INCLUDE_ROOT should default to MPI_ROOT to make things easier on OSes that don't have this split?

diff -u baidu-allreduce.orig/Makefile baidu-allreduce/Makefile
--- baidu-allreduce.orig/Makefile	2018-01-22 15:35:18.739557843 -0500
+++ baidu-allreduce/Makefile	2018-01-22 15:26:32.231119210 -0500
@@ -3,6 +3,11 @@
 $(error Could not find MPI in "$(MPI_ROOT)")
 endif
 
+# Check that MPI include path exists.
+ifeq ("$(wildcard $(MPI_INCLUDE_ROOT))","")
+$(error Could not find MPI in "$(MPI_INCLUDE_ROOT)")
+endif
+
 # Check that CUDA path exists.
 ifeq ("$(wildcard $(CUDA_ROOT))","")
 $(error Could not find CUDA in "$(CUDA_ROOT)")
@@ -11,7 +16,7 @@
 CC:=mpic++
 NVCC:=nvcc
 LDFLAGS:=-L$(CUDA_ROOT)/lib64 -L$(MPI_ROOT)/lib -lcudart -lmpi -DOMPI_SKIP_MPICXX=
-CFLAGS:=-std=c++11 -I$(MPI_ROOT)/include -I. -I$(CUDA_ROOT)/include -DOMPI_SKIP_MPICXX=
+CFLAGS:=-std=c++11 -I$(MPI_INCLUDE_ROOT) -I$(MPI_ROOT)/include -I. -I$(CUDA_ROOT)/include -DOMPI_SKIP_MPICXX=
 EXE_NAME:=allreduce-test
 SRC:=$(wildcard *.cpp test/*.cpp)
 CU_SRC:=$(wildcard *.cu)

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