-
Notifications
You must be signed in to change notification settings - Fork 70
Mesh conversion makefile improvements #158
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
Conversation
36f88ff to
eaf6ced
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pwolfram, I think -lstdc++ is being included redundantly in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this else case if $NETCDF is undefined? If so, does this line make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take another look post-indentation fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as two lines above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was confusing because of the inundation for the if-elseif-else etc statements. Please take another look now that indentation is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, indeed. Sorry for the confusion on my part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was my fault and confused me too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason to change the order of these 3, right? I assume that was for debugging purposes but might as well switch it back so we can more easily tell what actually changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this was causing a lot of unnecessary trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this change is correct. The original code was nullifying the whole string, which is good to do. Just adding a null character at the beginning is not necessarily good enough depending on how the char array is manipulated later. I would suggest reverting this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
|
I think someone from each MPAS component that uses these tools needs to make sure they work as expected before we can merge. I have added @mark-petersen and @matthewhoffman as reviewers for this reason. |
baf579c to
ded5e5f
Compare
* Determines appropriate version of netcdf to use * Minor compatability fixes * adds Titan instructions
ded5e5f to
b7ff563
Compare
|
@xylar , to be clear, I should just confirm that I can build and use these tools on the platforms on which we normally work? |
|
@matthewhoffman, yes, I think that's the highest priority. To make sure this PR does no harm to your normal workflow with these tools. @mark-petersen, same on the ocean side; @akturner, same on the sea-ice side. |
matthewhoffman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the changes on my Mac laptop and Linux desktop and had no problems with either. Looks good to me, and thanks for making these improvements.
|
Summary: Tested on grizzly. gnu works. intel works on master but not on this PR. gnu works intel does not and commenting gnu. This compiles and can successfully run on MPAS-Tools/master. On this branch, I get: It looks like a library problem, but it didn't happen on master, I'm not sure what is going on here. |
| # CFLAGS= -O3 -std=c++0x -openmp | ||
| # DFLAGS= -g -std=c++0x -D_DEBUG -openmp | ||
| # CFLAGS= -O3 -std=c++0x -openmp -lstdc++ | ||
| # DFLAGS= -g -std=c++0x -D_DEBUG -openmp -lstdc++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intel flag has changed from -openmp to -qopenmp on these two lines. Right now we get:
icpc: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'
| ifneq (${NETCDF}, ) | ||
| ifneq ($(shell which ${NETCDF}/bin/nc-config 2> /dev/null), ) | ||
| LIBS = $(shell ${NETCDF}/bin/nc-config --libs) -lnetcdf_c++ | ||
| INCS = $(shell ${NETCDF}/bin/nc-config --cflags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous two lines are causing the problem on grizzly using intel. For some reason I don't understand, I end up with the $NETCDF path prepended to both $LIBS and $INCS due to these lines. That is, I get:
gr-fe3.lanl.gov> pwd
/turquoise/usr/projects/climate/mpeterse/repos/MPAS-Tools/pr_temp/grid_gen/mesh_conversion_tools
gr-fe3.lanl.gov> module load intel/17.0.1 openmpi/1.10.5 netcdf/4.4.1 parallel-netcdf/1.5.0 pio/1.7.2
gr-fe3.lanl.gov> make
icpc mpas_mesh_converter.cpp netcdf_utils.cpp -O3 -std=c++0x -openmp -lstdc++ -o MpasMeshConverter.x -I. /usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1 -I/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1/include /usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1 -L/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1/lib -lnetcdf -lnetcdf_c++
|
@mark-petersen, it looks like the |
| else | ||
| LIBS= -L${NETCDF}/lib | ||
| LIBS += -lnetcdf_c++ -lnetcdf | ||
| INCS = -I${NETCDF}/include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pwolfram, isn't $NETCDF empty in this case? So you might as well try not adding any path to LIBS and INCS and hope it's in the default path. Or issue an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I see. Based on your commands above, on grizzly with intel loaded:
gr-fe2.lanl.gov> ${NETCDF}/bin/nc-config --cflags
/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1
-I/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1/include
That is the trouble. For some reason intel adds the extra path. Compare to the gnu version on grizzly:
gr-fe3.lanl.gov> ${NETCDF}/bin/nc-config --cflags
-I/usr/projects/climate/lvanroekel/netcdf_gcc/include
In fact, it always does it. Look at this strange behavior on grizzly with intel:
gr-fe2.lanl.gov> module use /usr/projects/climate/SHARED_CLIMATE/modulefiles/all/;module load python/anaconda-2.7-climate;module load intel/17.0.1 openmpi/1.10.5 netcdf/4.4.1 parallel-netcdf/1.5.0 pio/1.7.2;
gr-fe2.lanl.gov> ${NETCDF}/bin/nc-config --includedir
/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1
/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1/include
gr-fe2.lanl.gov> ${NETCDF}/bin/nc-config --libs
/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1
-L/usr/projects/climate/SHARED_CLIMATE/software/grizzly/netcdf/4.4.1/intel-17.0.1/lib -lnetcdf
this appears to be a bug in the nc-config script. I guess we need a work-around.
|
@mark-petersen and @xylar this has to be an issue with how I installed the netcdf-c libraries. I've been meaning to correct the gnu one for a while, but have not had time to get back to this. What I don't understand is why the entry for --cflags in nc-config --all looks reasonable (below), but nc-config --cflags prepends garbage. Note, that nf-config --cflags gives the appropriate result as well. I will look into this. But my netcdf install directory is on scratch2 which is not responsive right now. |
|
@mark-petersen can you please try your tests again. I think I have fixed the grizzly issue. Here are @xylar's commands with what I now get on grizzly with intel/17.0.1 Also for gcc/5.3.0 |
|
Yes, @vanroekel that did it. Thanks, that is really great! I was able to successfully compile with intel on grizzly, and run an init_step1 with it. Here you can see the calls that are now fixed: |
|
I also just pushed up one commit changing the updated intel flag name. |
|
@mark-petersen, are we at the point where everyone should review this prior to a merge? |
mark-petersen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested my standard process on grizzly with intel and gnu. After the above changes, everything works.
|
@akturner, thoughts on merging this PR that was used to address the compilation issue you found in the last week or so? |
|
@xylar, it is probably good if you have another look at this too. |
akturner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont have time to test this so go ahead with the merge
|
@pwolfram, since we have special instructions for Titan, it might be worth adding these for Edison: Edit as you see fit. |
|
I was able to build successfully on my laptop and on Wolf (both g++ and icpc) with the default settings. I was able to build on Edison following the above instructions. @pwolfram, if you add the comment above (or if you tell me that you'd prefer not to), I'll merge. |
|
@xylar, please feel free to add the comments for edison as a new commit and then merge. Thank you! |
|
Will do. |
|
Thanks @xylar! |
Fixes compile issues on titan (#156)