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

Fails to compile with the latest Eigen version on Stampede2 #726

Open
kks32 opened this issue Apr 7, 2022 · 2 comments
Open

Fails to compile with the latest Eigen version on Stampede2 #726

kks32 opened this issue Apr 7, 2022 · 2 comments

Comments

@kks32
Copy link
Contributor

kks32 commented Apr 7, 2022

Describe the bug
Eigen v3.4.0 causes multiple definition errors and fails to compile the MPM code.

To Reproduce
Steps to reproduce the behavior on Stampede2:

  1. Compile with the following commands:
cd $WORK
module load boost hdf5 qt5 vtk
export LD_LIBRARY_PATH=$SWR_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
git clone https://gitlab.com/libeigen/eigen.git
cd $WORK && git clone https://github.com/KaHIP/KaHIP && \
   cd KaHIP && sh ./compile_withcmake.sh
cd $WORK && git clone https://github.com/cb-geo/mpm.git
git clone https://github.com/cb-geo/mpm-benchmarks.git benchmarks
export CC=icc
export CXX=icpc
cd mpm && mkdir build && cd build && cmake -DBOOST_ROOT=$TACC_BOOST_DIR -DBOOST_INCLUDE_DIRS=$TACC_BOOST_INC -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR=$WORK/eigen -DKAHIP_ROOT=$WORK/KaHIP ..
make -j8
  1. Produces this compilation error:
CMakeFiles/mpm.dir/src/hdf5_particle.cc.o: In function `Eigen::internal::lapacke_helpers::to_lapack(long)':
hdf5_particle.cc:(.text+0x0): multiple definition of `Eigen::internal::lapacke_helpers::to_lapack(long)'
CMakeFiles/mpm.dir/src/main.cc.o:main.cc:(.text+0xef0): first defined here
CMakeFiles/mpm.dir/src/io/io.cc.o: In function `Eigen::internal::lapacke_helpers::to_lapack(long)':
io.cc:(.text+0x6910): multiple definition of `Eigen::internal::lapacke_helpers::to_lapack(long)'
CMakeFiles/mpm.dir/src/main.cc.o:main.cc:(.text+0xef0): first defined here
CMakeFiles/mpm.dir/src/mpm.cc.o: In function `Eigen::internal::lapacke_helpers::to_lapack(long)':
mpm.cc:(.text+0xa80): multiple definition of `Eigen::internal::lapacke_helpers::to_lapack(long)'
CMakeFiles/mpm.dir/src/main.cc.o:main.cc:(.text+0xef0): first defined here
@EtoDemerzel0427
Copy link

EtoDemerzel0427 commented Apr 10, 2022

Hi, I would like to take this issue, but may I first make sure if this problem still exists?
According to this Stack Overflow question, this multiple definition problem is most likely because of the missing inline notation. In the meantime, I notice in this commit, which happened just two days ago, Eigen has added their inline notation EIGEN_ALWAYS_INLINE to to_lapack. I assume this has already been a fix to this problem.
I also tested on a Frontera node, the compilation went on fine.

@kks32
Copy link
Contributor Author

kks32 commented Apr 11, 2022

@EtoDemerzel0427 Thanks. Yes, it's an inline issue on Eigen. I'll will check the fix you show and confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants