husseinaluie / FlowSieve

FlowSieve coarse-graining code base
https://flowsieve.readthedocs.io/en/latest/
Other
18 stars 9 forks source link

Installing Error #11

Closed liu-ran closed 1 year ago

liu-ran commented 1 year ago

make_CoarseGrainX.log

Dear All,

Recently I tried my best to install FlowSieve on our HPC, but I failed.

The error is as follows: NETCDF_IO/write_field_to_output.cpp: In function ‘void write_field_to_output(const std::vector<double>&, const string&, const size_t*, const size_t*, const string&, const std::vector<bool>*, MPI_Comm)’: NETCDF_IO/write_field_to_output.cpp:134:23: error: ‘fmiddle’ is predetermined ‘shared’ for ‘shared’ private(index) ^ make: *** [NETCDF_IO/write_field_to_output.o] Error 1

Attached is the detailed error log. Would you mind giving me a hand? Many thanks!

Sincerely, Ran

bastorer commented 1 year ago

Hi Ran,

Thanks for reaching out! I'm sorry you ran into compiler issues, but on the upside this one should be easy to resolve :-)

That error crops up sometimes. The issue is that some compilers have different restrictions on how 'constants' are / can be treated in OpenMP statements. I haven't found a clean solution that'll work for all cases yet, but in the mean time there's an easy fix that should allow it to compile.

If you modify line 133 of NETCDF_IO/write_field_to_output.cpp to remove fmiddle, that should resolve the issue [ there might be a second variable that needs to be removed as well, but a similar error will crop up to tell you which one ]. As far as I remember, this is the only file that needs to be modified around that compiler issue.

For the sake of explicit clarity:

Let me know if you run into any further issues :-)

liu-ran commented 1 year ago

Hi Bastorer,

Thank you very much for your help! I came over the error about fmiddle along with your guideline and I came to the second error as you predicted. But I'm not sure this error is similar to the last one. This error is as follows: Functions/dataset_class.cpp:142:65: error: ‘dataset::areas’ is not a variable in clause ‘shared’ reduction(+ : local_area, local_area_water_only) ^ Functions/dataset_class.cpp:142:65: error: ‘dataset::mask’ is not a variable in clause ‘shared’ Functions/dataset_class.cpp:145:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (Ilat = 0; Ilat < Nlat; ++Ilat) { ^ Functions/dataset_class.cpp:146:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (Ilon = 0; Ilon < Nlon; ++Ilon) { ^ make: *** [Functions/dataset_class.o] Error 1

Attached is the detailed make log. Many thanks again!

Sincerely, Ran

mk_CoarseGrainX.log

bastorer commented 1 year ago

Hi Ran,

Hmm, those are unexpected. Could you send a copy of your system.mk file?

Regards, Ben

liu-ran commented 1 year ago

Hi Ran,

Hmm, those are unexpected. Could you send a copy of your system.mk file? Regards, Ben

Hi Ben,

It's okay~ systme.mk is as follows:

CXX := mpicc -std=c++11 MPICXX := mpicc -std=c++11 #mpicxx ` # Linking flags for netcdf LINKS:=-lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl -lm -fopenmp # Default compiler flags CFLAGS:=-Wall # Debug flags DEBUG_FLAGS:=-g DEBUG_LDFLAGS:=-g # Basic optimization flags OPT_FLAGS:=-O3 # Extra optimization flags (intel inter-process optimizations) #EXTRA_OPT_FLAGS:=-ip -ipo # Specify optimization flags for ALGLIB ALGLIB_OPT_FLAGS:=-O3 -DAE_CPU=AE_INTEL # Modules are automatically on lib dir NETCDF_LIBS=nc-config --cxx4libs NETCDF_INCS=nc-config --cxx4flags LIB_DIRS:=${NETCDF_LIBS} INC_DIRS:=${NETCDF_INCS}`

Cheers, Ran

liu-ran commented 1 year ago

My MPI compiler is also Intel /opt/compiler/intel2018u4/compilers_and_libraries_2018.5.274/linux/mpi/intel64/bin

bastorer commented 1 year ago

Hi Ran,

Thanks! I'll look into it a little deeper and will get back to you soon.

Regards, Ben

bastorer commented 1 year ago

Hi Ran,

What's the output of mpicc --version on your system?

Also, can you retry compiling with std=c++14 instead of c++11? I'm not sure how much changed between those standards, but development used the c++14 standard.

Regards, Ben

bastorer commented 1 year ago

Hi Ran,

I'm going to go ahead and close this issue. We've made some updates recently on the openmp statements (particularly in regards to GCC support), that might resolve some of the issues that you were running into.

If you try installing FlowSieve again and run into issues, feel free to open a new ticket. We could try to schedule a Zoom meeting to work through set-up issues if that would help.

Regards, Ben