-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,68 @@ | ||
| #Assumes ${NETCDF} is defined to the root of the netcdf library | ||
|
|
||
| # gfortran | ||
| #### titan instructions #### | ||
| # module purge | ||
| # module load gcc/4.9.3 | ||
| # module load cray-netcdf/3.6.2 | ||
| # printenv NETCDF_DIR | ||
| # export NETCDF=$NETCDF_DIR | ||
| # make | ||
|
|
||
| #### edison instructions #### | ||
| # In this file: | ||
| # comment gnu, uncomment intel flags | ||
| # change to: | ||
| # CC=CC | ||
| # may need to unload parallel NetCDF and HDF5 libraries | ||
| # to avoid g++ conflicts: | ||
| # module unload python | ||
| # then: | ||
| # module load cray-netcdf | ||
| # module load netcdf-cxx | ||
| # export NETCDF=/usr/common/graphics/netcdf-cxx/4.2 | ||
| # make | ||
|
|
||
| # gnu | ||
| CC=g++ | ||
| CFLAGS= -O3 -std=c++0x -fopenmp | ||
| DFLAGS= -g -std=c++0x -D_DEBUG -fopenmp | ||
| CFLAGS= -O3 -std=c++0x -fopenmp -lstdc++ | ||
| DFLAGS= -g -std=c++0x -D_DEBUG -fopenmp -lstdc++ | ||
|
|
||
| # intel | ||
| # CC=icpc | ||
| # CFLAGS= -O3 -std=c++0x -openmp | ||
| # DFLAGS= -g -std=c++0x -D_DEBUG -openmp | ||
| # CFLAGS= -O3 -std=c++0x -qopenmp -lstdc++ | ||
| # DFLAGS= -g -std=c++0x -D_DEBUG -qopenmp -lstdc++ | ||
|
|
||
| CONV_EXECUTABLE= MpasMeshConverter.x | ||
| CULL_EXECUTABLE= MpasCellCuller.x | ||
| MASK_EXECUTABLE= MpasMaskCreator.x | ||
|
|
||
| NCINCDIR=${NETCDF}/include | ||
| NCLIBDIR=${NETCDF}/lib | ||
| 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) | ||
| else | ||
| LIBS= -L${NETCDF}/lib | ||
| LIBS += -lnetcdf_c++ -lnetcdf | ||
| INCS = -I${NETCDF}/include | ||
| endif | ||
| else ifneq ($(shell which nc-config 2> /dev/null), ) | ||
| LIBS = $(shell nc-config --libs) -lnetcdf_c++ | ||
| INCS = $(shell nc-config --cflags) | ||
| else | ||
| LIBS= -L${NETCDF}/lib | ||
| LIBS += -lnetcdf_c++ -lnetcdf | ||
| INCS = -I${NETCDF}/include | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pwolfram, isn't
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: That is the trouble. For some reason intel adds the extra path. Compare to the gnu version on grizzly: In fact, it always does it. Look at this strange behavior on grizzly with intel: this appears to be a bug in the |
||
| endif | ||
|
|
||
| all: | ||
| ${CC} mpas_mesh_converter.cpp netcdf_utils.cpp ${CFLAGS} -o ${CONV_EXECUTABLE} -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_cell_culler.cpp netcdf_utils.cpp ${CFLAGS} -o ${CULL_EXECUTABLE} -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_mask_creator.cpp netcdf_utils.cpp jsoncpp.cpp ${CFLAGS} -o ${MASK_EXECUTABLE} -I. -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_mesh_converter.cpp netcdf_utils.cpp ${CFLAGS} -o ${CONV_EXECUTABLE} -I. ${INCS} ${LIBS} | ||
| ${CC} mpas_cell_culler.cpp netcdf_utils.cpp ${CFLAGS} -o ${CULL_EXECUTABLE} ${INCS} ${LIBS} | ||
| ${CC} mpas_mask_creator.cpp netcdf_utils.cpp jsoncpp.cpp ${CFLAGS} -o ${MASK_EXECUTABLE} -I. ${INCS} ${LIBS} | ||
|
|
||
| debug: | ||
| ${CC} mpas_mesh_converter.cpp netcdf_utils.cpp ${DFLAGS} -o ${CONV_EXECUTABLE} -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_cell_culler.cpp netcdf_utils.cpp ${DFLAGS} -o ${CULL_EXECUTABLE} -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_mask_creator.cpp netcdf_utils.cpp jsoncpp.cpp ${DFLAGS} -o ${MASK_EXECUTABLE} -I. -I${NCINCDIR} -L${NCLIBDIR} -lnetcdf_c++ -lnetcdf -lstdc++ | ||
| ${CC} mpas_mesh_converter.cpp netcdf_utils.cpp ${DFLAGS} -o ${CONV_EXECUTABLE} ${INCS} ${LIBS} | ||
| ${CC} mpas_cell_culler.cpp netcdf_utils.cpp ${DFLAGS} -o ${CULL_EXECUTABLE} ${INCS} ${LIBS} | ||
| ${CC} mpas_mask_creator.cpp netcdf_utils.cpp jsoncpp.cpp ${DFLAGS} -o ${MASK_EXECUTABLE} -I. ${INCS} ${LIBS} | ||
|
|
||
| clean: | ||
| rm -f grid.nc | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -978,7 +978,7 @@ int resetFeatureInfo(){/*{{{*/ | |
| return 0; | ||
| }/*}}}*/ | ||
| int getFeatureInfo(const string featureFilename){/*{{{*/ | ||
| ifstream json_file(featureFilename); | ||
| ifstream json_file(featureFilename.c_str()); | ||
|
||
| Json::Value root; | ||
| string groupName, tempGroupName; | ||
| vector<int> pointIndices; | ||
|
|
@@ -1304,7 +1304,7 @@ int getFeatureInfo(const string featureFilename){/*{{{*/ | |
| return 0; | ||
| }/*}}}*/ | ||
| int getSeedInfo(const string seedFilename){/*{{{*/ | ||
| ifstream json_file(seedFilename); | ||
| ifstream json_file(seedFilename.c_str()); | ||
| Json::Value root; | ||
|
|
||
| json_file >> root; | ||
|
|
||
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
$NETCDFpath prepended to both$LIBSand$INCSdue to these lines. That is, I get: