Error in compiling Palabos

Hi Friends,

I am a new user and trying to get Palabos compiled. I keep getting the compiling error from /home/ec2-user/palabos/src/core/util.h:608:14 saying that error: expected unqualified-id before ‘[’ token

UniqueId([[maybe_unused]] UniqueId const &rhs) { }

Here is my compiler information:
g++ (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)

Any idea?

Thanks,

Hao

Hello @hph73,
I am facing the same issue, Have you found out the solution for this. If yes, can you kindly share the solution.

Thanks,
Venu

Hello @hph73,

I found out an indirect solution to this issue. I believe this has to do with compiler c++ version. “maybe_unused” came with C++17 and the complier we are using might has older standard, like c++14 as default. Thereby, throwing this error. I haven;t figured out a way to change the c++ standard while building a tutorial in PALABOS yet.

However, for now you can download previous version of PALABOS like v2.2.0, link.

Thanks and Regards,
Venu Angirekula

Hello both of you,

I’ve had a similar problem, which was really annoying since it worked on my PC but didn’t on the HPC cluster.

What I have found is that the compiler version needs to know what [[maybe_unused]] means. That means that one can actually compile the code with the std=c++11 as usual, but one needs a updated compiler (tested with GNU 9.4 and above).

For the redhat distro on my HPC, the default was 8.5, which was not up to date enough. There are modules such that one can choose which GNU version one uses. However, the RedHat distro did not automatically set the environment variable CXX, which the CMakeLists.txt looks for, such that the default version is always used.

What worked for me was:

  1. Load an up to date compiler (GNU >9.4): e.g. module load gnu/10.2
  2. Set the environment CXX via: export CXX=g++
  3. Then go into the build folder, and run the command cmake ..
  4. Proceed as usual with make -j 4

I hope that helps you, or anyone else that is stuck on this error.

Regards,
Julius