Hi again Matthias, this mail is about a different issue, maybe with the Cmake Build system, which I have found both with GCC, Intel and Visual Age compilers when compiling ALPS 2 (any beta) with OpenMP support turned on. I should expect in the include.mk file to find the related compiler flag for multithreading (-fopenmp with GCC, etc) as it happened with ALPS 1.3.5, but it doesn't appear anywhere and I have to add it by hand when I have to compile my codes using OpenMP. Since ALPS 1.3.5 worked right, I think that should be fixed in ALPS 2.
Best regards,
Jessica
Hi Jessica,
This should actually work. If you turn ALPS_ENABLE_OPENMP on it should automatically add -fopenmp to the compilation flags.
Matthias
On Nov 2, 2010, at 10:47 AM, jessica.alfonsi@unipd.it wrote:
Hi again Matthias, this mail is about a different issue, maybe with the Cmake Build system, which I have found both with GCC, Intel and Visual Age compilers when compiling ALPS 2 (any beta) with OpenMP support turned on. I should expect in the include.mk file to find the related compiler flag for multithreading (-fopenmp with GCC, etc) as it happened with ALPS 1.3.5, but it doesn't appear anywhere and I have to add it by hand when I have to compile my codes using OpenMP. Since ALPS 1.3.5 worked right, I think that should be fixed in ALPS 2.
Best regards,
Jessica
In case it does not work in the link step, please try to change the top level CMakeLists.txt file in the following way:
add
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_CXX_FLAGS}")
just after the line saying
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
and then please try if it links correctly.
Matthias
On Nov 2, 2010, at 10:54 AM, Matthias Troyer wrote:
Hi Jessica,
This should actually work. If you turn ALPS_ENABLE_OPENMP on it should automatically add -fopenmp to the compilation flags.
Matthias
On Nov 2, 2010, at 10:47 AM, jessica.alfonsi@unipd.it wrote:
Hi again Matthias, this mail is about a different issue, maybe with the Cmake Build system, which I have found both with GCC, Intel and Visual Age compilers when compiling ALPS 2 (any beta) with OpenMP support turned on. I should expect in the include.mk file to find the related compiler flag for multithreading (-fopenmp with GCC, etc) as it happened with ALPS 1.3.5, but it doesn't appear anywhere and I have to add it by hand when I have to compile my codes using OpenMP. Since ALPS 1.3.5 worked right, I think that should be fixed in ALPS 2.
Best regards,
Jessica
Hi again Matthias, I've tried your suggestion below in CMakeLists.txt, compilation is successful (as always) but in the file include.mk there is no openmp flag appearing in the compiler flags. It's strange since in the configuration process with ccmake the build system correctly recognizes the openmp flag appropriate for the compiler. This is my include.mk :
# shell
# path
prefix = /home/alfonsi/alps-2.0.0b5-r5017 exec_prefix = /home/alfonsi/alps-2.0.0b5-r5017 bindir = /home/alfonsi/alps-2.0.0b5-r5017/bin datadir = /home/alfonsi/alps-2.0.0b5-r5017 datarootdir = /home/alfonsi/alps-2.0.0b5-r5017/share libdir = /home/alfonsi/alps-2.0.0b5-r5017/lib includedir = /home/alfonsi/alps-2.0.0b5-r5017/include docdir = /home/alfonsi/alps-2.0.0b5-r5017/doc
# Makefiles
INCLUDE_MK = $(datadir)/alps/include.mk
# tools
AR = /usr/bin/ar RANLIB = /usr/bin/ranlib
# base
BASE_CPPFLAGS = BASE_LDFLAGS = BASE_LIBS =
# for Boost
BOOST_CPPFLAGS = -I/home/alfonsi/src/alps-2.0.0b5-r5017-src-with-boost/boost BOOST_LDFLAGS = BOOST_LIBS = /usr/lib/libboost_system.so BOOST_SRCDIR = /home/alfonsi/src/alps-2.0.0b5-r5017-src-with-boost/boost
# for MPI
MPI_CPPFLAGS = MPI_LDFLAGS = MPI_LIBS =
# for LAPACK
LAPACK_CPPFLAGS = LAPACK_LDFLAGS = LAPACK_LIBS = /usr/lib/liblapack.so /usr/lib/libblas.so /usr/lib/libpthread.so
# for HDF5 library
HDF5_CPPFLAGS = -I/usr/include HDF5_LDFLAGS = HDF5_LIBS = /usr/lib/libhdf5_hl.so /usr/lib/libhdf5.so
# for Python library
PYTHON_CPPFLAGS = PYTHON_LDFLAGS = PYTHON_LIBS = /usr/lib/python2.6/config/libpython2.6.so
# for XML parser
XML_CPPFLAGS = XML_LDFLAGS = XML_LIBS =
# C/C++ compiler
CC = /opt/intel/Compiler/11.1/073/bin/ia32/icc CFLAGS = -O3 -DNDEBUG
CXX = /opt/intel/Compiler/11.1/073/bin/ia32/icpc CXXFLAGS = -O3 -DNDEBUG
CPPFLAGS = $(BASE_CPPFLAGS) $(XML_CPPFLAGS) $(LAPACK_CPPFLAGS) $(HDF5_CPPFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_CPPFLAGS) $(MPI_CPPFLAGS) -I$(includedir) LDFLAGS = $(BASE_LDFLAGS) $(BOOST_LDFLAGS) -L$(libdir) $(PYTHON_LDFLAGS) $(HDF5_LDFLAGS) $(LAPACK_LDFLAGS) $(XML_LDFLAGS) $(MPI_LDFLAGS) LIBS = -lalps $(BOOST_LIBS) $(PYTHON_LIBS) $(HDF5_LIBS) $(LAPACK_LIBS) $(XML_LIBS) $(MPI_LIBS) $(BASE_LIBS)
On Mar, 2 Novembre 2010 10:58 am, Matthias Troyer wrote:
In case it does not work in the link step, please try to change the top level CMakeLists.txt file in the following way:
add
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
${CMAKE_CXX_FLAGS}")
just after the line saying
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
and then please try if it links correctly.
Matthias
On 3 Nov 2010, at 10:10, jessica.alfonsi@unipd.it wrote:
Hi again Matthias, I've tried your suggestion below in CMakeLists.txt, compilation is successful (as always) but in the file include.mk there is no openmp flag appearing in the compiler flags. It's strange since in the configuration process with ccmake the build system correctly recognizes the openmp flag appropriate for the compiler. This is my include.mk :
# shell
# path
prefix = /home/alfonsi/alps-2.0.0b5-r5017 exec_prefix = /home/alfonsi/alps-2.0.0b5-r5017 bindir = /home/alfonsi/alps-2.0.0b5-r5017/bin datadir = /home/alfonsi/alps-2.0.0b5-r5017 datarootdir = /home/alfonsi/alps-2.0.0b5-r5017/share libdir = /home/alfonsi/alps-2.0.0b5-r5017/lib includedir = /home/alfonsi/alps-2.0.0b5-r5017/include docdir = /home/alfonsi/alps-2.0.0b5-r5017/doc
# Makefiles
INCLUDE_MK = $(datadir)/alps/include.mk
# tools
AR = /usr/bin/ar RANLIB = /usr/bin/ranlib
# base
BASE_CPPFLAGS = BASE_LDFLAGS = BASE_LIBS =
Do you want it in the BASE_CPPFLAGS or in some extra OPENMP_CPP_FLAGS variable?
Matthias
comp-phys-alps-users@lists.phys.ethz.ch